デフォルトのロールとフィルターを更新する 非推奨

PUT /groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule

データソースのデフォルトのロールとフィルターを変更します。

path パラメータ

application/ JSON

body 必須

更新されたデフォルト ルール構成オブジェクト。

応答

  • 204

    デフォルト ルールが正常に変更されました。

  • 400 application/ JSON

    無効なリクエスト

    応答属性を非表示 応答属性の表示 オブジェクト
    • エラー string

      値は default rule does not exist または service default rule id mismatch です。

PUT /groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule
curl \
 --request PUT 'https://services.cloud.mongodb.com/api/admin/v3.0/groups/{groupId}/apps/{appId}/services/{serviceId}/default_rule' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"_id":"string","roles":[{"_id":"string","document_filters":{"read":{},"write":{}},"name":"string","apply_when":{},"read":{},"write":{},"insert":{},"delete":{},"search":{},"fields":{},"additional_fields":{"read":{},"write":{}}}],"filters":[{"_id":"string","name":"string","apply_when":{},"query":{},"projection":{"additionalProperty1":0,"additionalProperty2":0}}]}'
リクエスト例
{
  "_id": "string",
  "roles": [
    {
      "_id": "string",
      "document_filters": {
        "read": {},
        "write": {}
      },
      "name": "string",
      "apply_when": {},
      "read": {},
      "write": {},
      "insert": {},
      "delete": {},
      "search": {},
      "fields": {},
      "additional_fields": {
        "read": {},
        "write": {}
      }
    }
  ],
  "filters": [
    {
      "_id": "string",
      "name": "string",
      "apply_when": {},
      "query": {},
      "projection": {
        "additionalProperty1": 0,
        "additionalProperty2": 0
      }
    }
  ]
}
応答の例(400)
{
  "error": "default rule does not exist"
}