Clusters

A cluster in this context describes a grouping of multiple MongoDB instances into a replica set or sharded cluster.

Get Clusters

get

Retrieves a list of MongoDB clusters.

Authorizations
Query parameters
limitinteger · min: 1 · max: 1000Optional

The maximum number of elements to return. Use together with 'offset' for pagination.

Default: 100Example: 100
offsetintegerOptional

The first element to return. Use together with 'limit' for pagination.

Default: 0Example: 200
filter.namestringOptional

Response filter to list only the MongoDB clusters that contain the specified name. The value is case insensitive and matched on the 'displayName' field.

Responses
200
Successful operation.
application/json
Responseall of

List of clusters.

and
get
GET /databases/mongodb/clusters HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "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": "[email protected]",
        "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "lastModifiedDate": "2020-12-11T13:37:50+01:00",
        "lastModifiedBy": "[email protected]",
        "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
        "state": "AVAILABLE",
        "health": "HEALTHY"
      },
      "properties": {
        "type": "replicaset",
        "displayName": "MongoDB cluster",
        "mongoDBVersion": "6.0",
        "location": "de/txl",
        "backup": {
          "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"
            ]
          }
        ],
        "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": "text",
          "port": "text"
        },
        "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>"
  }
}

Create a Cluster

post

Creates a new MongoDB cluster.

Authorizations
Body

The request payload with all data needed to create a new MongoDB cluster.

Responses
200
The created cluster is returned and is automatically set to `state = BUSY`.
application/json
post
POST /databases/mongodb/clusters HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 980

{
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE",
    "health": "HEALTHY"
  },
  "properties": {
    "type": "replicaset",
    "templateID": "498ae72f-411f-11eb-9d07-046c59cc737e",
    "mongoDBVersion": "6.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"
        ]
      }
    ],
    "location": "de/txl",
    "backup": {
      "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": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE",
    "health": "HEALTHY"
  },
  "properties": {
    "type": "replicaset",
    "displayName": "MongoDB cluster",
    "mongoDBVersion": "6.0",
    "location": "de/txl",
    "backup": {
      "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"
        ]
      }
    ],
    "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": "text",
      "port": "text"
    },
    "edition": "playground",
    "cores": 4,
    "ram": 2048,
    "storageSize": 5000,
    "storageType": "HDD"
  }
}

Get a cluster by id

get

Get a cluster by id.

Authorizations
Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Responses
200
Successful operation.
application/json
get
GET /databases/mongodb/clusters/{clusterId} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "type": "cluster",
  "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE",
    "health": "HEALTHY"
  },
  "properties": {
    "type": "replicaset",
    "displayName": "MongoDB cluster",
    "mongoDBVersion": "6.0",
    "location": "de/txl",
    "backup": {
      "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"
        ]
      }
    ],
    "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": "text",
      "port": "text"
    },
    "edition": "playground",
    "cores": 4,
    "ram": 2048,
    "storageSize": 5000,
    "storageType": "HDD"
  }
}

Delete a Cluster

delete

Deletes a MongoDB cluster.

Authorizations
Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Responses
200
The cluster to be deleted is automatically set to `state = DESTROYING`.
application/json
delete
DELETE /databases/mongodb/clusters/{clusterId} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "type": "cluster",
  "id": "498ae72f-411f-11eb-9d07-046c59cc737e",
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE",
    "health": "HEALTHY"
  },
  "properties": {
    "type": "replicaset",
    "displayName": "MongoDB cluster",
    "mongoDBVersion": "6.0",
    "location": "de/txl",
    "backup": {
      "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"
        ]
      }
    ],
    "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": "text",
      "port": "text"
    },
    "edition": "playground",
    "cores": 4,
    "ram": 2048,
    "storageSize": 5000,
    "storageType": "HDD"
  }
}

Patch a cluster

patch

Patch attributes of a MongoDB cluster.

Authorizations
Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Body

Request payload to change a cluster.

Responses
200
Successful operation.
application/json
patch
PATCH /databases/mongodb/clusters/{clusterId} HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Content-Type: application/json
Accept: */*
Content-Length: 844

{
  "metadata": {
    "createdDate": "2020-12-10T13:37:50+01:00",
    "createdBy": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "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": {
      "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"
        ]
      }
    ],
    "templateID": "498ae72f-411f-11eb-9d07-046c59cc737e",
    "mongoDBVersion": "6.0",
    "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": "[email protected]",
    "createdByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "lastModifiedDate": "2020-12-11T13:37:50+01:00",
    "lastModifiedBy": "[email protected]",
    "lastModifiedByUserId": "87f9a82e-b28d-49ed-9d04-fba2c0459cd3",
    "state": "AVAILABLE",
    "health": "HEALTHY"
  },
  "properties": {
    "type": "replicaset",
    "displayName": "MongoDB cluster",
    "mongoDBVersion": "6.0",
    "location": "de/txl",
    "backup": {
      "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"
        ]
      }
    ],
    "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": "text",
      "port": "text"
    },
    "edition": "playground",
    "cores": 4,
    "ram": 2048,
    "storageSize": 5000,
    "storageType": "HDD"
  }
}

Get available MongoDB versions for this cluster

get

Retrieves all MongoDB versions currently selectable for this cluster.

Authorizations
Path parameters
clusterIdstringRequired

The unique ID of the cluster.

Responses
200
Successful operation.
application/json
get
GET /databases/mongodb/clusters/{clusterId}/versions HTTP/1.1
Host: api.ionos.com
Authorization: Basic username:password
Accept: */*
{
  "data": [
    {
      "name": "6.0"
    }
  ]
}

Was this helpful?