{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"To add a new database user, send a POST request to `/v2/databases/$DATABASE_ID/users`\nwith the desired username.\n\nNote: User management is not supported for Caching or Valkey clusters.\n\nWhen adding a user to a MySQL cluster, additional options can be configured in the\n`mysql_settings` object.\n\nWhen adding a user to a PostgreSQL cluster, additional options can be configured in\nthe `settings` object (for example, `pg_allow_replication`). When\n`pg_allow_replication` is omitted, it defaults to `false`.\n\nWhen adding a user to a Kafka cluster, additional options can be configured in\nthe `settings` object.\n\nWhen adding a user to a MongoDB cluster, additional options can be configured in\nthe `settings.mongo_user_settings` object.\n\nThe response will be a JSON object with a key called `user`. The value of this will be an\nobject that contains the standard attributes associated with a database user including\nits randomly generated password.\n","properties":{"path":{"type":"object","properties":{"database_cluster_uuid":{"type":"string","format":"uuid","examples":["9cc10173-e9ea-4176-9dbc-a4cee4c4ff30"],"description":"A unique identifier for a database cluster."}},"required":["database_cluster_uuid"],"additionalProperties":false},"body":{"allOf":[{"$ref":"#/definitions/database_user"},{"type":"object","properties":{"readonly":{"type":"boolean","description":"(To be deprecated: use settings.mongo_user_settings.role instead for access controls to MongoDB databases). \nFor MongoDB clusters, set to `true` to create a read-only user.\nThis option is not currently supported for other database engines.\n           \n","examples":[true]}}}],"examples":[{"name":"app-01"}]}},"required":["path","body"],"additionalProperties":false,"definitions":{"database_user":{"type":"object","properties":{"name":{"type":"string","description":"The name of a database user.","examples":["app-01"]},"mysql_settings":{"$ref":"#/definitions/mysql_settings"},"settings":{"$ref":"#/definitions/user_settings"}},"required":["name"]},"mysql_settings":{"type":"object","properties":{"auth_plugin":{"type":"string","enum":["mysql_native_password","caching_sha2_password"],"description":"A string specifying the authentication method to be used for connections\nto the MySQL user account. The valid values are `mysql_native_password`\nor `caching_sha2_password`. If excluded when creating a new user, the\ndefault for the version of MySQL in use will be used. As of MySQL 8.0, the\ndefault is `caching_sha2_password`.\n","examples":["mysql_native_password"]}},"required":["auth_plugin"]},"user_settings":{"type":"object","properties":{"pg_allow_replication":{"type":"boolean","description":"For PostgreSQL clusters, set to `true` to grant the user replication\nprivileges. When omitted on create or update, the value defaults to\n`false` and replication privileges are not granted. This option is not\ncurrently supported for other database engines.\n","examples":[true]},"opensearch_acl":{"type":"array","items":{"type":"object","properties":{"index":{"type":"string","description":"A regex for matching the indexes that this ACL should apply to.","examples":["index-abc.*"]},"permission":{"type":"string","enum":["deny","admin","read","readwrite","write"],"description":"Permission set applied to the ACL. 'read' allows user to read from the index. 'write' allows for user to write to the index. 'readwrite' allows for both 'read' and 'write' permission. 'deny'(default) restricts user from performing any operation over an index. 'admin' allows for 'readwrite' as well as any operations to administer the index.","examples":["read"]}}},"description":"ACLs (Access Control Lists) specifying permissions on index within a OpenSearch cluster."},"acl":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"An identifier for the ACL. Will be computed after the ACL is created/updated.","examples":["aaa"]},"topic":{"type":"string","description":"A regex for matching the topic(s) that this ACL should apply to.","examples":["topic-abc.*"]},"permission":{"type":"string","enum":["admin","consume","produce","produceconsume"],"description":"Permission set applied to the ACL. 'consume' allows for messages to be consumed from the topic. 'produce' allows for messages to be published to the topic. 'produceconsume' allows for both 'consume' and 'produce' permission. 'admin' allows for 'produceconsume' as well as any operations to administer the topic (delete, update).","examples":["consume"]}},"required":["topic","permission"]},"description":"ACLs (Access Control Lists) specifying permissions on topics within a Kafka cluster."},"mongo_user_settings":{"type":"object","properties":{"databases":{"type":"array","items":{"type":"string","examples":["my-db"]},"description":"A list of databases to which the user should have access. When the database is set to `admin`, the user will have access to all databases based on the user's role i.e. a user with the role `readOnly` assigned to the `admin` database will have read access to all databases.","examples":[["my-db","my-db-2"]]},"role":{"type":"string","enum":["readOnly","readWrite","dbAdmin"],"description":"The role to assign to the user with each role mapping to a MongoDB built-in role.  `readOnly` maps to a [read](https://www.mongodb.com/docs/manual/reference/built-in-roles/#mongodb-authrole-read) role. `readWrite` maps to a [readWrite](https://www.mongodb.com/docs/manual/reference/built-in-roles/#mongodb-authrole-readWrite) role. `dbAdmin` maps to a [dbAdmin](https://www.mongodb.com/docs/manual/reference/built-in-roles/#mongodb-authrole-dbAdmin) role.","examples":["readOnly"]}},"description":"MongoDB-specific settings for the user. Configure these when creating a user. Updating MongoDB roles or database access after creation is not supported; recreate the user to change them. This option is not currently supported for other database engines."}}}}},"name":"Add a Database User","id":"digitalocean.databases_add_user","example":{"path":{"database_cluster_uuid":"9cc10173-e9ea-4176-9dbc-a4cee4c4ff30"},"body":{"name":"app-01"}},"maxRequests":1,"summary":false}}