Download OpenAPI specification:Download
With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API.
MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas.
The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use.
A cluster in this context describes a grouping of multiple MongoDB instances into a replica set or sharded cluster.
Retrieves a list of MongoDB clusters.
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=100 The maximum number of elements to return. Use together with 'offset' for pagination. |
offset | integer Default: 0 Example: offset=200 The first element to return. Use together with 'limit' for pagination. |
filter.name | string Response filter to list only the MongoDB clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field. |
{- "type": "collection",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "items": [
- {
- "type": "cluster",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "lastModifiedDate": "2020-12-11T13:37:50+01:00",
- "lastModifiedBy": "jane.doe@example.com",
- "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "state": "AVAILABLE",
- "health": "HEALTHY"
}, - "properties": {
- "type": "replicaset",
- "displayName": "MongoDB cluster",
- "mongoDBVersion": "5.0",
- "location": "de/txl",
- "backup": {
- "snapshotIntervalHours": 24,
- "pointInTimeWindowHours": 24,
- "backupRetention": {
- "snapshotRetentionDays": 2,
- "dailySnapshotRetentionDays": 7,
- "weeklySnapshotRetentionWeeks": 2,
- "monthlySnapshotRetentionMonths": 1
}, - "location": "de"
}, - "instances": 3,
- "shards": 2,
- "connections": [
- {
- "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
- "lanId": "2",
- "cidrList": [
- "192.168.1.100/24",
- "192.168.1.101/24"
], - "whitelist": [
- "192.168.1.100/24",
- "192.168.1.101/24"
]
}
], - "maintenanceWindow": {
- "time": "16:30:59",
- "dayOfTheWeek": "Monday"
}, - "templateID": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "connectionString": "mongo+srv://m-498ae72f-411f-11eb-9d07-046c59cc737e.mongodb.de-txl.ionos.com",
- "biConnector": {
- "enabled": false,
- "host": "string",
- "port": "string"
}, - "edition": "playground",
- "cores": 4,
- "ram": 2048,
- "storageSize": 5000,
- "storageType": "HDD"
}
}
], - "offset": 200,
- "limit": 100,
- "links": {
- "prev": "<PREVIOUS-PAGE-URI>",
- "self": "<THIS-PAGE-URI>",
- "next": "<NEXT-PAGE-URI>"
}
}
Creates a new MongoDB cluster.
The cluster to be created.
object (Metadata) The metadata of the resource. | |
object (CreateClusterProperties) The properties with all data needed to create a new MongoDB cluster. |
{- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "lastModifiedDate": "2020-12-11T13:37:50+01:00",
- "lastModifiedBy": "jane.doe@example.com",
- "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "state": "AVAILABLE",
- "health": "HEALTHY"
}, - "properties": {
- "type": "replicaset",
- "templateID": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "mongoDBVersion": "5.0",
- "instances": 3,
- "shards": 2,
- "connections": [
- {
- "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
- "lanId": "2",
- "cidrList": [
- "192.168.1.100/24",
- "192.168.1.101/24"
], - "whitelist": [
- "192.168.1.100/24",
- "192.168.1.101/24"
]
}
], - "location": "de/txl",
- "backup": {
- "snapshotIntervalHours": 24,
- "pointInTimeWindowHours": 24,
- "backupRetention": {
- "snapshotRetentionDays": 2,
- "dailySnapshotRetentionDays": 7,
- "weeklySnapshotRetentionWeeks": 2,
- "monthlySnapshotRetentionMonths": 1
}, - "location": "de"
}, - "displayName": "MongoDB cluster",
- "maintenanceWindow": {
- "time": "16:30:59",
- "dayOfTheWeek": "Monday"
}, - "biConnector": {
- "enabled": false
}, - "fromBackup": {
- "snapshotId": "dcd31531-3ac8-11eb-9feb-046c59cc737e",
- "recoveryTargetTime": "2023-04-21T13:37:50+01:00"
}, - "edition": "playground",
- "cores": 4,
- "ram": 2048,
- "storageSize": 5000,
- "storageType": "HDD"
}
}
{- "type": "cluster",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "lastModifiedDate": "2020-12-11T13:37:50+01:00",
- "lastModifiedBy": "jane.doe@example.com",
- "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "state": "AVAILABLE",
- "health": "HEALTHY"
}, - "properties": {
- "type": "replicaset",
- "displayName": "MongoDB cluster",
- "mongoDBVersion": "5.0",
- "location": "de/txl",
- "backup": {
- "snapshotIntervalHours": 24,
- "pointInTimeWindowHours": 24,
- "backupRetention": {
- "snapshotRetentionDays": 2,
- "dailySnapshotRetentionDays": 7,
- "weeklySnapshotRetentionWeeks": 2,
- "monthlySnapshotRetentionMonths": 1
}, - "location": "de"
}, - "instances": 3,
- "shards": 2,
- "connections": [
- {
- "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
- "lanId": "2",
- "cidrList": [
- "192.168.1.100/24",
- "192.168.1.101/24"
], - "whitelist": [
- "192.168.1.100/24",
- "192.168.1.101/24"
]
}
], - "maintenanceWindow": {
- "time": "16:30:59",
- "dayOfTheWeek": "Monday"
}, - "templateID": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "connectionString": "mongo+srv://m-498ae72f-411f-11eb-9d07-046c59cc737e.mongodb.de-txl.ionos.com",
- "biConnector": {
- "enabled": false,
- "host": "string",
- "port": "string"
}, - "edition": "playground",
- "cores": 4,
- "ram": 2048,
- "storageSize": 5000,
- "storageType": "HDD"
}
}
Get a cluster by id.
clusterId required | string The unique ID of the cluster. |
{- "type": "cluster",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "lastModifiedDate": "2020-12-11T13:37:50+01:00",
- "lastModifiedBy": "jane.doe@example.com",
- "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "state": "AVAILABLE",
- "health": "HEALTHY"
}, - "properties": {
- "type": "replicaset",
- "displayName": "MongoDB cluster",
- "mongoDBVersion": "5.0",
- "location": "de/txl",
- "backup": {
- "snapshotIntervalHours": 24,
- "pointInTimeWindowHours": 24,
- "backupRetention": {
- "snapshotRetentionDays": 2,
- "dailySnapshotRetentionDays": 7,
- "weeklySnapshotRetentionWeeks": 2,
- "monthlySnapshotRetentionMonths": 1
}, - "location": "de"
}, - "instances": 3,
- "shards": 2,
- "connections": [
- {
- "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
- "lanId": "2",
- "cidrList": [
- "192.168.1.100/24",
- "192.168.1.101/24"
], - "whitelist": [
- "192.168.1.100/24",
- "192.168.1.101/24"
]
}
], - "maintenanceWindow": {
- "time": "16:30:59",
- "dayOfTheWeek": "Monday"
}, - "templateID": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "connectionString": "mongo+srv://m-498ae72f-411f-11eb-9d07-046c59cc737e.mongodb.de-txl.ionos.com",
- "biConnector": {
- "enabled": false,
- "host": "string",
- "port": "string"
}, - "edition": "playground",
- "cores": 4,
- "ram": 2048,
- "storageSize": 5000,
- "storageType": "HDD"
}
}
Patch attributes of a MongoDB cluster.
clusterId required | string The unique ID of the cluster. |
Part of the cluster which should be modified.
object (Metadata) The metadata of the resource. | |
object (PatchClusterProperties) Properties of the payload to change a cluster. |
{- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "lastModifiedDate": "2020-12-11T13:37:50+01:00",
- "lastModifiedBy": "jane.doe@example.com",
- "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "state": "AVAILABLE",
- "health": "HEALTHY"
}, - "properties": {
- "type": "replicaset",
- "displayName": "MongoDB cluster",
- "maintenanceWindow": {
- "time": "16:30:59",
- "dayOfTheWeek": "Monday"
}, - "instances": 3,
- "shards": 2,
- "backup": {
- "snapshotIntervalHours": 24,
- "pointInTimeWindowHours": 24,
- "backupRetention": {
- "snapshotRetentionDays": 2,
- "dailySnapshotRetentionDays": 7,
- "weeklySnapshotRetentionWeeks": 2,
- "monthlySnapshotRetentionMonths": 1
}, - "location": "de"
}, - "biConnector": {
- "enabled": false
}, - "connections": [
- {
- "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
- "lanId": "2",
- "cidrList": [
- "192.168.1.100/24",
- "192.168.1.101/24"
], - "whitelist": [
- "192.168.1.100/24",
- "192.168.1.101/24"
]
}
], - "templateID": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "edition": "playground",
- "cores": 4,
- "ram": 2048,
- "storageSize": 5000,
- "storageType": "HDD"
}
}
{- "type": "cluster",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "lastModifiedDate": "2020-12-11T13:37:50+01:00",
- "lastModifiedBy": "jane.doe@example.com",
- "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "state": "AVAILABLE",
- "health": "HEALTHY"
}, - "properties": {
- "type": "replicaset",
- "displayName": "MongoDB cluster",
- "mongoDBVersion": "5.0",
- "location": "de/txl",
- "backup": {
- "snapshotIntervalHours": 24,
- "pointInTimeWindowHours": 24,
- "backupRetention": {
- "snapshotRetentionDays": 2,
- "dailySnapshotRetentionDays": 7,
- "weeklySnapshotRetentionWeeks": 2,
- "monthlySnapshotRetentionMonths": 1
}, - "location": "de"
}, - "instances": 3,
- "shards": 2,
- "connections": [
- {
- "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
- "lanId": "2",
- "cidrList": [
- "192.168.1.100/24",
- "192.168.1.101/24"
], - "whitelist": [
- "192.168.1.100/24",
- "192.168.1.101/24"
]
}
], - "maintenanceWindow": {
- "time": "16:30:59",
- "dayOfTheWeek": "Monday"
}, - "templateID": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "connectionString": "mongo+srv://m-498ae72f-411f-11eb-9d07-046c59cc737e.mongodb.de-txl.ionos.com",
- "biConnector": {
- "enabled": false,
- "host": "string",
- "port": "string"
}, - "edition": "playground",
- "cores": 4,
- "ram": 2048,
- "storageSize": 5000,
- "storageType": "HDD"
}
}
Deletes a MongoDB cluster.
clusterId required | string The unique ID of the cluster. |
{- "type": "cluster",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "lastModifiedDate": "2020-12-11T13:37:50+01:00",
- "lastModifiedBy": "jane.doe@example.com",
- "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "state": "AVAILABLE",
- "health": "HEALTHY"
}, - "properties": {
- "type": "replicaset",
- "displayName": "MongoDB cluster",
- "mongoDBVersion": "5.0",
- "location": "de/txl",
- "backup": {
- "snapshotIntervalHours": 24,
- "pointInTimeWindowHours": 24,
- "backupRetention": {
- "snapshotRetentionDays": 2,
- "dailySnapshotRetentionDays": 7,
- "weeklySnapshotRetentionWeeks": 2,
- "monthlySnapshotRetentionMonths": 1
}, - "location": "de"
}, - "instances": 3,
- "shards": 2,
- "connections": [
- {
- "datacenterId": "5a029f4a-72e5-11ec-90d6-0242ac120003",
- "lanId": "2",
- "cidrList": [
- "192.168.1.100/24",
- "192.168.1.101/24"
], - "whitelist": [
- "192.168.1.100/24",
- "192.168.1.101/24"
]
}
], - "maintenanceWindow": {
- "time": "16:30:59",
- "dayOfTheWeek": "Monday"
}, - "templateID": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "connectionString": "mongo+srv://m-498ae72f-411f-11eb-9d07-046c59cc737e.mongodb.de-txl.ionos.com",
- "biConnector": {
- "enabled": false,
- "host": "string",
- "port": "string"
}, - "edition": "playground",
- "cores": 4,
- "ram": 2048,
- "storageSize": 5000,
- "storageType": "HDD"
}
}
Retrieves a list of MongoDB users.
clusterId required | string The unique ID of the cluster. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=100 The maximum number of elements to return. Use together with 'offset' for pagination. |
offset | integer Default: 0 Example: offset=200 The first element to return. Use together with 'limit' for pagination. |
{- "type": "collection",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "items": [
- {
- "type": "user",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
}, - "properties": {
- "username": "string",
- "roles": [
- {
- "role": "read",
- "database": "string"
}
]
}
}
]
}
Creates a MongoDB user.
clusterId required | string The unique ID of the cluster. |
The user to be created.
type | string Enum: "collection" "cluster" "user" "snapshot" "template" The resource type. |
object (UserMetadata) The metadata of the resource. | |
object (UserProperties) Mongodb user properties. |
{- "type": "user",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
}, - "properties": {
- "username": "string",
- "password": "stringstri",
- "roles": [
- {
- "role": "read",
- "database": "string"
}
]
}
}
{- "type": "user",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
}, - "properties": {
- "username": "string",
- "roles": [
- {
- "role": "read",
- "database": "string"
}
]
}
}
Retrieves the MongoDB user identified by the username.
clusterId required | string The unique ID of the cluster. |
username required | string The authentication username. |
{- "type": "user",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
}, - "properties": {
- "username": "string",
- "roles": [
- {
- "role": "read",
- "database": "string"
}
]
}
}
Patches a MongoDB user specified by its ID.
clusterId required | string The unique ID of the cluster. |
username required | string The authentication username. |
Part of the MongoDB user which should be modified.
object (UserMetadata) The metadata of the resource. | |
object (PatchUserProperties) MongoDB database user patch request properties. |
{- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
}, - "properties": {
- "password": "stringstri",
- "roles": [
- {
- "role": "read",
- "database": "string"
}
]
}
}
{- "type": "user",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
}, - "properties": {
- "username": "string",
- "roles": [
- {
- "role": "read",
- "database": "string"
}
]
}
}
Deletes a MongoDB user specified by its ID.
clusterId required | string The unique ID of the cluster. |
username required | string The authentication username. |
{- "type": "user",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3"
}, - "properties": {
- "username": "string",
- "roles": [
- {
- "role": "read",
- "database": "string"
}
]
}
}
Retrieves MongoDB logs based on the given parameters.
clusterId required | string The unique ID of the cluster. |
start | string <date-time> The start time for the query in RFC3339 format. Must not be more than 30 days ago but before the end parameter. The default is 30 days ago. |
end | string <date-time> The end time for the query in RFC3339 format. Must not be greater than now. The default is the current timestamp. |
direction | string Default: "BACKWARD" Enum: "BACKWARD" "FORWARD" The direction in which to scan through the logs. The logs are returned in order of the direction. |
limit | integer [ 1 .. 5000 ] Default: 100 The maximal number of log lines to return. If the limit is reached then log lines will be cut at the end (respecting the scan direction). |
{- "instances": [
- {
- "name": "mongodb-cluster-0",
- "messages": [
- {
- "time": "2021-09-06T10:00:38.253+02:00",
- "message": "Hello World"
}
]
}
]
}
Retrieves MongoDB snapshots.
clusterId required | string The unique ID of the cluster. |
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=100 The maximum number of elements to return. Use together with 'offset' for pagination. |
offset | integer Default: 0 Example: offset=200 The first element to return. Use together with 'limit' for pagination. |
{- "type": "collection",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "items": [
- {
- "type": "snapshot",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "properties": {
- "version": "5.0",
- "size": 150,
- "creationTime": "2020-12-10T13:37:50+01:00"
}
}
], - "offset": 200,
- "limit": 100,
- "links": {
- "prev": "<PREVIOUS-PAGE-URI>",
- "self": "<THIS-PAGE-URI>",
- "next": "<NEXT-PAGE-URI>"
}
}
Triggers an in-place restore of the given MongoDB cluster.
clusterId required | string The unique ID of the cluster. |
The restore request to create.
snapshotId | string The unique ID of the snapshot you want to restore. |
recoveryTargetTime | string <date-time> If this value is supplied as ISO 8601 timestamp, the backup will be replayed up until the given timestamp. |
{- "snapshotId": "dcd31531-3ac8-11eb-9feb-046c59cc737e",
- "recoveryTargetTime": "2023-04-21T13:37:50+01:00"
}
{- "httpStatus": 400,
- "messages": [
- {
- "errorCode": "dbaas-err-api-123",
- "message": "Error message example"
}
]
}
Templates define a list of CUBE compute resources to be used by Business Edition database clusters.
Retrieves a list of valid templates. These templates can be used to create MongoDB clusters; they contain properties, such as number of cores, RAM, and the storage size.
limit | integer [ 1 .. 1000 ] Default: 100 Example: limit=100 The maximum number of elements to return. Use together with 'offset' for pagination. |
offset | integer Default: 0 Example: offset=200 The first element to return. Use together with 'limit' for pagination. |
{- "type": "collection",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "items": [
- {
- "type": "template",
- "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
- "metadata": {
- "createdDate": "2020-12-10T13:37:50+01:00",
- "createdBy": "john.doe@example.com",
- "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "lastModifiedDate": "2020-12-11T13:37:50+01:00",
- "lastModifiedBy": "jane.doe@example.com",
- "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
- "state": "AVAILABLE",
- "health": "HEALTHY"
}, - "properties": {
- "name": "MongoDB Community 4XL",
- "edition": "enterprise",
- "cores": 1,
- "ram": 2048,
- "storageSize": 30
}
}
], - "offset": 200,
- "limit": 100,
- "links": {
- "prev": "<PREVIOUS-PAGE-URI>",
- "self": "<THIS-PAGE-URI>",
- "next": "<NEXT-PAGE-URI>"
}
}