Users
How to manage users of a database cluster.
Retrieves a list of MongoDB users.
The unique ID of the cluster.
The maximum number of elements to return. Use together with 'offset' for pagination.
100
Example: 100
The first element to return. Use together with 'limit' for pagination.
0
Example: 200
GET /databases/mongodb/clusters/{clusterId}/users HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
"type": "collection",
"id": "498ae72f-411f-11eb-9d07-046c59cc737e",
"items": [
{
"type": "user",
"metadata": {
"createdDate": "2020-12-10T13:37:50+01:00",
"createdBy": "[email protected]",
"createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
},
"properties": {
"username": "text",
"roles": [
{
"role": "read",
"database": "text"
}
]
}
}
]
}
Creates a MongoDB user.
The unique ID of the cluster.
MongoDB database user post request.
MongoDB database user post request properties.
POST /databases/mongodb/clusters/{clusterId}/users HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 243
{
"metadata": {
"createdDate": "2020-12-10T13:37:50+01:00",
"createdBy": "[email protected]",
"createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
},
"properties": {
"username": "text",
"roles": [
{
"role": "read",
"database": "text"
}
],
"password": "text"
}
}
{
"type": "user",
"metadata": {
"createdDate": "2020-12-10T13:37:50+01:00",
"createdBy": "[email protected]",
"createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
},
"properties": {
"username": "text",
"roles": [
{
"role": "read",
"database": "text"
}
]
}
}
Retrieves the MongoDB user identified by the username.
The unique ID of the cluster.
The authentication username.
GET /databases/mongodb/clusters/{clusterId}/users/{username} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
"type": "user",
"metadata": {
"createdDate": "2020-12-10T13:37:50+01:00",
"createdBy": "[email protected]",
"createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
},
"properties": {
"username": "text",
"roles": [
{
"role": "read",
"database": "text"
}
]
}
}
Deletes a MongoDB user specified by its ID.
The unique ID of the cluster.
The authentication username.
DELETE /databases/mongodb/clusters/{clusterId}/users/{username} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
"type": "user",
"metadata": {
"createdDate": "2020-12-10T13:37:50+01:00",
"createdBy": "[email protected]",
"createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
},
"properties": {
"username": "text",
"roles": [
{
"role": "read",
"database": "text"
}
]
}
}
Patches a MongoDB user specified by its ID.
The unique ID of the cluster.
The authentication username.
MongoDB database user patch request.
PATCH /databases/mongodb/clusters/{clusterId}/users/{username} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 225
{
"metadata": {
"createdDate": "2020-12-10T13:37:50+01:00",
"createdBy": "[email protected]",
"createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
},
"properties": {
"password": "text",
"roles": [
{
"role": "read",
"database": "text"
}
]
}
}
{
"type": "user",
"metadata": {
"createdDate": "2020-12-10T13:37:50+01:00",
"createdBy": "[email protected]",
"createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
},
"properties": {
"username": "text",
"roles": [
{
"role": "read",
"database": "text"
}
]
}
}
Was this helpful?