Pin Namespaces
On this page
Cloud Manager will no longer support Automation, Backup, and Monitoring for MongoDB 3.6 and 4.0 after August 30th, 2024. Please upgrade your MongoDB deployment or migrate to Atlas.
- OAuth 2.0 authentication for programmatic access to Cloud Manager is available as a Preview feature.
- The feature and the corresponding documentation might change at any time during the Preview period. To use OAuth 2.0 authentication, create a service account to use in your requests to the Cloud Manager Public API.
Pin a list of namespaces for collection-level query latency metrics collection for the specified project and cluster. This action initializes a pinned namespaces list or replaces any existing pinned namespaces list for the project or cluster.
Base URL: https://cloud.mongodb.com/api/public/v1.0
Resource
PUT /groups/{PROJECT-ID}/clusters/{hostClusterId}/collStats/pinned
Request Path Parameters
Parameter | Type | Description |
---|---|---|
PROJECT-ID | string | (Required.) Unique 24-hexadecimal digit string that
identifies the project that contains the namespaces to pin. |
hostClusterId | string | (Required.) Unique identifier for the cluster that contains
the namespaces to pin. |
Request Query Parameters
All parameters are optional.
Name | Type | Description | Default |
---|---|---|---|
pretty | boolean | Indicates whether the response body should be in a
prettyprint format. | false |
envelope | boolean | Indicates whether or not to wrap the response in an
envelope. | false |
Request Body Parameters
Name | Type | Description | Default |
---|---|---|---|
namespaces | array | List that contains each namespace to pin for query
latency metric collection. |
Response
Name | Type | Description |
---|---|---|
clusterId | string | Unique string that identifies the cluster. |
groupId | string | Unique 24-hexadecimal digit string that
identifies the project. |
pinnedNamespaces | array | List that contains each pinned namespace after the
update completes. |
Example Request
curl --user '{PUBLIC-KEY}:{PRIVATE-KEY}' --digest \ --header 'Accept: application/json' \ --include \ --request PUT 'https://{CLOUD-MANAGER-HOST}:{PORT}/api/public/v1.0/groups/{PROJECT-ID}/clusters/{hostClusterId}/collStats/pinned?pretty=true' --data '{ "namespaces": ["testDb.collection1", "testDb.collection2"] }'
Example Response
Response Header
201 Created Vary: Accept-Encoding Content-Type: application/json Strict-Transport-Security: max-age=300 Date: {dateInUnixFormat} Connection: keep-alive Content-Length: {requestLengthInBytes} X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
Response Body
{ "clusterId": "{hostClusterId}", "groupId": "{PROJECT-ID}", "pinnedNamespaces": [ "testDb.collection1", "testDb.collection2" ] }