From a5e9368e7d158e8e7ae4e3689ab7236797702528 Mon Sep 17 00:00:00 2001 From: Andrea Angiolillo Date: Sat, 5 Jul 2025 22:03:08 +0100 Subject: [PATCH 1/5] feat: add codegen to `tools` --- tools/codegen/codegen.yaml | 1981 + tools/codegen/codespec/api_spec.go | 93 + tools/codegen/codespec/api_spec_schema.go | 53 + .../codespec/api_to_provider_spec_mapper.go | 327 + .../api_to_provider_spec_mapper_test.go | 524 + tools/codegen/codespec/attribute.go | 291 + tools/codegen/codespec/computability.go | 10 + tools/codegen/codespec/config.go | 162 + tools/codegen/codespec/constants.go | 21 + tools/codegen/codespec/element_type.go | 20 + tools/codegen/codespec/merge_attributes.go | 180 + tools/codegen/codespec/model.go | 170 + tools/codegen/codespec/testdata/api-spec.yml | 567 + .../config-nested-schema-overrides.yml | 46 + tools/codegen/codespec/testdata/config.yml | 44 + tools/codegen/config.yml | 446 + tools/codegen/config/config_model.go | 62 + tools/codegen/config/parser.go | 22 + tools/codegen/go.mod | 31 + tools/codegen/go.sum | 55 + tools/codegen/main.go | 76 + tools/codegen/open-api-spec.yml | 55820 ++++++++++++++++ tools/codegen/openapi/parser.go | 58 + tools/codegen/stringcase/string_case.go | 48 + 24 files changed, 61107 insertions(+) create mode 100644 tools/codegen/codegen.yaml create mode 100644 tools/codegen/codespec/api_spec.go create mode 100644 tools/codegen/codespec/api_spec_schema.go create mode 100644 tools/codegen/codespec/api_to_provider_spec_mapper.go create mode 100644 tools/codegen/codespec/api_to_provider_spec_mapper_test.go create mode 100644 tools/codegen/codespec/attribute.go create mode 100644 tools/codegen/codespec/computability.go create mode 100644 tools/codegen/codespec/config.go create mode 100644 tools/codegen/codespec/constants.go create mode 100644 tools/codegen/codespec/element_type.go create mode 100644 tools/codegen/codespec/merge_attributes.go create mode 100644 tools/codegen/codespec/model.go create mode 100644 tools/codegen/codespec/testdata/api-spec.yml create mode 100644 tools/codegen/codespec/testdata/config-nested-schema-overrides.yml create mode 100644 tools/codegen/codespec/testdata/config.yml create mode 100644 tools/codegen/config.yml create mode 100644 tools/codegen/config/config_model.go create mode 100644 tools/codegen/config/parser.go create mode 100644 tools/codegen/go.mod create mode 100644 tools/codegen/go.sum create mode 100644 tools/codegen/main.go create mode 100644 tools/codegen/open-api-spec.yml create mode 100644 tools/codegen/openapi/parser.go create mode 100644 tools/codegen/stringcase/string_case.go diff --git a/tools/codegen/codegen.yaml b/tools/codegen/codegen.yaml new file mode 100644 index 0000000000..aab520b1ae --- /dev/null +++ b/tools/codegen/codegen.yaml @@ -0,0 +1,1981 @@ +resources: + - name: custom_db_role_api + operations: + create: + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + delete: + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Creates one custom role in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Stream Processing Owner role, or the Project Database Access Admin role. + attributes: + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Human-readable label that identifies the privilege action. + computedOptionalRequired: required + name: action + - listNested: + default: null + nestedobject: + attributes: + - bool: + default: null + description: Flag that indicates whether to grant the action on the cluster resource. If `true`, MongoDB Cloud ignores the **actions.resources.collection** and **actions.resources.db** parameters. + computedOptionalRequired: required + name: cluster + - string: + default: null + description: 'Human-readable label that identifies the collection on which you grant the action to one MongoDB user. If you don''t set this parameter, you grant the action to all collections in the database specified in the **actions.resources.db** parameter. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' + computedOptionalRequired: required + name: collection + - string: + default: null + description: 'Human-readable label that identifies the database on which you grant the action to one MongoDB user. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' + computedOptionalRequired: required + name: db + description: List of resources on which you grant the action. + computedOptionalRequired: optional + name: resources + description: List of the individual privilege actions that the role grants. + computedOptionalRequired: optional + name: actions + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - setNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Human-readable label that identifies the database on which someone grants the action to one MongoDB user. + computedOptionalRequired: required + name: db + - string: + default: null + description: Human-readable label that identifies the role inherited. Set this value to `admin` for every role except `read` or `readWrite`. + computedOptionalRequired: required + name: role + description: List of the built-in roles that this custom role inherits. + computedOptionalRequired: optional + name: inherited_roles + - string: + default: null + description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. + computedOptionalRequired: required + name: role_name + reqBodyUsage: 1 + openapi-schema: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserCustomDBRole" + x-xgen-version: 2023-01-01 + description: OK + - name: database_user_api + operations: + create: + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/databaseUsers + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} + delete: + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Creates one database user in the specified project. This MongoDB Cloud supports a maximum of 100 database users per project. If you require more than 100 database users on a project, contact Support. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Charts Admin role, Project Stream Processing Owner role, or the Project Database Access Admin role. + attributes: + - string: + default: NONE + description: Human-readable label that indicates whether the new database user authenticates with the Amazon Web Services (AWS) Identity and Access Management (IAM) credentials associated with the user or the user's role. + computedOptionalRequired: computed_optional + name: aws_iamtype + - string: + default: admin + description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. + computedOptionalRequired: computed_optional + name: database_name + - string: + default: null + description: Date and time when MongoDB Cloud deletes the user. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. You must specify a future date that falls within one week of making the Application Programming Interface (API) request. + computedOptionalRequired: optional + name: delete_after_date + - string: + default: null + description: Description of this database user. + computedOptionalRequired: optional + name: description + reqBodyUsage: 2 + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Key applied to tag and categorize this component. + computedOptionalRequired: optional + name: key + - string: + default: null + description: Value set to the Key applied to tag and categorize this component. + computedOptionalRequired: optional + name: value + description: List that contains the key-value pairs for tagging and categorizing the MongoDB database user. The labels that you define do not appear in the console. + computedOptionalRequired: optional + name: labels + - string: + default: NONE + description: Part of the Lightweight Directory Access Protocol (LDAP) record that the database uses to authenticate this database user on the LDAP host. + computedOptionalRequired: computed_optional + name: ldap_auth_type + - string: + default: NONE + description: Human-readable label that indicates whether the new database user or group authenticates with OIDC federated authentication. To create a federated authentication user, specify the value of USER in this field. To create a federated authentication group, specify the value of IDP_GROUP in this field. + computedOptionalRequired: computed_optional + name: oidc_auth_type + - string: + default: null + description: Alphanumeric string that authenticates this database user against the database specified in `databaseName`. To authenticate with SCRAM-SHA, you must specify this parameter. This parameter doesn't appear in this response. + computedOptionalRequired: optional + name: password + sensitive: true + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Collection on which this role applies. + computedOptionalRequired: optional + name: collection_name + - string: + default: null + description: Database to which the user is granted access privileges. + computedOptionalRequired: required + name: database_name + - string: + default: null + description: Human-readable label that identifies a group of privileges assigned to a database user. This value can either be a built-in role or a custom role. + computedOptionalRequired: required + name: role_name + description: List that provides the pairings of one role with one applicable database. + computedOptionalRequired: optional + name: roles + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Human-readable label that identifies the cluster or MongoDB Atlas Data Lake that this database user can access. + computedOptionalRequired: required + name: name + - string: + default: null + description: Category of resource that this database user can access. + computedOptionalRequired: required + name: type + description: List that contains clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances that this database user can access. If omitted, MongoDB Cloud grants the database user access to all the clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances in the project. + computedOptionalRequired: optional + name: scopes + - string: + default: null + description: | + Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: + + | Authentication Method | Parameter Needed | Parameter Value | username Format | + |---|---|---|---| + | AWS IAM | awsIAMType | ROLE | ARN | + | AWS IAM | awsIAMType | USER | ARN | + | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | + | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | + | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | + computedOptionalRequired: required + name: username + - string: + default: NONE + description: |- + X.509 method that MongoDB Cloud uses to authenticate the database user. + + - For application-managed X.509, specify `MANAGED`. + - For self-managed X.509, specify `CUSTOMER`. + + Users created with the `CUSTOMER` method require a Common Name (CN) in the **username** parameter. You must create externally authenticated users on the `$external` database. + computedOptionalRequired: computed_optional + name: x509type + openapi-schema: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudDatabaseUser" + x-xgen-version: 2023-01-01 + description: OK + - name: maintenance_window_api + operations: + create: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + delete: + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Updates the maintenance window for the specified project. Urgent maintenance activities such as security patches can't wait for your chosen window. MongoDB Cloud starts those maintenance activities when needed. After you schedule maintenance for your cluster, you can't change your maintenance window until the current maintenance efforts complete. The maintenance procedure that MongoDB Cloud performs requires at least one replica set election during the maintenance window per replica set. Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or unexpected system issues could delay the start time. Updating the maintenance window will reset any maintenance deferrals for this project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + attributes: + - bool: + default: null + description: Flag that indicates whether MongoDB Cloud should defer all maintenance windows for one week after you enable them. + computedOptionalRequired: computed_optional + name: auto_defer_once_enabled + - int64: + default: null + description: |- + One-based integer that represents the day of the week that the maintenance window starts. + + - `1`: Sunday. + - `2`: Monday. + - `3`: Tuesday. + - `4`: Wednesday. + - `5`: Thursday. + - `6`: Friday. + - `7`: Saturday. + computedOptionalRequired: required + name: day_of_week + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - int64: + default: null + description: Zero-based integer that represents the hour of the of the day that the maintenance window starts according to a 24-hour clock. Use `0` for midnight and `12` for noon. + computedOptionalRequired: required + name: hour_of_day + - int64: + default: null + description: Number of times the current maintenance event for this project has been deferred. + computedOptionalRequired: computed + name: number_of_deferrals + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - int64: + default: null + description: Zero-based integer that represents the end hour of the of the day that the maintenance will not begin in. + computedOptionalRequired: optional + name: end_hour_of_day + - int64: + default: null + description: Zero-based integer that represents the beginning hour of the of the day that the maintenance will not begin in. + computedOptionalRequired: optional + name: start_hour_of_day + description: Defines the a window where maintenance will not begin within. + computedOptionalRequired: optional + name: protected_hours + - bool: + default: null + description: Flag that indicates whether MongoDB Cloud starts the maintenance window immediately upon receiving this request. To start the maintenance window immediately for your project, MongoDB Cloud must have maintenance scheduled and you must set a maintenance window. This flag resets to `false` after MongoDB Cloud completes maintenance. + computedOptionalRequired: optional + name: start_asap + - string: + default: null + description: Identifier for the current time zone of the maintenance window. This can only be updated via the Project Settings UI. + computedOptionalRequired: computed + name: time_zone_id + reqBodyUsage: 3 + openapi-schema: + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + - name: resource_policy_api + operations: + create: + httpMethod: POST + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies + read: + httpMethod: GET + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + update: + httpMethod: PATCH + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + delete: + httpMethod: DELETE + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + versionheader: application/vnd.atlas.2024-08-05+json + schema: + description: Create one Atlas Resource Policy for an org. + attributes: + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Unique 24-hexadecimal character string that identifies a user. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that describes a user. + computedOptionalRequired: computed + name: name + reqBodyUsage: 3 + description: The user that last updated the atlas resource policy. + computedOptionalRequired: computed + name: created_by_user + reqBodyUsage: 3 + - string: + default: null + description: Date and time in UTC when the atlas resource policy was created. + computedOptionalRequired: computed + name: created_date + reqBodyUsage: 3 + - string: + default: null + description: Description of the atlas resource policy. + computedOptionalRequired: optional + name: description + - string: + default: null + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Unique 24-hexadecimal character string that identifies a user. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that describes a user. + computedOptionalRequired: computed + name: name + reqBodyUsage: 3 + description: The user that last updated the atlas resource policy. + computedOptionalRequired: computed + name: last_updated_by_user + reqBodyUsage: 3 + - string: + default: null + description: Date and time in UTC when the atlas resource policy was last updated. + computedOptionalRequired: computed + name: last_updated_date + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that describes the atlas resource policy. + computedOptionalRequired: required + name: name + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + computedOptionalRequired: required + name: org_id + reqBodyUsage: 3 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. + computedOptionalRequired: required + name: body + - string: + default: null + description: Unique 24-hexadecimal character string that identifies the policy. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + description: List of policies that make up the atlas resource policy. + computedOptionalRequired: required + name: policies + - string: + default: null + description: A string that identifies the version of the atlas resource policy. + computedOptionalRequired: computed + name: version + reqBodyUsage: 3 + openapi-schema: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicy" + x-xgen-version: 2024-08-05 + description: Ok + - name: search_deployment_api + operations: + create: + wait: + stateProperty: stateName + pendingStates: + - UPDATING + - PAUSED + targetStates: + - IDLE + timeoutSeconds: 10800 + minTimeoutSeconds: 60 + delaySeconds: 60 + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + update: + wait: + stateProperty: stateName + pendingStates: + - UPDATING + - PAUSED + targetStates: + - IDLE + timeoutSeconds: 10800 + minTimeoutSeconds: 60 + delaySeconds: 60 + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + delete: + wait: + stateProperty: stateName + pendingStates: + - IDLE + - UPDATING + - PAUSED + targetStates: + - DELETED + timeoutSeconds: 10800 + minTimeoutSeconds: 30 + delaySeconds: 60 + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + versionheader: application/vnd.atlas.2025-03-12+json + schema: + description: Creates Search Nodes for the specified cluster. + attributes: + - string: + default: null + description: Label that identifies the cluster to create Search Nodes for. + computedOptionalRequired: required + name: cluster_name + reqBodyUsage: 3 + - string: + default: null + description: Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster. + computedOptionalRequired: computed + name: encryption_at_rest_provider + reqBodyUsage: 3 + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the search deployment. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Hardware specification for the Search Node instance sizes. + computedOptionalRequired: required + name: instance_size + - int64: + default: null + description: Number of Search Nodes in the cluster. + computedOptionalRequired: required + name: node_count + description: |- + List of settings that configure the Search Nodes for your cluster. + + **NOTE**: We accept a single configuration for all nodes currently. + computedOptionalRequired: required + name: specs + - string: + default: null + description: Human-readable label that indicates the current operating condition of this search deployment. + computedOptionalRequired: computed + name: state_name + reqBodyUsage: 3 + openapi-schema: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/ApiSearchDeploymentResponse" + x-xgen-version: 2024-05-30 + description: OK + - name: stream_instance_api + operations: + create: + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/streams + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/streams/{name} + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/streams/{name} + delete: + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/streams/{name} + versionheader: application/vnd.atlas.2023-02-01+json + schema: + description: Creates one stream instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role, Project Owner role or Project Stream Processing Owner role. + attributes: + - listNested: + default: null + nestedobject: + attributes: + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Style of authentication. Can be one of PLAIN, SCRAM-256, or SCRAM-512. + computedOptionalRequired: computed + name: mechanism + reqBodyUsage: 3 + - string: + default: null + description: Password of the account to connect to the Kafka cluster. + computedOptionalRequired: computed + name: password + reqBodyUsage: 3 + sensitive: true + - string: + default: null + description: SSL certificate for client authentication to Kafka. + computedOptionalRequired: computed + name: ssl_certificate + reqBodyUsage: 3 + - string: + default: null + description: SSL key for client authentication to Kafka. + computedOptionalRequired: computed + name: ssl_key + reqBodyUsage: 3 + - string: + default: null + description: Password for the SSL key, if it is password protected. + computedOptionalRequired: computed + name: ssl_key_password + reqBodyUsage: 3 + - string: + default: null + description: Username of the account to connect to the Kafka cluster. + computedOptionalRequired: computed + name: username + reqBodyUsage: 3 + description: User credentials required to connect to a Kafka Cluster. Includes the authentication type, as well as the parameters for that authentication mode. + computedOptionalRequired: computed + name: authentication + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account. + computedOptionalRequired: computed + name: role_arn + reqBodyUsage: 3 + - string: + default: null + description: The name of an S3 bucket used to check authorization of the passed-in IAM role ARN. + computedOptionalRequired: computed + name: test_bucket + reqBodyUsage: 3 + description: AWS configurations for AWS-based connection types. + computedOptionalRequired: computed + name: aws + reqBodyUsage: 3 + - string: + default: null + description: Comma separated list of server addresses. + computedOptionalRequired: computed + name: bootstrap_servers + reqBodyUsage: 3 + - string: + default: null + description: The id of the group that the cluster belongs to. + computedOptionalRequired: computed + name: cluster_group_id + reqBodyUsage: 3 + - string: + default: null + description: Name of the cluster configured for this connection. + computedOptionalRequired: computed + name: cluster_name + reqBodyUsage: 3 + - map: + default: null + elementtype: 4 + description: A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters. + computedOptionalRequired: computed + name: config + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: The name of the role to use. Can be a built in role or a custom role. + computedOptionalRequired: computed + name: role + reqBodyUsage: 3 + - string: + default: null + description: Type of the DB role. Can be either BuiltIn or Custom. + computedOptionalRequired: computed + name: type + reqBodyUsage: 3 + description: The name of a Built in or Custom DB Role to connect to an Atlas Cluster. + computedOptionalRequired: computed + name: db_role_to_execute + reqBodyUsage: 3 + - map: + default: null + elementtype: 4 + description: A map of key-value pairs that will be passed as headers for the request. + computedOptionalRequired: computed + name: headers + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source. + computedOptionalRequired: computed + name: name + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Reserved. Will be used by PRIVATE_LINK connection type. + computedOptionalRequired: computed + name: connection_id + reqBodyUsage: 3 + - string: + default: null + description: Reserved. Will be used by PRIVATE_LINK connection type. + computedOptionalRequired: computed + name: name + reqBodyUsage: 3 + - string: + default: null + description: Reserved. Will be used by TRANSIT_GATEWAY connection type. + computedOptionalRequired: computed + name: tgw_id + reqBodyUsage: 3 + - string: + default: null + description: Reserved. Will be used by TRANSIT_GATEWAY connection type. + computedOptionalRequired: computed + name: tgw_route_id + reqBodyUsage: 3 + - string: + default: null + description: Selected networking type. Either PUBLIC, VPC, PRIVATE_LINK, or TRANSIT_GATEWAY. Defaults to PUBLIC. For VPC, ensure that VPC peering exists and connectivity has been established between Atlas VPC and the VPC where Kafka cluster is hosted for the connection to function properly. TRANSIT_GATEWAY support is coming soon. + computedOptionalRequired: computed + name: type + reqBodyUsage: 3 + - string: + default: null + description: Reserved. Will be used by TRANSIT_GATEWAY connection type. + computedOptionalRequired: computed + name: vpc_cidr + reqBodyUsage: 3 + description: Information about networking access. + computedOptionalRequired: computed + name: access + reqBodyUsage: 3 + description: Networking configuration for Streams connections. + computedOptionalRequired: computed + name: networking + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: A trusted, public x509 certificate for connecting to Kafka over SSL. + computedOptionalRequired: computed + name: broker_public_certificate + reqBodyUsage: 3 + - string: + default: null + description: Describes the transport type. Can be either SASL_PLAINTEXT, SASL_SSL, or SSL. + computedOptionalRequired: computed + name: protocol + reqBodyUsage: 3 + description: Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. + computedOptionalRequired: computed + name: security + reqBodyUsage: 3 + - string: + default: null + description: Type of the connection. + computedOptionalRequired: computed + name: type + reqBodyUsage: 3 + - string: + default: null + description: The url to be used for the request. + computedOptionalRequired: computed + name: url + reqBodyUsage: 3 + description: List of connections configured in the stream instance. + computedOptionalRequired: computed + name: connections + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Label that identifies the cloud service provider where MongoDB Cloud performs stream processing. Currently, this parameter only supports AWS and AZURE. + computedOptionalRequired: required + name: cloud_provider + - string: + default: null + description: Name of the cloud provider region hosting Atlas Stream Processing. + computedOptionalRequired: required + name: region + description: Information about the cloud provider region in which MongoDB Cloud processes the stream. + computedOptionalRequired: optional + name: data_process_region + reqBodyUsage: 1 + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - list: + default: null + elementtype: 4 + description: List that contains the hostnames assigned to the stream instance. + computedOptionalRequired: computed + name: hostnames + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that identifies the stream instance. + computedOptionalRequired: optional + name: name + reqBodyUsage: 1 + - singleNested: + default: null + nestedobject: + attributes: + - bool: + default: false + description: Flag that indicates whether to add a 'sample_stream_solar' connection. + computedOptionalRequired: computed_optional + name: solar + description: Sample connections to add to SPI. + computedOptionalRequired: optional + name: sample_connections + reqBodyUsage: 1 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Selected tier for the Stream Instance. Configures Memory / VCPU allowances. + computedOptionalRequired: optional + name: tier + description: Configuration options for an Atlas Stream Processing Instance. + computedOptionalRequired: optional + name: stream_config + reqBodyUsage: 1 + openapi-schema: + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsTenant" + x-xgen-version: 2023-02-01 + description: OK + - name: auditing_api + operations: + create: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/auditLog + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/auditLog + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/auditLog + delete: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/auditLog + staticRequestBody: '{"enabled": "false"}' + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Updates the auditing configuration for the specified project. The auditing configuration defines the events that MongoDB Cloud records in the audit log. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature isn't available for `M0`, `M2`, `M5`, or serverless clusters. + attributes: + - bool: + default: false + description: 'Flag that indicates whether someone set auditing to track successful authentications. This only applies to the `"atype" : "authCheck"` audit filter. Setting this parameter to `true` degrades cluster performance.' + computedOptionalRequired: computed_optional + name: audit_authorization_success + - string: + default: null + description: JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (`\`). + computedOptionalRequired: optional + name: audit_filter + - string: + default: null + description: Human-readable label that displays how to configure the audit filter. + computedOptionalRequired: computed + name: configuration_type + reqBodyUsage: 3 + - bool: + default: false + description: Flag that indicates whether someone enabled database auditing for the specified project. + computedOptionalRequired: computed_optional + name: enabled + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + openapi-schema: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AuditLog" + x-xgen-version: 2023-01-01 + description: OK + - name: cluster_api + operations: + create: + wait: + stateProperty: stateName + pendingStates: + - CREATING + - UPDATING + - REPAIRING + - REPEATING + - PENDING + - DELETING + targetStates: + - IDLE + timeoutSeconds: 10800 + minTimeoutSeconds: 60 + delaySeconds: 30 + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/clusters + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/clusters/{name} + update: + wait: + stateProperty: stateName + pendingStates: + - CREATING + - UPDATING + - REPAIRING + - REPEATING + - PENDING + - DELETING + targetStates: + - IDLE + timeoutSeconds: 10800 + minTimeoutSeconds: 60 + delaySeconds: 30 + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/clusters/{name} + delete: + wait: + stateProperty: stateName + pendingStates: + - IDLE + - CREATING + - UPDATING + - REPAIRING + - REPEATING + - PENDING + - DELETING + targetStates: + - DELETED + timeoutSeconds: 10800 + minTimeoutSeconds: 60 + delaySeconds: 30 + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/clusters/{name} + versionheader: application/vnd.atlas.2024-08-05+json + schema: + description: |- + Creates one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. This resource can create clusters with asymmetrically-sized shards. Each project supports up to 25 database deployments. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature is not available for serverless clusters. + + Please note that using an instanceSize of M2 or M5 will create a Flex cluster instead. Support for the instanceSize of M2 or M5 will be discontinued in January 2026. We recommend using the createFlexCluster API for such configurations moving forward. Deprecated versions: v2-{2024-08-05}, v2-{2023-02-01}, v2-{2023-01-01} + attributes: + - string: + default: null + description: If reconfiguration is necessary to regain a primary due to a regional outage, submit this field alongside your topology reconfiguration to request a new regional outage resistant topology. Forced reconfigurations during an outage of the majority of electable nodes carry a risk of data loss if replicated writes (even majority committed writes) have not been replicated to the new primary node. MongoDB Atlas docs contain more information. To proceed with an operation which carries that risk, set **acceptDataRisksAndForceReplicaSetReconfig** to the current date. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + computedOptionalRequired: optional + name: accept_data_risks_and_force_replica_set_reconfig + - singleNested: + default: null + nestedobject: + attributes: + - list: + default: null + elementtype: 4 + description: The custom OpenSSL cipher suite list for TLS 1.2. This field is only valid when `tlsCipherConfigMode` is set to `CUSTOM`. + computedOptionalRequired: computed_optional + name: custom_openssl_cipher_config_tls12 + - string: + default: null + description: Minimum Transport Layer Security (TLS) version that the cluster accepts for incoming connections. Clusters using TLS 1.0 or 1.1 should consider setting TLS 1.2 as the minimum TLS protocol version. + computedOptionalRequired: computed_optional + name: minimum_enabled_tls_protocol + - string: + default: null + description: The TLS cipher suite configuration mode. The default mode uses the default cipher suites. The custom mode allows you to specify custom cipher suites for both TLS 1.2 and TLS 1.3. + computedOptionalRequired: computed_optional + name: tls_cipher_config_mode + description: Group of settings that configures a subset of the advanced configuration details. + computedOptionalRequired: computed_optional + name: advanced_configuration + - bool: + default: false + description: Flag that indicates whether the cluster can perform backups. If set to `true`, the cluster can perform backups. You must set this value to `true` for NVMe clusters. Backup uses Cloud Backups for dedicated clusters and [Shared Cluster Backups](https://docs.atlas.mongodb.com/backup/shared-tier/overview/) for tenant clusters. If set to `false`, the cluster doesn't use backups. + computedOptionalRequired: computed_optional + name: backup_enabled + - singleNested: + default: null + nestedobject: + attributes: + - bool: + default: null + description: Flag that indicates whether MongoDB Connector for Business Intelligence is enabled on the specified cluster. + computedOptionalRequired: computed_optional + name: enabled + - string: + default: null + description: Data source node designated for the MongoDB Connector for Business Intelligence on MongoDB Cloud. The MongoDB Connector for Business Intelligence on MongoDB Cloud reads data from the primary, secondary, or analytics node based on your read preferences. Defaults to `ANALYTICS` node, or `SECONDARY` if there are no `ANALYTICS` nodes. + computedOptionalRequired: computed_optional + name: read_preference + description: Settings needed to configure the MongoDB Connector for Business Intelligence for this cluster. + computedOptionalRequired: computed_optional + name: bi_connector + - string: + default: null + description: Configuration of nodes that comprise the cluster. + computedOptionalRequired: optional + name: cluster_type + - string: + default: ATLAS_MANAGED + description: |- + Config Server Management Mode for creating or updating a sharded cluster. + + When configured as ATLAS_MANAGED, atlas may automatically switch the cluster's config server type for optimal performance and savings. + + When configured as FIXED_TO_DEDICATED, the cluster will always use a dedicated config server. + computedOptionalRequired: computed_optional + name: config_server_management_mode + - string: + default: null + description: Describes a sharded cluster's config server type. + computedOptionalRequired: computed + name: config_server_type + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - map: + default: null + elementtype: 4 + description: Private endpoint-aware connection strings that use AWS-hosted clusters with Amazon Web Services (AWS) PrivateLink. Each key identifies an Amazon Web Services (AWS) interface endpoint. Each value identifies the related `mongodb://` connection string that you use to connect to MongoDB Cloud through the interface endpoint that the key names. + computedOptionalRequired: computed + name: aws_private_link + reqBodyUsage: 3 + - map: + default: null + elementtype: 4 + description: Private endpoint-aware connection strings that use AWS-hosted clusters with Amazon Web Services (AWS) PrivateLink. Each key identifies an Amazon Web Services (AWS) interface endpoint. Each value identifies the related `mongodb://` connection string that you use to connect to Atlas through the interface endpoint that the key names. If the cluster uses an optimized connection string, `awsPrivateLinkSrv` contains the optimized connection string. If the cluster has the non-optimized (legacy) connection string, `awsPrivateLinkSrv` contains the non-optimized connection string even if an optimized connection string is also present. + computedOptionalRequired: computed + name: aws_private_link_srv + reqBodyUsage: 3 + - string: + default: null + description: Network peering connection strings for each interface Virtual Private Cloud (VPC) endpoint that you configured to connect to this cluster. This connection string uses the `mongodb+srv://` protocol. The resource returns this parameter once someone creates a network peering connection to this cluster. This protocol tells the application to look up the host seed list in the Domain Name System (DNS). This list synchronizes with the nodes in a cluster. If the connection string uses this Uniform Resource Identifier (URI) format, you don't need to append the seed list or change the URI if the nodes change. Use this URI format if your driver supports it. If it doesn't, use connectionStrings.private. For Amazon Web Services (AWS) clusters, this resource returns this parameter only if you enable custom DNS. + computedOptionalRequired: computed + name: private + reqBodyUsage: 3 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Private endpoint-aware connection string that uses the `mongodb://` protocol to connect to MongoDB Cloud through a private endpoint. + computedOptionalRequired: computed + name: connection_string + reqBodyUsage: 3 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Unique string that the cloud provider uses to identify the private endpoint. + computedOptionalRequired: computed + name: endpoint_id + reqBodyUsage: 3 + - string: + default: null + description: Cloud provider in which MongoDB Cloud deploys the private endpoint. + computedOptionalRequired: computed + name: provider_name + reqBodyUsage: 3 + - string: + default: null + description: Region where the private endpoint is deployed. + computedOptionalRequired: computed + name: region + reqBodyUsage: 3 + description: List that contains the private endpoints through which you connect to MongoDB Cloud when you use **connectionStrings.privateEndpoint[n].connectionString** or **connectionStrings.privateEndpoint[n].srvConnectionString**. + computedOptionalRequired: computed + name: endpoints + reqBodyUsage: 3 + - string: + default: null + description: Private endpoint-aware connection string that uses the `mongodb+srv://` protocol to connect to MongoDB Cloud through a private endpoint. The `mongodb+srv` protocol tells the driver to look up the seed list of hosts in the Domain Name System (DNS). This list synchronizes with the nodes in a cluster. If the connection string uses this Uniform Resource Identifier (URI) format, you don't need to append the seed list or change the Uniform Resource Identifier (URI) if the nodes change. Use this Uniform Resource Identifier (URI) format if your application supports it. If it doesn't, use connectionStrings.privateEndpoint[n].connectionString. + computedOptionalRequired: computed + name: srv_connection_string + reqBodyUsage: 3 + - string: + default: null + description: Private endpoint-aware connection string optimized for sharded clusters that uses the `mongodb+srv://` protocol to connect to MongoDB Cloud through a private endpoint. If the connection string uses this Uniform Resource Identifier (URI) format, you don't need to change the Uniform Resource Identifier (URI) if the nodes change. Use this Uniform Resource Identifier (URI) format if your application and Atlas cluster supports it. If it doesn't, use and consult the documentation for connectionStrings.privateEndpoint[n].srvConnectionString. + computedOptionalRequired: computed + name: srv_shard_optimized_connection_string + reqBodyUsage: 3 + - string: + default: null + description: MongoDB process type to which your application connects. Use `MONGOD` for replica sets and `MONGOS` for sharded clusters. + computedOptionalRequired: computed + name: type + reqBodyUsage: 3 + description: List of private endpoint-aware connection strings that you can use to connect to this cluster through a private endpoint. This parameter returns only if you deployed a private endpoint to all regions to which you deployed this clusters' nodes. + computedOptionalRequired: computed + name: private_endpoint + reqBodyUsage: 3 + - string: + default: null + description: Network peering connection strings for each interface Virtual Private Cloud (VPC) endpoint that you configured to connect to this cluster. This connection string uses the `mongodb+srv://` protocol. The resource returns this parameter when someone creates a network peering connection to this cluster. This protocol tells the application to look up the host seed list in the Domain Name System (DNS). This list synchronizes with the nodes in a cluster. If the connection string uses this Uniform Resource Identifier (URI) format, you don't need to append the seed list or change the Uniform Resource Identifier (URI) if the nodes change. Use this Uniform Resource Identifier (URI) format if your driver supports it. If it doesn't, use `connectionStrings.private`. For Amazon Web Services (AWS) clusters, this parameter returns only if you [enable custom DNS](https://docs.atlas.mongodb.com/reference/api/aws-custom-dns-update/). + computedOptionalRequired: computed + name: private_srv + reqBodyUsage: 3 + - string: + default: null + description: Public connection string that you can use to connect to this cluster. This connection string uses the `mongodb://` protocol. + computedOptionalRequired: computed + name: standard + reqBodyUsage: 3 + - string: + default: null + description: Public connection string that you can use to connect to this cluster. This connection string uses the `mongodb+srv://` protocol. + computedOptionalRequired: computed + name: standard_srv + reqBodyUsage: 3 + description: Collection of Uniform Resource Locators that point to the MongoDB database. + computedOptionalRequired: computed + name: connection_strings + reqBodyUsage: 3 + - string: + default: null + description: Date and time when MongoDB Cloud created this cluster. This parameter expresses its value in ISO 8601 format in UTC. + computedOptionalRequired: computed + name: create_date + reqBodyUsage: 3 + - string: + default: FULLY_WARMED + description: Disk warming mode selection. + computedOptionalRequired: computed_optional + name: disk_warming_mode + - string: + default: null + description: 'Cloud service provider that manages your customer keys to provide an additional layer of encryption at rest for the cluster. To enable customer key management for encryption at rest, the cluster **replicationSpecs[n].regionConfigs[m].{type}Specs.instanceSize** setting must be `M10` or higher and `"backupEnabled" : false` or omitted entirely.' + computedOptionalRequired: computed_optional + name: encryption_at_rest_provider + - string: + default: null + description: Feature compatibility version of the cluster. This will always appear regardless of whether FCV is pinned. + computedOptionalRequired: computed + name: feature_compatibility_version + reqBodyUsage: 3 + - string: + default: null + description: Feature compatibility version expiration date. Will only appear if FCV is pinned. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + computedOptionalRequired: computed + name: feature_compatibility_version_expiration_date + reqBodyUsage: 3 + - bool: + default: null + description: |- + Set this field to configure the Sharding Management Mode when creating a new Global Cluster. + + When set to false, the management mode is set to Atlas-Managed Sharding. This mode fully manages the sharding of your Global Cluster and is built to provide a seamless deployment experience. + + When set to true, the management mode is set to Self-Managed Sharding. This mode leaves the management of shards in your hands and is built to provide an advanced and flexible deployment experience. + + This setting cannot be changed once the cluster is deployed. + computedOptionalRequired: computed_optional + name: global_cluster_self_managed_sharding + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the cluster. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Key applied to tag and categorize this component. + computedOptionalRequired: optional + name: key + - string: + default: null + description: Value set to the Key applied to tag and categorize this component. + computedOptionalRequired: optional + name: value + description: |- + Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels. + + Cluster labels are deprecated and will be removed in a future release. We strongly recommend that you use Resource Tags instead. + deprecationMessage: This attribute has been deprecated + computedOptionalRequired: optional + name: labels + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Expiration date for the employee access grant. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + computedOptionalRequired: required + name: expiration_time + - string: + default: null + description: Level of access to grant to MongoDB Employees. + computedOptionalRequired: required + name: grant_type + description: MongoDB employee granted access level and expiration for a cluster. + computedOptionalRequired: optional + name: mongo_dbemployee_access_grant + - string: + default: null + description: "MongoDB major version of the cluster. Set to the binary major version. \n\nOn creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLtsVersions).\n\n On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version." + computedOptionalRequired: optional + name: mongo_dbmajor_version + - string: + default: null + description: Version of MongoDB that the cluster runs. + computedOptionalRequired: computed + name: mongo_dbversion + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that identifies the cluster. + computedOptionalRequired: optional + name: name + - bool: + default: null + description: Flag that indicates whether the cluster is paused. + computedOptionalRequired: computed_optional + name: paused + - bool: + default: null + description: Flag that indicates whether the cluster uses continuous cloud backups. + computedOptionalRequired: computed_optional + name: pit_enabled + - bool: + default: null + description: |- + Enable or disable log redaction. + + This setting configures the ``mongod`` or ``mongos`` to redact any document field contents from a message accompanying a given log event before logging. This prevents the program from writing potentially sensitive data stored on the database to the diagnostic log. Metadata such as error or operation codes, line numbers, and source file names are still visible in the logs. + + Use ``redactClientLogData`` in conjunction with Encryption at Rest and TLS/SSL (Transport Encryption) to assist compliance with regulatory requirements. + + *Note*: changing this setting on a cluster will trigger a rolling restart as soon as the cluster is updated. + computedOptionalRequired: computed_optional + name: redact_client_log_data + - string: + default: WORKLOAD_TYPE + description: |- + Set this field to configure the replica set scaling mode for your cluster. + + By default, Atlas scales under WORKLOAD_TYPE. This mode allows Atlas to scale your analytics nodes in parallel to your operational nodes. + + When configured as SEQUENTIAL, Atlas scales all nodes sequentially. This mode is intended for steady-state workloads and applications performing latency-sensitive secondary reads. + + When configured as NODE_TYPE, Atlas scales your electable nodes in parallel with your read-only and analytics nodes. This mode is intended for large, dynamic workloads requiring frequent and timely cluster tier scaling. This is the fastest scaling strategy, but it might impact latency of workloads when performing extensive secondary reads. + computedOptionalRequired: computed_optional + name: replica_set_scaling_strategy + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. If you include existing shard replication configurations in the request, you must specify this parameter. If you add a new shard to an existing Cluster, you may specify this parameter. The request deletes any existing shards in the Cluster that you exclude from the request. This corresponds to Shard ID displayed in the UI. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - listNested: + default: null + nestedobject: + attributes: + - singleNested: + default: null + nestedobject: + attributes: + - singleNested: + default: null + nestedobject: + attributes: + - bool: + default: null + description: |- + Flag that indicates whether instance size reactive auto-scaling is enabled. + + - Set to `true` to enable instance size reactive auto-scaling. If enabled, you must specify a value for **replicationSpecs[n].regionConfigs[m].autoScaling.compute.maxInstanceSize**. + - Set to `false` to disable instance size reactive auto-scaling. + computedOptionalRequired: optional + name: enabled + - string: + default: null + description: Instance size boundary to which your cluster can automatically scale. + computedOptionalRequired: computed + name: max_instance_size + reqBodyUsage: 3 + - string: + default: null + description: Instance size boundary to which your cluster can automatically scale. + computedOptionalRequired: computed + name: min_instance_size + reqBodyUsage: 3 + - bool: + default: null + description: |- + Flag that indicates whether predictive instance size auto-scaling is enabled. + + - Set to `true` to enable predictive instance size auto-scaling. MongoDB Cloud requires **replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled** to be `true` in order to enable this feature. + - Set to `false` to disable predictive instance size auto-scaling. + computedOptionalRequired: optional + name: predictive_enabled + - bool: + default: null + description: Flag that indicates whether the instance size may scale down via reactive auto-scaling. MongoDB Cloud requires this parameter if **replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled** is `true`. If you enable this option, specify a value for **replicationSpecs[n].regionConfigs[m].autoScaling.compute.minInstanceSize**. + computedOptionalRequired: optional + name: scale_down_enabled + description: Options that determine how this cluster handles CPU scaling. + computedOptionalRequired: optional + name: compute + - singleNested: + default: null + nestedobject: + attributes: + - bool: + default: null + description: Flag that indicates whether this cluster enables disk auto-scaling. The maximum memory allowed for the selected cluster tier and the oplog size can limit storage auto-scaling. + computedOptionalRequired: optional + name: enabled + description: Setting that enables disk auto-scaling. + computedOptionalRequired: optional + name: disk_gb + description: Options that determine how this cluster handles resource scaling. + computedOptionalRequired: optional + name: analytics_auto_scaling + - singleNested: + default: null + nestedobject: + attributes: + - int64: + default: null + description: |- + Target throughput desired for storage attached to your Azure-provisioned cluster. Change this parameter if you: + + - set `"replicationSpecs[n].regionConfigs[m].providerName" : "Azure"`. + - set `"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize" : "M40"` or greater not including `Mxx_NVME` tiers. + + The maximum input/output operations per second (IOPS) depend on the selected **.instanceSize** and **.diskSizeGB**. + This parameter defaults to the cluster tier's standard IOPS value. + Changing this value impacts cluster cost. + computedOptionalRequired: computed_optional + name: disk_iops + - float64: + default: null + description: "Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity.\n\n This value must be equal for all shards and node types.\n\n This value is not configurable on M0/M2/M5 clusters.\n\n MongoDB Cloud requires this parameter if you set **replicationSpecs**.\n\n If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. \n\n Storage charge calculations depend on whether you choose the default value or a custom value.\n\n The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier." + computedOptionalRequired: computed_optional + name: disk_size_gb + - string: + default: STANDARD + description: "Type of storage you want to attach to your AWS-provisioned cluster.\n\n- `STANDARD` volume types can't exceed the default input/output operations per second (IOPS) rate for the selected volume size. \n\n- `PROVISIONED` volume types must fall within the allowable IOPS range for the selected volume size. You must set this value to (`PROVISIONED`) for NVMe clusters." + computedOptionalRequired: computed_optional + name: ebs_volume_type + - string: + default: null + description: Hardware specification for the instance sizes in this region in this shard. Each instance size has a default storage and memory capacity. Electable nodes and read-only nodes (known as "base nodes") within a single shard must use the same instance size. Analytics nodes can scale independently from base nodes within a shard. Both base nodes and analytics nodes can scale independently from their equivalents in other shards. + computedOptionalRequired: computed_optional + name: instance_size + - int64: + default: null + description: Number of nodes of the given type for MongoDB Cloud to deploy to the region. + computedOptionalRequired: computed_optional + name: node_count + description: Hardware specifications for read-only nodes in the region. Read-only nodes can never become the primary member, but can enable local reads. If you don't specify this parameter, no read-only nodes are deployed to the region. + computedOptionalRequired: computed_optional + name: analytics_specs + - singleNested: + default: null + nestedobject: + attributes: + - singleNested: + default: null + nestedobject: + attributes: + - bool: + default: null + description: |- + Flag that indicates whether instance size reactive auto-scaling is enabled. + + - Set to `true` to enable instance size reactive auto-scaling. If enabled, you must specify a value for **replicationSpecs[n].regionConfigs[m].autoScaling.compute.maxInstanceSize**. + - Set to `false` to disable instance size reactive auto-scaling. + computedOptionalRequired: computed_optional + name: enabled + - string: + default: null + description: Instance size boundary to which your cluster can automatically scale. + computedOptionalRequired: computed_optional + name: max_instance_size + reqBodyUsage: 3 + - string: + default: null + description: Instance size boundary to which your cluster can automatically scale. + computedOptionalRequired: computed_optional + name: min_instance_size + reqBodyUsage: 3 + - bool: + default: null + description: |- + Flag that indicates whether predictive instance size auto-scaling is enabled. + + - Set to `true` to enable predictive instance size auto-scaling. MongoDB Cloud requires **replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled** to be `true` in order to enable this feature. + - Set to `false` to disable predictive instance size auto-scaling. + computedOptionalRequired: computed_optional + name: predictive_enabled + - bool: + default: null + description: Flag that indicates whether the instance size may scale down via reactive auto-scaling. MongoDB Cloud requires this parameter if **replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled** is `true`. If you enable this option, specify a value for **replicationSpecs[n].regionConfigs[m].autoScaling.compute.minInstanceSize**. + computedOptionalRequired: computed_optional + name: scale_down_enabled + description: Options that determine how this cluster handles CPU scaling. + computedOptionalRequired: computed_optional + name: compute + - singleNested: + default: null + nestedobject: + attributes: + - bool: + default: null + description: Flag that indicates whether this cluster enables disk auto-scaling. The maximum memory allowed for the selected cluster tier and the oplog size can limit storage auto-scaling. + computedOptionalRequired: computed_optional + name: enabled + description: Setting that enables disk auto-scaling. + computedOptionalRequired: computed_optional + name: disk_gb + description: Options that determine how this cluster handles resource scaling. + computedOptionalRequired: computed_optional + name: auto_scaling + - string: + default: null + description: "Cloud service provider on which MongoDB Cloud provisioned the multi-tenant cluster. The resource returns this parameter when **providerName** is `TENANT` and **electableSpecs.instanceSize** is `M0`, `M2` or `M5`. \n\nPlease note that using an instanceSize of M2 or M5 will create a Flex cluster instead. Support for the instanceSize of M2 or M5 will be discontinued in January 2026. We recommend using the createFlexCluster API for such configurations moving forward." + computedOptionalRequired: optional + name: backing_provider_name + - singleNested: + default: null + nestedobject: + attributes: + - int64: + default: null + description: |- + Target throughput desired for storage attached to your Azure-provisioned cluster. Change this parameter if you: + + - set `"replicationSpecs[n].regionConfigs[m].providerName" : "Azure"`. + - set `"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize" : "M40"` or greater not including `Mxx_NVME` tiers. + + The maximum input/output operations per second (IOPS) depend on the selected **.instanceSize** and **.diskSizeGB**. + This parameter defaults to the cluster tier's standard IOPS value. + Changing this value impacts cluster cost. + computedOptionalRequired: computed_optional + name: disk_iops + - float64: + default: null + description: "Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity.\n\n This value must be equal for all shards and node types.\n\n This value is not configurable on M0/M2/M5 clusters.\n\n MongoDB Cloud requires this parameter if you set **replicationSpecs**.\n\n If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. \n\n Storage charge calculations depend on whether you choose the default value or a custom value.\n\n The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier." + computedOptionalRequired: computed_optional + name: disk_size_gb + - string: + default: STANDARD + description: "Type of storage you want to attach to your AWS-provisioned cluster.\n\n- `STANDARD` volume types can't exceed the default input/output operations per second (IOPS) rate for the selected volume size. \n\n- `PROVISIONED` volume types must fall within the allowable IOPS range for the selected volume size. You must set this value to (`PROVISIONED`) for NVMe clusters." + computedOptionalRequired: computed_optional + name: ebs_volume_type + - string: + default: null + description: The true tenant instance size. This is present to support backwards compatibility for deprecated provider types and/or instance sizes. + computedOptionalRequired: computed + name: effective_instance_size + reqBodyUsage: 3 + - string: + default: null + description: Hardware specification for the instances in this M0/M2/M5 tier cluster. + computedOptionalRequired: optional + name: instance_size + - int64: + default: null + description: Number of nodes of the given type for MongoDB Cloud to deploy to the region. + computedOptionalRequired: optional + name: node_count + description: Hardware specifications for all electable nodes deployed in the region. Electable nodes can become the primary and can enable local reads. If you don't specify this option, MongoDB Cloud deploys no electable nodes to the region. + computedOptionalRequired: optional + name: electable_specs + - int64: + default: null + description: |- + Precedence is given to this region when a primary election occurs. If your **regionConfigs** has only **readOnlySpecs**, **analyticsSpecs**, or both, set this value to `0`. If you have multiple **regionConfigs** objects (your cluster is multi-region or multi-cloud), they must have priorities in descending order. The highest priority is `7`. + + **Example:** If you have three regions, their priorities would be `7`, `6`, and `5` respectively. If you added two more regions for supporting electable nodes, the priorities of those regions would be `4` and `3` respectively. + computedOptionalRequired: optional + name: priority + - string: + default: null + description: Cloud service provider on which MongoDB Cloud provisions the hosts. Set dedicated clusters to `AWS`, `GCP`, `AZURE` or `TENANT`. + computedOptionalRequired: optional + name: provider_name + - singleNested: + default: null + nestedobject: + attributes: + - int64: + default: null + description: |- + Target throughput desired for storage attached to your Azure-provisioned cluster. Change this parameter if you: + + - set `"replicationSpecs[n].regionConfigs[m].providerName" : "Azure"`. + - set `"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize" : "M40"` or greater not including `Mxx_NVME` tiers. + + The maximum input/output operations per second (IOPS) depend on the selected **.instanceSize** and **.diskSizeGB**. + This parameter defaults to the cluster tier's standard IOPS value. + Changing this value impacts cluster cost. + computedOptionalRequired: computed_optional + name: disk_iops + - float64: + default: null + description: "Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity.\n\n This value must be equal for all shards and node types.\n\n This value is not configurable on M0/M2/M5 clusters.\n\n MongoDB Cloud requires this parameter if you set **replicationSpecs**.\n\n If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. \n\n Storage charge calculations depend on whether you choose the default value or a custom value.\n\n The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier." + computedOptionalRequired: computed_optional + name: disk_size_gb + - string: + default: STANDARD + description: "Type of storage you want to attach to your AWS-provisioned cluster.\n\n- `STANDARD` volume types can't exceed the default input/output operations per second (IOPS) rate for the selected volume size. \n\n- `PROVISIONED` volume types must fall within the allowable IOPS range for the selected volume size. You must set this value to (`PROVISIONED`) for NVMe clusters." + computedOptionalRequired: computed_optional + name: ebs_volume_type + - string: + default: null + description: Hardware specification for the instance sizes in this region in this shard. Each instance size has a default storage and memory capacity. Electable nodes and read-only nodes (known as "base nodes") within a single shard must use the same instance size. Analytics nodes can scale independently from base nodes within a shard. Both base nodes and analytics nodes can scale independently from their equivalents in other shards. + computedOptionalRequired: computed_optional + name: instance_size + - int64: + default: null + description: Number of nodes of the given type for MongoDB Cloud to deploy to the region. + computedOptionalRequired: computed_optional + name: node_count + description: Hardware specifications for read-only nodes in the region. Read-only nodes can never become the primary member, but can enable local reads. If you don't specify this parameter, no read-only nodes are deployed to the region. + computedOptionalRequired: computed_optional + name: read_only_specs + - string: + default: null + description: Physical location of your MongoDB cluster nodes. The region you choose can affect network latency for clients accessing your databases. The region name is only returned in the response for single-region clusters. When MongoDB Cloud deploys a dedicated cluster, it checks if a VPC or VPC connection exists for that provider and region. If not, MongoDB Cloud creates them as part of the deployment. It assigns the VPC a Classless Inter-Domain Routing (CIDR) block. To limit a new VPC peering connection to one Classless Inter-Domain Routing (CIDR) block and region, create the connection first. Deploy the cluster after the connection starts. GCP Clusters and Multi-region clusters require one VPC peering connection for each region. MongoDB nodes can use only the peering connection that resides in the same region as the nodes to communicate with the peered VPC. + computedOptionalRequired: optional + name: region_name + description: |- + Hardware specifications for nodes set for a given region. Each **regionConfigs** object describes the region's priority in elections and the number and type of MongoDB nodes that MongoDB Cloud deploys to the region. Each **regionConfigs** object must have either an **analyticsSpecs** object, **electableSpecs** object, or **readOnlySpecs** object. Tenant clusters only require **electableSpecs. Dedicated** clusters can specify any of these specifications, but must have at least one **electableSpecs** object within a **replicationSpec**. + + **Example:** + + If you set `"replicationSpecs[n].regionConfigs[m].analyticsSpecs.instanceSize" : "M30"`, set `"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize" : `"M30"` if you have electable nodes and `"replicationSpecs[n].regionConfigs[m].readOnlySpecs.instanceSize" : `"M30"` if you have read-only nodes. + computedOptionalRequired: optional + name: region_configs + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the zone in a Global Cluster. This value can be used to configure Global Cluster backup policies. + computedOptionalRequired: computed + name: zone_id + reqBodyUsage: 3 + - string: + default: null + description: 'Human-readable label that describes the zone this shard belongs to in a Global Cluster. Provide this value only if "clusterType" : "GEOSHARDED" but not "selfManagedSharding" : true.' + computedOptionalRequired: computed_optional + name: zone_name + description: List of settings that configure your cluster regions. This array has one object per shard representing node configurations in each shard. For replica sets there is only one object representing node configurations. + computedOptionalRequired: optional + name: replication_specs + - string: + default: ISRGROOTX1 + description: Root Certificate Authority that MongoDB Atlas cluster uses. MongoDB Cloud supports Internet Security Research Group. + computedOptionalRequired: computed_optional + name: root_cert_type + - string: + default: null + description: Human-readable label that indicates the current operating condition of this cluster. + computedOptionalRequired: computed + name: state_name + reqBodyUsage: 3 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: 'Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag.' + computedOptionalRequired: required + name: key + - string: + default: null + description: 'Variable that belongs to the set of the tag. For example, `production` in the `environment : production` tag.' + computedOptionalRequired: required + name: value + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. + computedOptionalRequired: optional + name: tags + - bool: + default: false + description: Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. + computedOptionalRequired: computed_optional + name: termination_protection_enabled + - string: + default: LTS + description: Method by which the cluster maintains the MongoDB versions. If value is `CONTINUOUS`, you must not specify **mongoDBMajorVersion**. + computedOptionalRequired: computed_optional + name: version_release_system + openapi-schema: + content: + application/vnd.atlas.2024-10-23+json: + schema: + $ref: "#/components/schemas/ClusterDescription20240805" + x-xgen-version: 2024-10-23 + description: OK + - name: project_api + operations: + create: + httpMethod: POST + path: /api/atlas/v2/groups + read: + httpMethod: GET + path: /api/atlas/v2/groups/{id} + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{id} + delete: + httpMethod: DELETE + path: /api/atlas/v2/groups/{id} + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Creates one project. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. To use this resource, the requesting Service Account or API Key must have the Read Write role. + attributes: + - int64: + default: null + description: Quantity of MongoDB Cloud clusters deployed in this project. + computedOptionalRequired: computed + name: cluster_count + reqBodyUsage: 3 + - string: + default: null + description: Date and time when MongoDB Cloud created this project. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + computedOptionalRequired: computed + name: created + reqBodyUsage: 3 + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud project. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that identifies the project included in the MongoDB Cloud organization. + computedOptionalRequired: required + name: name + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud organization to which the project belongs. + computedOptionalRequired: required + name: org_id + reqBodyUsage: 1 + - string: + default: COMMERCIAL_FEDRAMP_REGIONS_ONLY + description: |- + Applies to Atlas for Government only. + + In Commercial Atlas, this field will be rejected in requests and missing in responses. + + This field sets restrictions on available regions in the project. + + `COMMERCIAL_FEDRAMP_REGIONS_ONLY`: Only allows deployments in FedRAMP Moderate regions. + + `GOV_REGIONS_ONLY`: Only allows deployments in GovCloud regions. + computedOptionalRequired: computed_optional + name: region_usage_restrictions + reqBodyUsage: 1 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: 'Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag.' + computedOptionalRequired: required + name: key + - string: + default: null + description: 'Variable that belongs to the set of the tag. For example, `production` in the `environment : production` tag.' + computedOptionalRequired: required + name: value + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the project. + computedOptionalRequired: optional + name: tags + - bool: + default: true + description: Flag that indicates whether to create the project with default alert settings. + computedOptionalRequired: computed_optional + name: with_default_alerts_settings + reqBodyUsage: 1 + openapi-schema: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/Group" + x-xgen-version: 2023-01-01 + description: OK + - name: push_based_log_export_api + operations: + create: + wait: + stateProperty: state + pendingStates: + - INITIATING + - BUCKET_VERIFIED + targetStates: + - ACTIVE + timeoutSeconds: 900 + minTimeoutSeconds: 60 + delaySeconds: 10 + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + update: + wait: + stateProperty: state + pendingStates: + - INITIATING + - BUCKET_VERIFIED + targetStates: + - ACTIVE + timeoutSeconds: 900 + minTimeoutSeconds: 60 + delaySeconds: 10 + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + delete: + wait: + stateProperty: state + pendingStates: + - ACTIVE + - INITIATING + - BUCKET_VERIFIED + targetStates: + - UNCONFIGURED + - DELETED + timeoutSeconds: 900 + minTimeoutSeconds: 60 + delaySeconds: 10 + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Configures the project level settings for the push-based log export feature. + attributes: + - string: + default: null + description: The name of the bucket to which the agent will send the logs to. + computedOptionalRequired: required + name: bucket_name + - string: + default: null + description: Date and time that this feature was enabled on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + computedOptionalRequired: computed + name: create_date + reqBodyUsage: 3 + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - string: + default: null + description: ID of the AWS IAM role that will be used to write to the S3 bucket. + computedOptionalRequired: required + name: iam_role_id + - string: + default: null + description: S3 directory in which vector will write to in order to store the logs. An empty string denotes the root directory. + computedOptionalRequired: required + name: prefix_path + - string: + default: null + description: Describes whether or not the feature is enabled and what status it is in. + computedOptionalRequired: computed + name: state + reqBodyUsage: 3 + openapi-schema: + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + - name: stream_processor_api + operations: + create: + wait: + stateProperty: state + pendingStates: + - INIT + - CREATING + targetStates: + - CREATED + timeoutSeconds: 300 + minTimeoutSeconds: 10 + delaySeconds: 10 + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} + update: + wait: + stateProperty: state + pendingStates: + - INIT + - CREATING + targetStates: + - CREATED + timeoutSeconds: 300 + minTimeoutSeconds: 10 + delaySeconds: 10 + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} + delete: + wait: + stateProperty: state + pendingStates: + - INIT + - CREATING + - CREATED + - STARTED + - STOPPED + targetStates: + - DELETED + timeoutSeconds: 300 + minTimeoutSeconds: 10 + delaySeconds: 10 + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} + versionheader: application/vnd.atlas.2024-05-30+json + schema: + description: Create one Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + attributes: + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - string: + default: null + description: Human-readable name of the stream processor. + computedOptionalRequired: optional + name: name + - singleNested: + default: null + nestedobject: + attributes: + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Name of the collection to use for the DLQ. + computedOptionalRequired: optional + name: coll + - string: + default: null + description: Name of the connection to write DLQ messages to. Must be an Atlas connection. + computedOptionalRequired: optional + name: connection_name + - string: + default: null + description: Name of the database to use for the DLQ. + computedOptionalRequired: optional + name: db + description: Dead letter queue for the stream processor. + computedOptionalRequired: optional + name: dlq + - bool: + default: null + description: When true, the modified stream processor resumes from its last checkpoint. + computedOptionalRequired: optional + name: resume_from_checkpoint + description: Optional configuration for the stream processor. + computedOptionalRequired: computed_optional + name: options + - list: + default: null + elementtype: 5 + description: Stream aggregation pipeline you want to apply to your streaming data. + computedOptionalRequired: optional + name: pipeline + - string: + default: null + description: The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. + computedOptionalRequired: computed + name: state + reqBodyUsage: 3 + - string: + default: null + description: The stats associated with the stream processor. + customType: + model: jsontypes.Normalized + schema: jsontypes.NormalizedType{} + computedOptionalRequired: computed + name: stats + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that identifies the stream instance. + computedOptionalRequired: required + name: tenant_name + reqBodyUsage: 3 + openapi-schema: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsProcessorWithStats" + x-xgen-version: 2024-05-30 + description: OK diff --git a/tools/codegen/codespec/api_spec.go b/tools/codegen/codespec/api_spec.go new file mode 100644 index 0000000000..8af4470750 --- /dev/null +++ b/tools/codegen/codespec/api_spec.go @@ -0,0 +1,93 @@ +package codespec + +import ( + "context" + "fmt" + "strconv" + + "github.com/pb33f/libopenapi/datamodel/high/base" + high "github.com/pb33f/libopenapi/datamodel/high/v3" + "github.com/pb33f/libopenapi/orderedmap" +) + +var ( + errSchemaNotFound = fmt.Errorf("schema not found") +) + +// BuildSchema function only builds the schema from a proxy and returns the basic type and format without handling oneOf, anyOf, allOf, or nullable types. +func BuildSchema(proxy *base.SchemaProxy) (*APISpecSchema, error) { + resp := &APISpecSchema{} + + schema, err := proxy.BuildSchema() + if err != nil { + return nil, fmt.Errorf("failed to build schema from proxy: %w", err) + } + + if len(schema.Type) == 0 { + return nil, fmt.Errorf("invalid schema. no values for schema.Type found") + } + + resp.Type = schema.Type[0] + resp.Schema = schema + + return resp, nil +} + +func getSchemaFromMediaType(mediaTypes *orderedmap.Map[string, *high.MediaType]) (*APISpecSchema, error) { + if mediaTypes == nil { + return nil, errSchemaNotFound + } + + sortedMediaTypes := orderedmap.SortAlpha(mediaTypes) + for pair := range orderedmap.Iterate(context.Background(), sortedMediaTypes) { + mediaType := pair.Value() + if mediaType.Schema != nil { + s, err := BuildSchema(mediaType.Schema) + if err != nil { + return nil, err + } + return s, nil + } + } + + return nil, errSchemaNotFound +} + +func buildSchemaFromRequest(op *high.Operation) (*APISpecSchema, error) { + if op == nil || op.RequestBody == nil || op.RequestBody.Content == nil || op.RequestBody.Content.Len() == 0 { + return nil, errSchemaNotFound + } + + return getSchemaFromMediaType(op.RequestBody.Content) +} + +func buildSchemaFromResponse(op *high.Operation) (*APISpecSchema, error) { + if op == nil || op.Responses == nil || op.Responses.Codes == nil || op.Responses.Codes.Len() == 0 { + return nil, errSchemaNotFound + } + + okResponse, ok := op.Responses.Codes.Get(OASResponseCodeOK) + if ok { + return getSchemaFromMediaType(okResponse.Content) + } + + createdResponse, ok := op.Responses.Codes.Get(OASResponseCodeCreated) + if ok { + return getSchemaFromMediaType(createdResponse.Content) + } + + sortedCodes := orderedmap.SortAlpha(op.Responses.Codes) + for pair := range orderedmap.Iterate(context.Background(), sortedCodes) { + responseCode := pair.Value() + statusCode, err := strconv.Atoi(pair.Key()) + if err != nil { + continue + } + + if statusCode >= 200 && statusCode <= 299 { + return getSchemaFromMediaType(responseCode.Content) + } + } + + return nil, errSchemaNotFound +} diff --git a/tools/codegen/codespec/api_spec_schema.go b/tools/codegen/codespec/api_spec_schema.go new file mode 100644 index 0000000000..a6f12fe1eb --- /dev/null +++ b/tools/codegen/codespec/api_spec_schema.go @@ -0,0 +1,53 @@ +package codespec + +import ( + "slices" + + "github.com/pb33f/libopenapi/datamodel/high/base" + high "github.com/pb33f/libopenapi/datamodel/high/v3" +) + +type APISpecSchema struct { + Schema *base.Schema + Type string +} + +type APISpecResource struct { + Description *string + DeprecationMessage *string + CreateOp *high.Operation + ReadOp *high.Operation + UpdateOp *high.Operation + DeleteOp *high.Operation + CommonParameters []*high.Parameter +} + +func (s *APISpecSchema) GetComputability(name string) ComputedOptionalRequired { + if slices.Contains(s.Schema.Required, name) { + return Required + } + + return Optional +} + +func (s *APISpecSchema) GetDeprecationMessage() *string { + if s.Schema.Deprecated == nil || !(*s.Schema.Deprecated) { + return nil + } + + deprecationMessage := "This attribute has been deprecated" + + return &deprecationMessage +} + +func (s *APISpecSchema) GetDescription() *string { + if s.Schema.Description == "" { + return nil + } + + return &s.Schema.Description +} + +func (s *APISpecSchema) IsSensitive() bool { + return s.Schema.Format == OASFormatPassword +} diff --git a/tools/codegen/codespec/api_to_provider_spec_mapper.go b/tools/codegen/codespec/api_to_provider_spec_mapper.go new file mode 100644 index 0000000000..67f1209f17 --- /dev/null +++ b/tools/codegen/codespec/api_to_provider_spec_mapper.go @@ -0,0 +1,327 @@ +package codespec + +import ( + "errors" + "fmt" + "github.com/getkin/kin-openapi/openapi3" + "log" + "strings" + + high "github.com/pb33f/libopenapi/datamodel/high/v3" + low "github.com/pb33f/libopenapi/datamodel/low/v3" + "github.com/pb33f/libopenapi/orderedmap" + + "github.com/mongodb/openapi/tools/codegen/config" + "github.com/mongodb/openapi/tools/codegen/openapi" + "github.com/mongodb/openapi/tools/codegen/stringcase" +) + +func ToCodeSpecModel(atlasAdminAPISpecFilePath, configPath string, resourceName *string) (*Model, error) { + apiSpec, err := openapi.ParseAtlasAdminAPI(atlasAdminAPISpecFilePath) + if err != nil { + return nil, fmt.Errorf("unable to parse Atlas Admin API: %v", err) + } + + configModel, err := config.ParseGenConfigYAML(configPath) + if err != nil { + return nil, fmt.Errorf("unable to parse config file: %v", err) + } + + resourceConfigsToIterate := configModel.Resources + if resourceName != nil { // only generate a specific resource + resourceConfigsToIterate = map[string]config.Resource{ + *resourceName: configModel.Resources[*resourceName], + } + } + + var results []Resource + for name, resourceConfig := range resourceConfigsToIterate { + log.Printf("Generating resource: %s", name) + // find resource operations, schemas, etc from OAS + oasResource, err := getAPISpecResource(&apiSpec.Model, &resourceConfig, stringcase.SnakeCaseString(name)) + if err != nil { + return nil, fmt.Errorf("unable to get APISpecResource schema: %v", err) + } + // map OAS resource model to CodeSpecModel + results = append(results, *apiSpecResourceToCodeSpecModel(oasResource, &resourceConfig, stringcase.SnakeCaseString(name))) + } + + return &Model{Resources: results}, nil +} + +func apiSpecResourceToCodeSpecModel(oasResource APISpecResource, resourceConfig *config.Resource, name stringcase.SnakeCaseString) *Resource { + createOp := oasResource.CreateOp + updateOp := oasResource.UpdateOp + readOp := oasResource.ReadOp + + createPathParams := pathParamsToAttributes(createOp) + createRequestAttributes := opRequestToAttributes(createOp) + updateRequestAttributes := opRequestToAttributes(updateOp) + createResponseAttributes := opResponseToAttributes(createOp) + readResponseAttributes := opResponseToAttributes(readOp) + + attributes := mergeAttributes(&attributeDefinitionSources{ + createPathParams: createPathParams, + createRequest: createRequestAttributes, + updateRequest: updateRequestAttributes, + createResponse: createResponseAttributes, + readResponse: readResponseAttributes, + }) + + schema := &Schema{ + Description: oasResource.Description, + DeprecationMessage: oasResource.DeprecationMessage, + Attributes: attributes, + } + + operations := getOperationsFromConfig(resourceConfig) + if operations.VersionHeader == "" { // version was not defined in config file + operations.VersionHeader = getLatestVersionFromAPISpec(readOp) + } + + resource := &Resource{ + Name: name, + Schema: schema, + OpenApiSchema: findSuccessfulResponse(&oasResource), + Operations: operations, + } + + applyConfigSchemaOptions(resourceConfig, resource) + + return resource +} + +func findSuccessfulResponse(oasResource *APISpecResource) any { + if oasResource.UpdateOp == nil { + return nil + } + + successFulResponses := []int{200, 201, 202, 203, 204, 205, 206, 207, 208, 226} + + for _, successCode := range successFulResponses { + response := oasResource.UpdateOp.Responses.FindResponseByCode(successCode) + if response != nil { + if response.GoLow().IsReference() { + // Use the document's index to find the referenced response. + return "" + } + // If it's not a reference, it's an inline response. + return response + } + } + return nil +} +func getLatestVersionFromAPISpec(readOp *high.Operation) string { + okResponse, ok := readOp.Responses.Codes.Get(OASResponseCodeOK) + if !ok { + return "" + } + versionsMap := okResponse.Content + if versionsMap == nil { + return "" + } + return orderedmap.SortAlpha(versionsMap).First().Key() +} + +func getOperationsFromConfig(resourceConfig *config.Resource) APIOperations { + return APIOperations{ + Create: operationConfigToModel(resourceConfig.Create), + Read: operationConfigToModel(resourceConfig.Read), + Update: operationConfigToModel(resourceConfig.Update), + Delete: operationConfigToModel(resourceConfig.Delete), + VersionHeader: resourceConfig.VersionHeader, + } +} + +func operationConfigToModel(opConfig *config.APIOperation) APIOperation { + return APIOperation{ + HTTPMethod: opConfig.Method, + Path: opConfig.Path, + Wait: waitConfigToModel(opConfig.Wait), + StaticRequestBody: opConfig.StaticRequestBody, + } +} + +func waitConfigToModel(waitConfig *config.Wait) *Wait { + if waitConfig == nil { + return nil + } + return &Wait{ + StateProperty: waitConfig.StateProperty, + PendingStates: waitConfig.PendingStates, + TargetStates: waitConfig.TargetStates, + TimeoutSeconds: waitConfig.TimeoutSeconds, + MinTimeoutSeconds: waitConfig.MinTimeoutSeconds, + DelaySeconds: waitConfig.DelaySeconds, + } +} + +func pathParamsToAttributes(createOp *high.Operation) Attributes { + pathParams := createOp.Parameters + + pathAttributes := Attributes{} + for _, param := range pathParams { + if param.In != OASPathParam { + continue + } + + s, err := BuildSchema(param.Schema) + if err != nil { + continue + } + + paramName := param.Name + s.Schema.Description = param.Description + parameterAttribute, err := s.buildResourceAttr(paramName, Required, false) + if err != nil { + log.Printf("[WARN] Path param %s could not be mapped: %s", paramName, err) + continue + } + pathAttributes = append(pathAttributes, *parameterAttribute) + } + return pathAttributes +} + +func opRequestToAttributes(op *high.Operation) Attributes { + var requestAttributes Attributes + requestSchema, err := buildSchemaFromRequest(op) + if err != nil { + log.Printf("[WARN] Request schema could not be mapped (OperationId: %s): %s", op.OperationId, err) + return nil + } + + requestAttributes, err = buildResourceAttrs(requestSchema, true) + if err != nil { + log.Printf("[WARN] Request attributes could not be mapped (OperationId: %s): %s", op.OperationId, err) + return nil + } + + return requestAttributes +} + +func opResponseToAttributes(op *high.Operation) Attributes { + var responseAttributes Attributes + responseSchema, err := buildSchemaFromResponse(op) + if err != nil { + if errors.Is(err, errSchemaNotFound) { + log.Printf("[INFO] Operation response body schema not found (OperationId: %s)", op.OperationId) + } else { + log.Printf("[WARN] Operation response body schema could not be mapped (OperationId: %s): %s", op.OperationId, err) + } + } else { + responseAttributes, err = buildResourceAttrs(responseSchema, false) + if err != nil { + log.Printf("[WARN] Operation response body schema could not be mapped (OperationId: %s): %s", op.OperationId, err) + } + } + return responseAttributes +} + +func getAPISpecResource(spec *high.Document, resourceConfig *config.Resource, name stringcase.SnakeCaseString) (APISpecResource, error) { + var errResult error + var resourceDeprecationMsg *string + + createOp, err := extractOp(spec.Paths, resourceConfig.Create) + if err != nil { + errResult = errors.Join(errResult, fmt.Errorf("unable to extract '%s.create' operation: %w", name, err)) + } + readOp, err := extractOp(spec.Paths, resourceConfig.Read) + if err != nil { + errResult = errors.Join(errResult, fmt.Errorf("unable to extract '%s.read' operation: %w", name, err)) + } + updateOp, err := extractOp(spec.Paths, resourceConfig.Update) + if err != nil { + errResult = errors.Join(errResult, fmt.Errorf("unable to extract '%s.update' operation: %w", name, err)) + } + deleteOp, err := extractOp(spec.Paths, resourceConfig.Delete) + if err != nil { + errResult = errors.Join(errResult, fmt.Errorf("unable to extract '%s.delete' operation: %w", name, err)) + } + + commonParameters, err := extractCommonParameters(spec.Paths, resourceConfig.Read.Path) + if err != nil { + errResult = errors.Join(errResult, fmt.Errorf("unable to extract '%s' common parameters: %w", name, err)) + } + + if readOp.Deprecated != nil && *readOp.Deprecated { + resourceDeprecationMsg = StringPtr(DefaultDeprecationMsg) + } + + return APISpecResource{ + Description: &createOp.Description, + DeprecationMessage: resourceDeprecationMsg, + CreateOp: createOp, + ReadOp: readOp, + UpdateOp: updateOp, + DeleteOp: deleteOp, + CommonParameters: commonParameters, + }, errResult +} + +func extractOp(paths *high.Paths, apiOp *config.APIOperation) (*high.Operation, error) { + if apiOp == nil { + return nil, nil + } + + if paths == nil || paths.PathItems == nil || paths.PathItems.GetOrZero(apiOp.Path) == nil { + return nil, fmt.Errorf("path '%s' not found in OpenAPI spec", apiOp.Path) + } + + pathItem, _ := paths.PathItems.Get(apiOp.Path) + + return extractOpFromPathItem(pathItem, apiOp) +} + +func extractOperation(paths *openapi3.Paths, apiOp *config.APIOperation) (*openapi3.Operation, error) { + if apiOp == nil { + return nil, nil + } + + if paths == nil || paths.Len() == 0 || paths.Map()[apiOp.Path] == nil { + return nil, fmt.Errorf("path '%s' not found in OpenAPI spec", apiOp.Path) + } + + return paths.Map()[apiOp.Path].GetOperation(apiOp.Method), nil +} + +func extractOpFromPathItem(pathItem *high.PathItem, apiOp *config.APIOperation) (*high.Operation, error) { + if pathItem == nil || apiOp == nil { + return nil, fmt.Errorf("pathItem or apiOp cannot be nil") + } + + switch strings.ToLower(apiOp.Method) { + case low.PostLabel: + return pathItem.Post, nil + case low.GetLabel: + return pathItem.Get, nil + case low.PutLabel: + return pathItem.Put, nil + case low.DeleteLabel: + return pathItem.Delete, nil + case low.PatchLabel: + return pathItem.Patch, nil + default: + return nil, fmt.Errorf("method '%s' not found at OpenAPI path '%s'", apiOp.Method, apiOp.Path) + } +} + +func extractCommonParameters(paths *high.Paths, path string) ([]*high.Parameter, error) { + if paths.PathItems.GetOrZero(path) == nil { + return nil, fmt.Errorf("path '%s' not found in OpenAPI spec", path) + } + + pathItem, _ := paths.PathItems.Get(path) + + return pathItem.Parameters, nil +} + +func StringPtr(v string) *string { + if v != "" { + return &v + } + return nil +} + +func Pointer[T any](x T) *T { + return &x +} diff --git a/tools/codegen/codespec/api_to_provider_spec_mapper_test.go b/tools/codegen/codespec/api_to_provider_spec_mapper_test.go new file mode 100644 index 0000000000..98dbea738f --- /dev/null +++ b/tools/codegen/codespec/api_to_provider_spec_mapper_test.go @@ -0,0 +1,524 @@ +package codespec_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/mongodb/openapi/tools/codegen/codespec" +) + +const ( + testFieldDesc = "Test field description" + testResourceDesc = "POST API description" + testPathParamDesc = "Path param test description" + testDataAPISpecPath = "testdata/api-spec.yml" + testDataConfigPath = "testdata/config.yml" +) + +type convertToSpecTestCase struct { + expectedResult *codespec.Model + inputOpenAPISpecPath string + inputConfigPath string + inputResourceName string +} + +func TestConvertToProviderSpec(t *testing.T) { + tc := convertToSpecTestCase{ + inputOpenAPISpecPath: testDataAPISpecPath, + inputConfigPath: testDataConfigPath, + inputResourceName: "test_resource_no_schema_opts", + + expectedResult: &codespec.Model{ + Resources: []codespec.Resource{{ + Schema: &codespec.Schema{ + Description: codespec.StringPtr(testResourceDesc), + Attributes: codespec.Attributes{ + { + Name: "bool_default_attr", + ComputedOptionalRequired: codespec.ComputedOptional, + Bool: &codespec.BoolAttribute{Default: codespec.Pointer(false)}, + }, + { + Name: "count", + ComputedOptionalRequired: codespec.Optional, + Int64: &codespec.Int64Attribute{}, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "create_date", + String: &codespec.StringAttribute{}, + ComputedOptionalRequired: codespec.Computed, + Description: codespec.StringPtr(testFieldDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "group_id", + ComputedOptionalRequired: codespec.Required, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testPathParamDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "num_double_default_attr", + Float64: &codespec.Float64Attribute{Default: codespec.Pointer(2.0)}, + ComputedOptionalRequired: codespec.ComputedOptional, + }, + { + Name: "str_computed_attr", + ComputedOptionalRequired: codespec.Computed, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testFieldDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "str_req_attr1", + ComputedOptionalRequired: codespec.Required, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "str_req_attr2", + ComputedOptionalRequired: codespec.Required, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "str_req_attr3", + String: &codespec.StringAttribute{}, + ComputedOptionalRequired: codespec.Required, + Description: codespec.StringPtr(testFieldDesc), + }, + }, + }, + Name: "test_resource_no_schema_opts", + Operations: codespec.APIOperations{ + Create: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/testResource", + HTTPMethod: "POST", + }, + Read: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/testResource", + HTTPMethod: "GET", + }, + Update: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/testResource", + HTTPMethod: "PATCH", + }, + Delete: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/testResource", + HTTPMethod: "DELETE", + }, + VersionHeader: "application/vnd.atlas.2023-01-01+json", + }, + }}, + }, + } + runTestCase(t, tc) +} + +func TestConvertToProviderSpec_nested(t *testing.T) { + tc := convertToSpecTestCase{ + inputOpenAPISpecPath: testDataAPISpecPath, + inputConfigPath: testDataConfigPath, + inputResourceName: "test_resource_with_nested_attr", + + expectedResult: &codespec.Model{ + Resources: []codespec.Resource{{ + Schema: &codespec.Schema{ + Description: codespec.StringPtr(testResourceDesc), + Attributes: codespec.Attributes{ + { + Name: "attr_always_in_updates", + ComputedOptionalRequired: codespec.Optional, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr("Always in updates"), + }, + { + Name: "cluster_name", + ComputedOptionalRequired: codespec.Required, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testPathParamDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "group_id", + ComputedOptionalRequired: codespec.Required, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testPathParamDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "list_primitive_string_attr", + ComputedOptionalRequired: codespec.Computed, + List: &codespec.ListAttribute{ + ElementType: codespec.String, + }, + Description: codespec.StringPtr(testFieldDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "nested_list_array_attr", + ComputedOptionalRequired: codespec.Required, + ListNested: &codespec.ListNestedAttribute{ + NestedObject: codespec.NestedAttributeObject{ + Attributes: codespec.Attributes{ + { + Name: "inner_num_attr", + ComputedOptionalRequired: codespec.Required, + Int64: &codespec.Int64Attribute{}, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "list_primitive_string_attr", + ComputedOptionalRequired: codespec.Optional, + List: &codespec.ListAttribute{ + ElementType: codespec.String, + }, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "list_primitive_string_computed_attr", + ComputedOptionalRequired: codespec.Computed, + List: &codespec.ListAttribute{ + ElementType: codespec.String, + }, + Description: codespec.StringPtr(testFieldDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + }, + }, + }, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "nested_map_object_attr", + ComputedOptionalRequired: codespec.Computed, + MapNested: &codespec.MapNestedAttribute{ + NestedObject: codespec.NestedAttributeObject{ + Attributes: codespec.Attributes{ + { + Name: "attr", + ComputedOptionalRequired: codespec.Computed, + String: &codespec.StringAttribute{}, + ReqBodyUsage: codespec.OmitAlways, + }, + }, + }, + }, + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "nested_set_array_attr", + ComputedOptionalRequired: codespec.Computed, + SetNested: &codespec.SetNestedAttribute{ + NestedObject: codespec.NestedAttributeObject{ + Attributes: codespec.Attributes{ + { + Name: "inner_num_attr", + ComputedOptionalRequired: codespec.Computed, + Int64: &codespec.Int64Attribute{}, + Description: codespec.StringPtr(testFieldDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "list_primitive_string_attr", + ComputedOptionalRequired: codespec.Computed, + List: &codespec.ListAttribute{ + ElementType: codespec.String, + }, + Description: codespec.StringPtr(testFieldDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + }, + }, + }, + ReqBodyUsage: codespec.OmitAlways, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "optional_string_attr", + ComputedOptionalRequired: codespec.Optional, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr("Optional string"), + }, + { + Name: "set_primitive_string_attr", + ComputedOptionalRequired: codespec.Computed, + Set: &codespec.SetAttribute{ + ElementType: codespec.String, + }, + ReqBodyUsage: codespec.OmitAlways, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "single_nested_attr", + ComputedOptionalRequired: codespec.Computed, + SingleNested: &codespec.SingleNestedAttribute{ + NestedObject: codespec.NestedAttributeObject{ + Attributes: codespec.Attributes{ + { + Name: "inner_int_attr", + ComputedOptionalRequired: codespec.Computed, + Int64: &codespec.Int64Attribute{}, + Description: codespec.StringPtr(testFieldDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "inner_str_attr", + ComputedOptionalRequired: codespec.Computed, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testFieldDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + }, + }, + }, + ReqBodyUsage: codespec.OmitAlways, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "single_nested_attr_with_nested_maps", + ComputedOptionalRequired: codespec.Computed, + SingleNested: &codespec.SingleNestedAttribute{ + NestedObject: codespec.NestedAttributeObject{ + Attributes: codespec.Attributes{ + { + Name: "map_attr1", + ComputedOptionalRequired: codespec.Computed, + Map: &codespec.MapAttribute{ + ElementType: codespec.String, + }, + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "map_attr2", + ComputedOptionalRequired: codespec.Computed, + Map: &codespec.MapAttribute{ + ElementType: codespec.String, + }, + ReqBodyUsage: codespec.OmitAlways, + }, + }, + }, + }, + ReqBodyUsage: codespec.OmitAlways, + Description: codespec.StringPtr(testFieldDesc), + }, + }, + }, + Name: "test_resource_with_nested_attr", + Operations: codespec.APIOperations{ + Create: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource", + HTTPMethod: "POST", + }, + Read: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource", + HTTPMethod: "GET", + }, + Update: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource", + HTTPMethod: "PATCH", + }, + Delete: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource", + HTTPMethod: "DELETE", + }, + VersionHeader: "application/vnd.atlas.2024-05-30+json", + }, + }}, + }, + } + runTestCase(t, tc) +} + +func TestConvertToProviderSpec_nested_schemaOverrides(t *testing.T) { + tc := convertToSpecTestCase{ + inputOpenAPISpecPath: testDataAPISpecPath, + inputConfigPath: "testdata/config-nested-schema-overrides.yml", + inputResourceName: "test_resource_with_nested_attr_overrides", + + expectedResult: &codespec.Model{ + Resources: []codespec.Resource{{ + Schema: &codespec.Schema{ + Description: codespec.StringPtr(testResourceDesc), + Attributes: codespec.Attributes{ + { + Name: "attr_always_in_updates", + ComputedOptionalRequired: codespec.Optional, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr("Always in updates"), + ReqBodyUsage: codespec.IncludeNullOnUpdate, + }, + { + Name: "project_id", + ComputedOptionalRequired: codespec.Required, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testPathParamDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "nested_list_array_attr", + ComputedOptionalRequired: codespec.Required, + ListNested: &codespec.ListNestedAttribute{ + NestedObject: codespec.NestedAttributeObject{ + Attributes: codespec.Attributes{ + { + Name: "inner_num_attr_alias", + ComputedOptionalRequired: codespec.Required, + Int64: &codespec.Int64Attribute{}, + Description: codespec.StringPtr("Overridden inner_num_attr_alias description"), + }, + { + Name: "list_primitive_string_computed_attr", + ComputedOptionalRequired: codespec.Computed, + List: &codespec.ListAttribute{ + ElementType: codespec.String, + }, + Description: codespec.StringPtr(testFieldDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + }, + }, + }, + Description: codespec.StringPtr(testFieldDesc), + }, + { + Name: "optional_string_attr", + ComputedOptionalRequired: codespec.ComputedOptional, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr("Optional string that has config override to optional/computed"), + }, + { + Name: "outer_object", + ComputedOptionalRequired: codespec.Computed, + ReqBodyUsage: codespec.OmitAlways, + SingleNested: &codespec.SingleNestedAttribute{ + NestedObject: codespec.NestedAttributeObject{ + Attributes: codespec.Attributes{ + { + Name: "nested_level1", + ComputedOptionalRequired: codespec.Computed, + ReqBodyUsage: codespec.OmitAlways, + SingleNested: &codespec.SingleNestedAttribute{ + NestedObject: codespec.NestedAttributeObject{ + Attributes: codespec.Attributes{ + { + Name: "level_field1_alias", + ComputedOptionalRequired: codespec.Computed, + ReqBodyUsage: codespec.OmitAlways, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr("Overridden level_field1_alias description"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + Name: "timeouts", + Timeouts: &codespec.TimeoutsAttribute{ + ConfigurableTimeouts: []codespec.Operation{codespec.Create, codespec.Read, codespec.Update, codespec.Delete}, + }, + ReqBodyUsage: codespec.OmitAlways, + }, + }, + }, + Name: "test_resource_with_nested_attr_overrides", + Operations: codespec.APIOperations{ + Create: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{projectId}/clusters/{clusterName}/nestedTestResource", + HTTPMethod: "POST", + }, + Read: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{projectId}/clusters/{clusterName}/nestedTestResource", + HTTPMethod: "GET", + }, + Update: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{projectId}/clusters/{clusterName}/nestedTestResource", + HTTPMethod: "PATCH", + }, + Delete: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{projectId}/clusters/{clusterName}/nestedTestResource", + HTTPMethod: "DELETE", + }, + VersionHeader: "application/vnd.atlas.2035-01-01+json", // version header defined in config + }, + }, + }, + }, + } + runTestCase(t, tc) +} + +func TestConvertToProviderSpec_pathParamPresentInPostRequest(t *testing.T) { + tc := convertToSpecTestCase{ + inputOpenAPISpecPath: testDataAPISpecPath, + inputConfigPath: testDataConfigPath, + inputResourceName: "test_resource_path_param_in_post_req", + + expectedResult: &codespec.Model{ + Resources: []codespec.Resource{{ + Schema: &codespec.Schema{ + Description: codespec.StringPtr(testResourceDesc), + Attributes: codespec.Attributes{ + { + Name: "group_id", + ComputedOptionalRequired: codespec.Required, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testPathParamDesc), + ReqBodyUsage: codespec.OmitAlways, + }, + { + Name: "special_param", + ComputedOptionalRequired: codespec.Required, + String: &codespec.StringAttribute{}, + ReqBodyUsage: codespec.OmitInUpdateBody, + Description: codespec.StringPtr(testPathParamDesc), + }, + { + Name: "str_req_attr1", + ComputedOptionalRequired: codespec.Optional, + String: &codespec.StringAttribute{}, + Description: codespec.StringPtr(testFieldDesc), + }, + }, + }, + Name: "test_resource_path_param_in_post_req", + Operations: codespec.APIOperations{ + Create: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/pathparaminpostreq", + HTTPMethod: "POST", + }, + Read: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/pathparaminpostreq/{specialParam}", + HTTPMethod: "GET", + }, + Delete: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/pathparaminpostreq/{specialParam}", + HTTPMethod: "DELETE", + }, + Update: codespec.APIOperation{ + Path: "/api/atlas/v2/groups/{groupId}/pathparaminpostreq/{specialParam}", + HTTPMethod: "PATCH", + }, + VersionHeader: "application/vnd.atlas.2023-01-01+json", + }, + }, + }, + }, + } + runTestCase(t, tc) +} + +func runTestCase(t *testing.T, tc convertToSpecTestCase) { + t.Helper() + result, err := codespec.ToCodeSpecModel(tc.inputOpenAPISpecPath, tc.inputConfigPath, &tc.inputResourceName) + require.NoError(t, err) + assert.Equal(t, tc.expectedResult, result, "Expected result to match the specified structure") +} diff --git a/tools/codegen/codespec/attribute.go b/tools/codegen/codespec/attribute.go new file mode 100644 index 0000000000..dc3b25ac6a --- /dev/null +++ b/tools/codegen/codespec/attribute.go @@ -0,0 +1,291 @@ +package codespec + +import ( + "context" + "fmt" + + "github.com/mongodb/openapi/tools/codegen/stringcase" + "github.com/pb33f/libopenapi/orderedmap" +) + +func buildResourceAttrs(s *APISpecSchema, isFromRequest bool) (Attributes, error) { + objectAttributes := Attributes{} + + sortedProperties := orderedmap.SortAlpha(s.Schema.Properties) + for pair := range orderedmap.Iterate(context.Background(), sortedProperties) { + name := pair.Key() + proxy := pair.Value() + + schema, err := BuildSchema(proxy) + if err != nil { + return nil, err + } + + // ignores properties defined in request which are defined with readOnly (common in Atlas API Spec) + if schema.Schema.ReadOnly != nil && *schema.Schema.ReadOnly && isFromRequest { + continue + } + + attribute, err := schema.buildResourceAttr(name, s.GetComputability(name), isFromRequest) + if err != nil { + return nil, err + } + + if attribute != nil { + objectAttributes = append(objectAttributes, *attribute) + } + } + + return objectAttributes, nil +} + +func (s *APISpecSchema) buildResourceAttr(name string, computability ComputedOptionalRequired, isFromRequest bool) (*Attribute, error) { + switch s.Type { + case OASTypeString: + return s.buildStringAttr(name, computability) + case OASTypeInteger: + return s.buildIntegerAttr(name, computability) + case OASTypeNumber: + return s.buildNumberAttr(name, computability) + case OASTypeBoolean: + return s.buildBoolAttr(name, computability) + case OASTypeArray: + return s.buildArrayAttr(name, computability, isFromRequest) + case OASTypeObject: + if s.Schema.AdditionalProperties != nil && s.Schema.AdditionalProperties.IsA() { + return s.buildMapAttr(name, computability, isFromRequest) + } + return s.buildSingleNestedAttr(name, computability, isFromRequest) + default: + return nil, fmt.Errorf("invalid schema type '%s'", s.Type) + } +} + +func (s *APISpecSchema) buildStringAttr(name string, computability ComputedOptionalRequired) (*Attribute, error) { + result := &Attribute{ + Name: stringcase.FromCamelCase(name), + ComputedOptionalRequired: computability, + DeprecationMessage: s.GetDeprecationMessage(), + Description: s.GetDescription(), + Sensitive: s.IsSensitive(), + String: &StringAttribute{}, + } + + if s.Schema.Default != nil { + var staticDefault string + if err := s.Schema.Default.Decode(&staticDefault); err == nil { + result.ComputedOptionalRequired = ComputedOptional + + result.String.Default = &staticDefault + } + } + + return result, nil +} + +func (s *APISpecSchema) buildIntegerAttr(name string, computability ComputedOptionalRequired) (*Attribute, error) { + result := &Attribute{ + Name: stringcase.FromCamelCase(name), + ComputedOptionalRequired: computability, + DeprecationMessage: s.GetDeprecationMessage(), + Description: s.GetDescription(), + Int64: &Int64Attribute{}, + } + + if s.Schema.Default != nil { + var staticDefault int64 + if err := s.Schema.Default.Decode(&staticDefault); err == nil { + result.ComputedOptionalRequired = ComputedOptional + + result.Int64.Default = &staticDefault + } + } + + return result, nil +} + +func (s *APISpecSchema) buildNumberAttr(name string, computability ComputedOptionalRequired) (*Attribute, error) { + if s.Schema.Format == OASFormatDouble || s.Schema.Format == OASFormatFloat { + result := &Attribute{ + Name: stringcase.FromCamelCase(name), + ComputedOptionalRequired: computability, + DeprecationMessage: s.GetDeprecationMessage(), + Description: s.GetDescription(), + Float64: &Float64Attribute{}, + } + + if s.Schema.Default != nil { + var staticDefault float64 + if err := s.Schema.Default.Decode(&staticDefault); err == nil { + result.ComputedOptionalRequired = ComputedOptional + + result.Float64.Default = &staticDefault + } + } + + return result, nil + } + + return &Attribute{ + Name: stringcase.FromCamelCase(name), + ComputedOptionalRequired: computability, + DeprecationMessage: s.GetDeprecationMessage(), + Description: s.GetDescription(), + Number: &NumberAttribute{}, + }, nil +} + +func (s *APISpecSchema) buildBoolAttr(name string, computability ComputedOptionalRequired) (*Attribute, error) { + result := &Attribute{ + Name: stringcase.FromCamelCase(name), + ComputedOptionalRequired: computability, + DeprecationMessage: s.GetDeprecationMessage(), + Description: s.GetDescription(), + Bool: &BoolAttribute{}, + } + + if s.Schema.Default != nil { + var staticDefault bool + if err := s.Schema.Default.Decode(&staticDefault); err == nil { + result.ComputedOptionalRequired = ComputedOptional + result.Bool.Default = &staticDefault + } + } + + return result, nil +} + +func (s *APISpecSchema) buildArrayAttr(name string, computability ComputedOptionalRequired, isFromRequest bool) (*Attribute, error) { + if !s.Schema.Items.IsA() { + return nil, fmt.Errorf("invalid array items property, schema doesn't exist: %s", name) + } + + itemSchema, err := BuildSchema(s.Schema.Items.A) + if err != nil { + return nil, fmt.Errorf("error while building nested schema: %s", name) + } + + isSet := s.Schema.Format == OASFormatSet || (s.Schema.UniqueItems != nil && *s.Schema.UniqueItems) + + createAttribute := func(nestedObject *NestedAttributeObject, elemType ElemType) *Attribute { + var ( + attr = &Attribute{ + Name: stringcase.FromCamelCase(name), + ComputedOptionalRequired: computability, + DeprecationMessage: s.GetDeprecationMessage(), + Description: s.GetDescription(), + } + isNested = nestedObject != nil + isNestedEmpty = isNested && len(nestedObject.Attributes) == 0 + ) + + if isNested && isNestedEmpty { // objects without attributes use JSON custom type + elemType = CustomTypeJSON + } + + if isNested && !isNestedEmpty { + if isSet { + attr.SetNested = &SetNestedAttribute{NestedObject: *nestedObject} + } else { + attr.ListNested = &ListNestedAttribute{NestedObject: *nestedObject} + } + } else { + if isSet { + attr.Set = &SetAttribute{ElementType: elemType} + } else { + attr.List = &ListAttribute{ElementType: elemType} + } + } + + return attr + } + + if itemSchema.Type == OASTypeObject { + objectAttributes, err := buildResourceAttrs(itemSchema, isFromRequest) + if err != nil { + return nil, fmt.Errorf("error while building nested schema: %s", name) + } + nestedObject := &NestedAttributeObject{Attributes: objectAttributes} + + return createAttribute(nestedObject, Unknown), nil // Using Unknown ElemType as a placeholder for no ElemType + } + + elemType, err := itemSchema.buildElementType() + if err != nil { + return nil, fmt.Errorf("error while building nested schema: %s", name) + } + + result := createAttribute(nil, elemType) + + if s.Schema.Default != nil { + var staticDefault bool + if err := s.Schema.Default.Decode(&staticDefault); err == nil { + result.ComputedOptionalRequired = ComputedOptional + result.Bool.Default = &staticDefault + } + } + + return result, nil +} + +func (s *APISpecSchema) buildMapAttr(name string, computability ComputedOptionalRequired, isFromRequest bool) (*Attribute, error) { + mapSchema, err := BuildSchema(s.Schema.AdditionalProperties.A) + if err != nil { + return nil, err + } + + result := &Attribute{ + Name: stringcase.FromCamelCase(name), + ComputedOptionalRequired: computability, + DeprecationMessage: s.GetDeprecationMessage(), + Description: s.GetDescription(), + } + + if mapSchema.Type == OASTypeObject { + mapAttributes, err := buildResourceAttrs(mapSchema, isFromRequest) + if err != nil { + return nil, err + } + + result.MapNested = &MapNestedAttribute{ + NestedObject: NestedAttributeObject{ + Attributes: mapAttributes, + }, + } + } else { + elemType, err := mapSchema.buildElementType() + if err != nil { + return nil, err + } + + result.Map = &MapAttribute{ + ElementType: elemType, + } + } + + return result, nil +} + +func (s *APISpecSchema) buildSingleNestedAttr(name string, computability ComputedOptionalRequired, isFromRequest bool) (*Attribute, error) { + attr := &Attribute{ + Name: stringcase.FromCamelCase(name), + ComputedOptionalRequired: computability, + DeprecationMessage: s.GetDeprecationMessage(), + Description: s.GetDescription(), + } + objectAttributes, err := buildResourceAttrs(s, isFromRequest) + if err != nil { + return nil, err + } + if len(objectAttributes) > 0 { + attr.SingleNested = &SingleNestedAttribute{ + NestedObject: NestedAttributeObject{ + Attributes: objectAttributes, + }, + } + } else { // objects without attributes use JSON custom type + attr.CustomType = &CustomTypeJSONVar + attr.String = &StringAttribute{} + } + return attr, nil +} diff --git a/tools/codegen/codespec/computability.go b/tools/codegen/codespec/computability.go new file mode 100644 index 0000000000..394d411f82 --- /dev/null +++ b/tools/codegen/codespec/computability.go @@ -0,0 +1,10 @@ +package codespec + +const ( + Computed ComputedOptionalRequired = "computed" + ComputedOptional ComputedOptionalRequired = "computed_optional" + Optional ComputedOptionalRequired = "optional" + Required ComputedOptionalRequired = "required" +) + +type ComputedOptionalRequired string diff --git a/tools/codegen/codespec/config.go b/tools/codegen/codespec/config.go new file mode 100644 index 0000000000..5737ff8158 --- /dev/null +++ b/tools/codegen/codespec/config.go @@ -0,0 +1,162 @@ +package codespec + +import ( + "fmt" + "log" + "strings" + + "github.com/mongodb/openapi/tools/codegen/config" + "github.com/mongodb/openapi/tools/codegen/stringcase" +) + +func applyConfigSchemaOptions(resourceConfig *config.Resource, resource *Resource) { + applySchemaOptions(resourceConfig.SchemaOptions, &resource.Schema.Attributes, "") + applyAliasToPathParams(resource, resourceConfig.SchemaOptions.Aliases) +} + +func applySchemaOptions(schemaOptions config.SchemaOptions, attributes *Attributes, parentName string) { + ignoredAttrs := getIgnoredAttributesMap(schemaOptions.Ignores) + + var finalAttributes Attributes + + for i := range *attributes { + attr := &(*attributes)[i] + attrPathName := getAttributePathName(string(attr.Name), parentName) + + if shouldIgnoreAttribute(attrPathName, ignoredAttrs) { + continue + } + + // the config is expected to use alias name for defining any subsequent overrides (description, etc) + applyAliasToAttribute(attr, &attrPathName, schemaOptions) + + applyOverrides(attr, attrPathName, schemaOptions) + + processNestedAttributes(attr, schemaOptions, attrPathName) + + finalAttributes = append(finalAttributes, *attr) + } + + if timeoutAttr := applyTimeoutConfig(schemaOptions); parentName == "" && timeoutAttr != nil { // will not run for nested attributes + finalAttributes = append(finalAttributes, *timeoutAttr) + } + + *attributes = finalAttributes +} + +func getAttributePathName(attrName, parentName string) string { + if parentName == "" { + return attrName + } + return parentName + "." + attrName +} + +func getIgnoredAttributesMap(ignores []string) map[string]bool { + ignoredAttrs := make(map[string]bool) + for _, ignoredAttr := range ignores { + ignoredAttrs[ignoredAttr] = true + } + return ignoredAttrs +} + +func shouldIgnoreAttribute(attrName string, ignoredAttrs map[string]bool) bool { + return ignoredAttrs[attrName] +} + +func applyAliasToAttribute(attr *Attribute, attrPathName *string, schemaOptions config.SchemaOptions) { + parts := strings.Split(*attrPathName, ".") + + for i := range parts { + currentPath := strings.Join(parts[:i+1], ".") + + if newName, ok := schemaOptions.Aliases[currentPath]; ok { + parts[i] = newName + + if i == len(parts)-1 { + attr.Name = stringcase.SnakeCaseString(newName) + } + } + } + + *attrPathName = strings.Join(parts, ".") +} + +func applyAliasToPathParams(resource *Resource, aliases map[string]string) { + for original, alias := range aliases { + originalCamel := stringcase.SnakeCaseString(original).CamelCase() + aliasCamel := stringcase.SnakeCaseString(alias).CamelCase() + resource.Operations.Create.Path = strings.ReplaceAll(resource.Operations.Create.Path, fmt.Sprintf("{%s}", originalCamel), fmt.Sprintf("{%s}", aliasCamel)) + resource.Operations.Read.Path = strings.ReplaceAll(resource.Operations.Read.Path, fmt.Sprintf("{%s}", originalCamel), fmt.Sprintf("{%s}", aliasCamel)) + resource.Operations.Update.Path = strings.ReplaceAll(resource.Operations.Update.Path, fmt.Sprintf("{%s}", originalCamel), fmt.Sprintf("{%s}", aliasCamel)) + resource.Operations.Delete.Path = strings.ReplaceAll(resource.Operations.Delete.Path, fmt.Sprintf("{%s}", originalCamel), fmt.Sprintf("{%s}", aliasCamel)) + } +} + +func applyOverrides(attr *Attribute, attrPathName string, schemaOptions config.SchemaOptions) { + if override, ok := schemaOptions.Overrides[attrPathName]; ok { + if override.Description != "" { + attr.Description = &override.Description + } + if override.Computability != nil { + attr.ComputedOptionalRequired = getComputabilityFromConfig(*override.Computability) + } + if override.Sensitive != nil { + attr.Sensitive = *override.Sensitive + } + if override.IncludeNullOnUpdate != nil && *override.IncludeNullOnUpdate { + attr.ReqBodyUsage = IncludeNullOnUpdate + } + } +} + +func getComputabilityFromConfig(computability config.Computability) ComputedOptionalRequired { + if computability.Computed && computability.Optional { + return ComputedOptional + } + if computability.Computed { + return Computed + } + if computability.Optional { + return Optional + } + return Required +} + +func processNestedAttributes(attr *Attribute, schemaOptions config.SchemaOptions, attrPathName string) { + switch { + case attr.ListNested != nil: + applySchemaOptions(schemaOptions, &attr.ListNested.NestedObject.Attributes, attrPathName) + case attr.SingleNested != nil: + applySchemaOptions(schemaOptions, &attr.SingleNested.NestedObject.Attributes, attrPathName) + case attr.SetNested != nil: + applySchemaOptions(schemaOptions, &attr.SetNested.NestedObject.Attributes, attrPathName) + case attr.MapNested != nil: + applySchemaOptions(schemaOptions, &attr.MapNested.NestedObject.Attributes, attrPathName) + } +} + +func applyTimeoutConfig(options config.SchemaOptions) *Attribute { + var result []Operation + for _, op := range options.Timeouts { + switch op { + case "create": + result = append(result, Create) + case "read": + result = append(result, Read) + case "delete": + result = append(result, Delete) + case "update": + result = append(result, Update) + default: + log.Printf("[WARN] Unknown operation type defined in timeout configuration: %s", op) + } + } + if result != nil { + return &Attribute{ + Name: "timeouts", + Timeouts: &TimeoutsAttribute{ConfigurableTimeouts: result}, + ReqBodyUsage: OmitAlways, + } + } + return nil +} diff --git a/tools/codegen/codespec/constants.go b/tools/codegen/codespec/constants.go new file mode 100644 index 0000000000..cd41c1b8c0 --- /dev/null +++ b/tools/codegen/codespec/constants.go @@ -0,0 +1,21 @@ +package codespec + +const ( + OASTypeString = "string" + OASTypeInteger = "integer" + OASTypeNumber = "number" + OASTypeBoolean = "boolean" + OASTypeArray = "array" + OASTypeObject = "object" + OASFormatDouble = "double" + OASFormatFloat = "float" + OASFormatPassword = "password" + OASFormatSet = "set" + + OASResponseCodeOK = "200" + OASResponseCodeCreated = "201" + + OASPathParam = "path" + + DefaultDeprecationMsg = "This resource has been deprecated" +) diff --git a/tools/codegen/codespec/element_type.go b/tools/codegen/codespec/element_type.go new file mode 100644 index 0000000000..1546786211 --- /dev/null +++ b/tools/codegen/codespec/element_type.go @@ -0,0 +1,20 @@ +package codespec + +import "fmt" + +func (s *APISpecSchema) buildElementType() (ElemType, error) { + switch s.Type { + case OASTypeString: + return String, nil + case OASTypeBoolean: + return Bool, nil + case OASTypeInteger: + return Int64, nil + case OASTypeNumber: + return Number, nil + case OASTypeArray, OASTypeObject: + return String, nil // complex element types are unsupported so this defaults to string for now to provide best effort generation + default: + return Unknown, fmt.Errorf("invalid schema type '%s'", s.Type) + } +} diff --git a/tools/codegen/codespec/merge_attributes.go b/tools/codegen/codespec/merge_attributes.go new file mode 100644 index 0000000000..57ec65ef94 --- /dev/null +++ b/tools/codegen/codespec/merge_attributes.go @@ -0,0 +1,180 @@ +package codespec + +import ( + "sort" +) + +// mergeNestedAttributes recursively merges nested attributes +func mergeNestedAttributes(existingAttrs *Attributes, newAttrs Attributes, reqBodyUsage AttributeReqBodyUsage, isFromResponse bool) { + mergedMap := make(map[string]*Attribute) + if existingAttrs != nil { + for i := range *existingAttrs { + mergedMap[(*existingAttrs)[i].Name.SnakeCase()] = &(*existingAttrs)[i] + } + } + + // add new attributes and merge when necessary + for i := range newAttrs { + newAttr := &newAttrs[i] + addOrUpdate(mergedMap, newAttr, reqBodyUsage, isFromResponse) + } + + // update original existingAttrs with the merged result + *existingAttrs = make(Attributes, 0, len(mergedMap)) + for _, attr := range mergedMap { + *existingAttrs = append(*existingAttrs, *attr) + } + + sortAttributes(*existingAttrs) +} + +// mergeComputability merges two ComputedOptionalRequired values and returns the most restrictive one +func mergeComputability(first, second ComputedOptionalRequired) ComputedOptionalRequired { + if first == Required || second == Required { + return Required + } + if first == ComputedOptional || second == ComputedOptional { + return ComputedOptional + } + if first == Optional || second == Optional { + return Optional + } + return Computed +} + +// addOrUpdate adds or updates an attribute in the merged map, including nested attributes +func addOrUpdate(merged map[string]*Attribute, newAttr *Attribute, reqBodyUsage AttributeReqBodyUsage, isFromResponse bool) { + if existingAttr, found := merged[newAttr.Name.SnakeCase()]; found { + updateAttrWithNewSource(existingAttr, newAttr, reqBodyUsage, isFromResponse) + } else { + if isFromResponse { + newAttr.ComputedOptionalRequired = Computed // setting as computed as attribute was defined only in response + } + newAttr.ReqBodyUsage = reqBodyUsage + merged[newAttr.Name.SnakeCase()] = newAttr + } +} + +// updateAttrWithNewSource updates an existing attribute with information from an additional source +func updateAttrWithNewSource(existingAttr, newAttr *Attribute, reqBodyUsage AttributeReqBodyUsage, isFromResponse bool) { + if existingAttr.Description == nil || *existingAttr.Description == "" { + existingAttr.Description = newAttr.Description + } + + // when property is in both request and response values computablity and reqBodyUsage will ignore information from response + if !isFromResponse { + existingAttr.ReqBodyUsage = reqBodyUsage + // merging ensures if property is defined in POST and PATCH it will have the most restrictive computability + existingAttr.ComputedOptionalRequired = mergeComputability(newAttr.ComputedOptionalRequired, existingAttr.ComputedOptionalRequired) + } + + // handle nested attributes + if existingAttr.ListNested != nil && newAttr.ListNested != nil { + mergeNestedAttributes(&existingAttr.ListNested.NestedObject.Attributes, newAttr.ListNested.NestedObject.Attributes, reqBodyUsage, isFromResponse) + } else if newAttr.ListNested != nil { + existingAttr.ListNested = newAttr.ListNested + } + + if existingAttr.SingleNested != nil && newAttr.SingleNested != nil { + mergeNestedAttributes(&existingAttr.SingleNested.NestedObject.Attributes, newAttr.SingleNested.NestedObject.Attributes, reqBodyUsage, isFromResponse) + } else if newAttr.SingleNested != nil { + existingAttr.SingleNested = newAttr.SingleNested + } + + if existingAttr.SetNested != nil && newAttr.SetNested != nil { + mergeNestedAttributes(&existingAttr.SetNested.NestedObject.Attributes, newAttr.SetNested.NestedObject.Attributes, reqBodyUsage, isFromResponse) + } else if newAttr.SetNested != nil { + existingAttr.SetNested = newAttr.SetNested + } + + if existingAttr.MapNested != nil && newAttr.MapNested != nil { + mergeNestedAttributes(&existingAttr.MapNested.NestedObject.Attributes, newAttr.MapNested.NestedObject.Attributes, reqBodyUsage, isFromResponse) + } else if newAttr.MapNested != nil { + existingAttr.MapNested = newAttr.MapNested + } +} + +type attributeDefinitionSources struct { + createPathParams, createRequest, updateRequest, createResponse, readResponse Attributes +} + +// mergeAttributes merges attributes from different sources (path params, create/get operation bodies) and determines a single merged list of attributes. +// Computability and reqBodyUsage values are determined as part of this process. +// Different sources are applied in a specific order, defining the computability and reqBodyUsage value they have at each step. +func mergeAttributes(sources *attributeDefinitionSources) Attributes { + merged := make(map[string]*Attribute) + + // create path parameters: all attributes will be "required", reqBodyUsage is defined as omit all at this step + for i := range sources.createPathParams { + addOrUpdate(merged, &sources.createPathParams[i], OmitAlways, false) + } + + // POST request body: optional/required is as defined, reqBodyUsage is defined as OmitUpdateBody and will be updated to AllRequestBodies if present in POST request + for i := range sources.createRequest { + // for now we do not differentiate AllRequestBodies vs PostBodyOnly as we are not processing update request + addOrUpdate(merged, &sources.createRequest[i], OmitInUpdateBody, false) + } + + // PATCH request body: optional/required is as defined, reqBodyUsage is defined as AllRequestBodies + for i := range sources.updateRequest { + addOrUpdate(merged, &sources.updateRequest[i], AllRequestBodies, false) + } + + // POST/GET response body: properties not in the request body are "computed" or "computed_optional" (if a default is present), reqBodyUsage will have OmitAll not present in request body + for i := range sources.createResponse { + addOrUpdate(merged, &sources.createResponse[i], OmitAlways, true) + } + + for i := range sources.readResponse { + addOrUpdate(merged, &sources.readResponse[i], OmitAlways, true) + } + + resourceAttributes := make(Attributes, 0, len(merged)) + for _, attr := range merged { + resourceAttributes = append(resourceAttributes, *attr) + } + + sortAttributes(resourceAttributes) + + updateNestedComputabilityAndReqBodyUsage(&resourceAttributes, false, false) + + return resourceAttributes +} + +// updateNestedComputabilityAndReqBodyUsage updates the computability and reqBodyUsage of nested attributes based on their parent attributes. +// If the parent is computed, all nested attributes are set to computed. +// If the parent is omitted in the request body, all nested attributes are set to omit all. +func updateNestedComputabilityAndReqBodyUsage(attrs *Attributes, parentIsComputed, parentIsOmittedInReqBody bool) { + for i := range *attrs { + attr := &(*attrs)[i] + + if parentIsComputed { + attr.ComputedOptionalRequired = Computed + } + if parentIsOmittedInReqBody { + attr.ReqBodyUsage = OmitAlways + } + + attrIsComputed := attr.ComputedOptionalRequired == Computed + attrIsOmittedInReqBody := attr.ReqBodyUsage == OmitAlways + + if attr.ListNested != nil { + updateNestedComputabilityAndReqBodyUsage(&attr.ListNested.NestedObject.Attributes, attrIsComputed, attrIsOmittedInReqBody) + } + if attr.SingleNested != nil { + updateNestedComputabilityAndReqBodyUsage(&attr.SingleNested.NestedObject.Attributes, attrIsComputed, attrIsOmittedInReqBody) + } + if attr.SetNested != nil { + updateNestedComputabilityAndReqBodyUsage(&attr.SetNested.NestedObject.Attributes, attrIsComputed, attrIsOmittedInReqBody) + } + if attr.MapNested != nil { + updateNestedComputabilityAndReqBodyUsage(&attr.MapNested.NestedObject.Attributes, attrIsComputed, attrIsOmittedInReqBody) + } + } +} + +func sortAttributes(attrs Attributes) { + sort.Slice(attrs, func(i, j int) bool { + return attrs[i].Name < attrs[j].Name + }) +} diff --git a/tools/codegen/codespec/model.go b/tools/codegen/codespec/model.go new file mode 100644 index 0000000000..bc06900dc0 --- /dev/null +++ b/tools/codegen/codespec/model.go @@ -0,0 +1,170 @@ +package codespec + +import ( + "github.com/mongodb/openapi/tools/codegen/stringcase" +) + +type ElemType int + +const ( + Bool ElemType = iota + Float64 + Int64 + Number + String + CustomTypeJSON + Unknown +) + +type Model struct { + Resources []Resource `yaml:"resources"` +} + +type Resource struct { + Name stringcase.SnakeCaseString `yaml:",omitempty"` + Operations APIOperations `yaml:"operations"` + Schema *Schema `yaml:"schema"` + OpenApiSchema any `yaml:"openapi-schema"` +} + +type APIOperations struct { + Create APIOperation `yaml:"create,omitempty"` + Read APIOperation `yaml:"read,omitempty"` + Update APIOperation `yaml:"update,omitempty"` + Delete APIOperation `yaml:"delete,omitempty"` + VersionHeader string +} + +type APIOperation struct { + Wait *Wait `yaml:"wait,omitempty"` + HTTPMethod string `yaml:"httpMethod,omitempty"` + Path string `yaml:"path,omitempty"` + StaticRequestBody string `yaml:"staticRequestBody,omitempty"` +} + +type Wait struct { + StateProperty string `yaml:"stateProperty,omitempty"` + PendingStates []string `yaml:"pendingStates,omitempty"` + TargetStates []string `yaml:"targetStates,omitempty"` + TimeoutSeconds int `yaml:"timeoutSeconds,omitempty"` + MinTimeoutSeconds int `yaml:"minTimeoutSeconds,omitempty"` + DelaySeconds int `yaml:"delaySeconds,omitempty"` +} + +type Schema struct { + Description *string `yaml:"description,omitempty"` + DeprecationMessage *string `yaml:"deprecationMessage,omitempty"` + + Attributes Attributes `yaml:"attributes,omitempty"` +} + +type Attributes []Attribute + +// Add this field to the Attribute struct +// Usage AttributeUsage +type Attribute struct { + Set *SetAttribute `yaml:"set,omitempty"` + String *StringAttribute `yaml:"string,omitempty"` + Float64 *Float64Attribute `yaml:"float64,omitempty"` + List *ListAttribute `yaml:"list,omitempty"` + Bool *BoolAttribute `yaml:"bool,omitempty"` + ListNested *ListNestedAttribute `yaml:"listNested,omitempty"` + Map *MapAttribute `yaml:"map,omitempty"` + MapNested *MapNestedAttribute `yaml:"mapNested,omitempty"` + Number *NumberAttribute `yaml:"number,omitempty"` + Int64 *Int64Attribute `yaml:"int64,omitempty"` + Timeouts *TimeoutsAttribute `yaml:"timeouts,omitempty"` + SingleNested *SingleNestedAttribute `yaml:"singleNested,omitempty"` + SetNested *SetNestedAttribute `yaml:"setNested,omitempty"` + Description *string `yaml:"description,omitempty"` + DeprecationMessage *string `yaml:"deprecationMessage,omitempty"` + CustomType *CustomType `yaml:"customType,omitempty"` + ComputedOptionalRequired ComputedOptionalRequired `yaml:"computedOptionalRequired,omitempty"` + Name stringcase.SnakeCaseString `yaml:",omitempty"` + ReqBodyUsage AttributeReqBodyUsage `yaml:"reqBodyUsage,omitempty"` + Sensitive bool `yaml:"sensitive,omitempty"` +} + +type AttributeReqBodyUsage int + +const ( + AllRequestBodies = iota // by default attribute is sent in request bodies + OmitInUpdateBody + IncludeNullOnUpdate // attributes that always must be sent in update request body even if null + OmitAlways // this covers computed-only attributes and attributes which are only used for path/query params +) + +type BoolAttribute struct { + Default *bool +} +type Float64Attribute struct { + Default *float64 +} +type Int64Attribute struct { + Default *int64 +} +type MapAttribute struct { + Default *CustomDefault + ElementType ElemType +} +type MapNestedAttribute struct { + Default *CustomDefault + NestedObject NestedAttributeObject +} +type NumberAttribute struct { + Default *CustomDefault +} +type SetAttribute struct { + Default *CustomDefault + ElementType ElemType +} +type SetNestedAttribute struct { + Default *CustomDefault + NestedObject NestedAttributeObject +} +type SingleNestedAttribute struct { + Default *CustomDefault + NestedObject NestedAttributeObject +} +type StringAttribute struct { + Default *string +} +type ListAttribute struct { + Default *CustomDefault + ElementType ElemType +} +type ListNestedAttribute struct { + Default *CustomDefault + NestedObject NestedAttributeObject +} +type NestedAttributeObject struct { + Attributes Attributes +} + +type TimeoutsAttribute struct { + ConfigurableTimeouts []Operation +} + +type Operation int + +const ( + Create Operation = iota + Update + Read + Delete +) + +type CustomDefault struct { + Definition string + Imports []string +} + +type CustomType struct { + Model string + Schema string +} + +var CustomTypeJSONVar = CustomType{ + Model: "jsontypes.Normalized", + Schema: "jsontypes.NormalizedType{}", +} diff --git a/tools/codegen/codespec/testdata/api-spec.yml b/tools/codegen/codespec/testdata/api-spec.yml new file mode 100644 index 0000000000..d2ec9999b7 --- /dev/null +++ b/tools/codegen/codespec/testdata/api-spec.yml @@ -0,0 +1,567 @@ +openapi: 3.0.1 +info: + description: "" + title: MongoDB Atlas Administration API + version: "2.0" +servers: + - url: https://cloud.mongodb.com +tags: + - description: Test Resource root description. + name: Test Resource +paths: + "/api/atlas/v2/groups/{groupId}/testResource": + delete: + description: DELETE API description + operationId: deleteTestResourceConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + security: + - DigestAuth: [] + summary: Disable the Test Resource feature for a project. + tags: + - Test Resource + get: + description: GET API description + operationId: getTestResourceConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TestResource" + x-xgen-version: 2023-01-01 + description: OK + security: + - DigestAuth: [] + summary: Get the Test Resource configuration for a project + tags: + - Test Resource + patch: + description: PATCH API description + operationId: updateTestResourceConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TestResourceRequest" + x-xgen-version: 2023-01-01 + description: Patch request description + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + security: + - DigestAuth: [] + summary: Update the Test Resource feature for a project + tags: + - Test Resource + post: + description: POST API description + operationId: createTestResourceConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TestResourceRequest" + x-xgen-version: 2023-01-01 + description: Create request description + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + security: + - DigestAuth: [] + summary: Enable the Test Resource feature for a project + tags: + - Test Resource + "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource": + delete: + description: DELETE API description + operationId: deleteNestedTestResource + parameters: + - $ref: "#/components/parameters/groupId" + - description: Path param test description + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: ^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$ + responses: + "204": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/NoBody" + x-xgen-version: 2024-05-30 + description: This endpoint does not return a response body. + security: + - DigestAuth: [] + summary: Delete Search Nodes + tags: + - Atlas Search + get: + description: GET API description + operationId: getNestedTestResource + parameters: + - $ref: "#/components/parameters/groupId" + - description: Path param test description + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: ^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$ + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/NestedTestResourceResponse" + x-xgen-version: 2024-05-30 + description: OK + security: + - DigestAuth: [] + summary: Return Search Nodes + tags: + - Atlas Search + patch: + description: PATCH API description + operationId: updateNestedTestResource + parameters: + - $ref: "#/components/parameters/groupId" + - description: Path param test description + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: ^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$ + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/NestedTestResourceRequest" + description: Updates the Search Nodes for the specified cluster. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/NestedTestResourceResponse" + x-xgen-version: 2024-05-30 + description: OK + security: + - DigestAuth: [] + summary: Update Search Nodes + tags: + - Atlas Search + post: + description: POST API description + operationId: createNestedTestResource + parameters: + - $ref: "#/components/parameters/groupId" + - description: Path param test description + in: path + name: clusterName + required: true + schema: + type: string + maxLength: 64 + minLength: 1 + pattern: ^([a-zA-Z0-9][a-zA-Z0-9-]*)?[a-zA-Z0-9]+$ + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/NestedTestResourceRequest" + description: Creates Search Nodes for the specified cluster. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/NestedTestResourceResponse" + x-xgen-version: 2024-05-30 + description: Created + security: + - DigestAuth: [] + summary: Create Nested Test Resource + tags: + - Atlas Search + "/api/atlas/v2/groups/{groupId}/pathparaminpostreq": + post: + description: POST API description + operationId: createTestResourceConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + type: object + required: + - specialParam + properties: + specialParam: + type: string + description: Path param test description + strReqAttr1: + type: string + description: Test field description + x-xgen-version: 2023-01-01 + description: Create request description + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + security: + - DigestAuth: [] + summary: Enable the Test Resource feature for a project + "/api/atlas/v2/groups/{groupId}/pathparaminpostreq/{specialParam}": + delete: + description: DELETE API description + operationId: deleteTestResourceConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/specialParam" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + security: + - DigestAuth: [] + summary: Disable the Test Resource feature for a project. + tags: + - Test Resource + get: + description: GET API description + operationId: getTestResourceConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/specialParam" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + type: object + properties: + strReqAttr1: + type: string + description: Test field description + x-xgen-version: 2023-01-01 + description: OK + security: + - DigestAuth: [] + summary: Get the Test Resource configuration for a project + tags: + - Test Resource + patch: + description: PATCH API description + operationId: updateTestResourceConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/specialParam" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + type: object + properties: + strReqAttr1: + type: string + description: Test field description + x-xgen-version: 2023-01-01 + description: Patch request description + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + type: object + properties: + strReqAttr1: + type: string + description: Test field description + x-xgen-version: 2023-01-01 + description: OK + security: + - DigestAuth: [] + summary: Update the Test Resource feature for a project + tags: + - Test Resource +components: + parameters: + groupId: + description: >- + Path param test description + in: path + name: groupId + required: true + schema: + type: string + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + specialParam: + description: Path param test description + in: path + name: specialParam + required: true + schema: + type: string + description: Path param test description + responses: + accepted: + description: Accepted. + schemas: + TestResourceRequest: + type: object + properties: + strReqAttr1: + type: string + description: Test field description + strReqAttr2: + type: string + description: Test field description + strReqAttr3: + type: string + description: Test field description + boolDefaultAttr: + type: boolean + default: false + count: + type: integer + format: int32 + description: Test field description + numDoubleDefaultAttr: + type: number + format: double + default: 2.0 + required: + - strReqAttr1 + - strReqAttr2 + - strReqAttr3 + TestResource: + type: object + properties: + strReqAttr1: + type: string + description: Test field description + createDate: + type: string + format: date-time + description: Test field description + readOnly: true + strReqAttr2: + type: string + description: Test field description + strReqAttr3: + type: string + description: Test field description + strComputedAttr: + type: string + description: Test field description + readOnly: true + boolDefaultAttr: + type: boolean + default: false + count: + type: integer + format: int32 + description: Test field description + numDoubleDefaultAttr: + type: number + format: double + default: 2.0 + NestedTestResourceResponse: + type: object + properties: + groupId: + type: string + description: Path param test description + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + readOnly: true + nestedListArrayAttr: + type: array + description: Test field description + items: + type: object + properties: + innerNumAttr: + type: integer + format: int32 + description: Test field description + example: 2 + maximum: 32 + minimum: 2 + listPrimitiveStringAttr: + type: array + description: Test field description + items: + type: string + listPrimitiveStringComputedAttr: + type: array + description: Test field description + items: + type: string + required: + - innerNumAttr + readOnly: true + nestedSetArrayAttr: + type: array + description: Test field description + items: + $ref: "#/components/schemas/NestedObjectAttr" + readOnly: true + uniqueItems: true + outerObject: + $ref: "#/components/schemas/OuterObject" + setPrimitiveStringAttr: + type: array + description: Test field description + items: + type: string + uniqueItems: true + listPrimitiveStringAttr: + type: array + description: Test field description + items: + type: string + singleNestedAttrWithNestedMaps: + $ref: "#/components/schemas/SingleNestedAttrWithNestedMaps" + singleNestedAttr: + $ref: "#/components/schemas/SingleNestedAttr" + nestedMapObjectAttr: + $ref: "#/components/schemas/NestedMapObjectAttr" + optional_string_attr: + type: string + description: Optional string + attrAlwaysInUpdates: + type: string + description: Always in updates + SingleNestedAttrWithNestedMaps: + type: object + description: Test field description + properties: + mapAttr1: + type: object + additionalProperties: + type: string + readOnly: true + readOnly: true + mapAttr2: + type: object + additionalProperties: + type: string + readOnly: true + readOnly: true + readOnly: true + title: Outbound Control Plane IP Addresses By Cloud Provider + SingleNestedAttr: + type: object + description: Test field description + properties: + innerIntAttr: + type: integer + description: Test field description + innerStrAttr: + $ref: "#/components/schemas/SimpleStringRefObject" + required: + - innerIntAttr + - innerStrAttr + NestedObjectAttr: + type: object + properties: + innerNumAttr: + type: integer + format: int32 + description: Test field description + example: 2 + maximum: 32 + minimum: 2 + listPrimitiveStringAttr: + type: array + description: Test field description + items: + type: string + required: + - innerNumAttr + NestedTestResourceRequest: + type: object + properties: + nestedListArrayAttr: + type: array + description: Test field description + items: + $ref: "#/components/schemas/NestedObjectAttr" + maxItems: 1 + minItems: 1 + optional_string_attr: + type: string + description: Optional string + attrAlwaysInUpdates: + type: string + description: Always in updates + required: + - nestedListArrayAttr + SimpleStringRefObject: + type: string + description: Test field description + NoBody: + type: object + description: Endpoint does not return a response body. + NestedMapObjectAttr: + type: object + additionalProperties: + type: object + properties: + attr: + type: string + OuterObject: + type: object + properties: + nestedLevel1: + $ref: "#/components/schemas/NestedLevel1Object" + NestedLevel1Object: + type: object + properties: + levelField1: + type: string diff --git a/tools/codegen/codespec/testdata/config-nested-schema-overrides.yml b/tools/codegen/codespec/testdata/config-nested-schema-overrides.yml new file mode 100644 index 0000000000..635503a5d6 --- /dev/null +++ b/tools/codegen/codespec/testdata/config-nested-schema-overrides.yml @@ -0,0 +1,46 @@ +resources: + test_resource_with_nested_attr_overrides: + read: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource + method: POST + update: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource + method: DELETE + version_header: application/vnd.atlas.2035-01-01+json + schema: + aliases: + group_id: project_id + nested_list_array_attr.inner_num_attr: inner_num_attr_alias + outer_object.nested_level1.level_field1: level_field1_alias + + ignores: + [ + "nested_list_array_attr.list_primitive_string_attr", + "cluster_name", + "list_primitive_string_attr", + "nested_map_object_attr", + "nested_set_array_attr", + "set_primitive_string_attr", + "single_nested_attr", + "single_nested_attr_with_nested_maps", + ] + + overrides: + nested_list_array_attr.inner_num_attr_alias: + description: "Overridden inner_num_attr_alias description" + outer_object.nested_level1.level_field1_alias: + description: "Overridden level_field1_alias description" + optional_string_attr: + computability: + optional: true + computed: true + description: "Optional string that has config override to optional/computed" + attr_always_in_updates: + include_null_on_update: true + timeouts: ["create", "read", "update", "delete"] diff --git a/tools/codegen/codespec/testdata/config.yml b/tools/codegen/codespec/testdata/config.yml new file mode 100644 index 0000000000..1e50e86eb4 --- /dev/null +++ b/tools/codegen/codespec/testdata/config.yml @@ -0,0 +1,44 @@ +resources: + test_resource_no_schema_opts: + read: + path: /api/atlas/v2/groups/{groupId}/testResource + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/testResource + method: POST + update: + path: /api/atlas/v2/groups/{groupId}/testResource + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId}/testResource + method: DELETE + + test_resource_with_nested_attr: + read: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource + method: POST + update: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/nestedTestResource + method: DELETE + schema: + ignores: ["outer_object"] + + test_resource_path_param_in_post_req: + create: + path: /api/atlas/v2/groups/{groupId}/pathparaminpostreq + method: POST + read: + path: /api/atlas/v2/groups/{groupId}/pathparaminpostreq/{specialParam} + method: GET + update: + path: /api/atlas/v2/groups/{groupId}/pathparaminpostreq/{specialParam} + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId}/pathparaminpostreq/{specialParam} + method: DELETE diff --git a/tools/codegen/config.yml b/tools/codegen/config.yml new file mode 100644 index 0000000000..57b610bd1a --- /dev/null +++ b/tools/codegen/config.yml @@ -0,0 +1,446 @@ +resources: + # Singleton resource in project. + # Create, Delete and Update uses PATCH. + auditing_api: + read: + path: /api/atlas/v2/groups/{groupId}/auditLog + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/auditLog + method: PATCH + update: + path: /api/atlas/v2/groups/{groupId}/auditLog + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId}/auditLog + method: PATCH + static_request_body: '{"enabled": "false"}' + version_header: application/vnd.atlas.2023-01-01+json + + cluster_api: + read: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/clusters + method: POST + wait: &cluster-create-wait + state_property: "stateName" + pending_states: + [ + "CREATING", + "UPDATING", + "REPAIRING", + "REPEATING", + "PENDING", + "DELETING", + ] + target_states: ["IDLE"] + timeout_seconds: 10800 # 3 hours + min_timeout_seconds: 60 + delay_seconds: 30 + update: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: PATCH + wait: *cluster-create-wait + delete: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName} + method: DELETE + wait: + <<: *cluster-create-wait + pending_states: + [ + "IDLE", + "CREATING", + "UPDATING", + "REPAIRING", + "REPEATING", + "PENDING", + "DELETING", + ] + target_states: ["DELETED"] # DELETED is a special state value when API returns 404 or empty object + version_header: application/vnd.atlas.2024-08-05+json + schema: + ignores: ["links", "mongo_dbemployee_access_grant.links"] + aliases: + cluster_name: name # path param name does not match the API request property + # These attributes are optional but when not configured, Atlas returns a default value. + # If a nested attribute is optional/computed, all its optional child attributes must also be defined as optional/computed to avoid non-empty plans. + overrides: + advanced_configuration: + computability: + optional: true + computed: true + advanced_configuration.custom_openssl_cipher_config_tls12: + computability: + optional: true + computed: true + advanced_configuration.minimum_enabled_tls_protocol: + computability: + optional: true + computed: true + advanced_configuration.tls_cipher_config_mode: + computability: + optional: true + computed: true + bi_connector: + computability: + optional: true + computed: true + bi_connector.enabled: + computability: + optional: true + computed: true + bi_connector.read_preference: + computability: + optional: true + computed: true + disk_iops: + computability: + optional: true + computed: true + disk_size_gb: + computability: + optional: true + computed: true + encryption_at_rest_provider: + computability: + optional: true + computed: true + global_cluster_self_managed_sharding: + computability: + optional: true + computed: true + paused: + computability: + optional: true + computed: true + pit_enabled: + computability: + optional: true + computed: true + redact_client_log_data: + computability: + optional: true + computed: true + replication_specs.region_configs.analytics_specs: + computability: + optional: true + computed: true + replication_specs.region_configs.analytics_specs.disk_iops: + computability: + optional: true + computed: true + replication_specs.region_configs.analytics_specs.disk_size_gb: + computability: + optional: true + computed: true + replication_specs.region_configs.analytics_specs.instance_size: + computability: + optional: true + computed: true + replication_specs.region_configs.analytics_specs.node_count: + computability: + optional: true + computed: true + replication_specs.region_configs.auto_scaling: + computability: + optional: true + computed: true + replication_specs.region_configs.auto_scaling.compute: + computability: + optional: true + computed: true + replication_specs.region_configs.auto_scaling.compute.enabled: + computability: + optional: true + computed: true + replication_specs.region_configs.auto_scaling.compute.max_instance_size: + computability: + optional: true + computed: true + replication_specs.region_configs.auto_scaling.compute.min_instance_size: + computability: + optional: true + computed: true + replication_specs.region_configs.auto_scaling.compute.predictive_enabled: + computability: + optional: true + computed: true + replication_specs.region_configs.auto_scaling.compute.scale_down_enabled: + computability: + optional: true + computed: true + replication_specs.region_configs.auto_scaling.disk_gb: + computability: + optional: true + computed: true + replication_specs.region_configs.auto_scaling.disk_gb.enabled: + computability: + optional: true + computed: true + replication_specs.region_configs.electable_specs.disk_iops: + computability: + optional: true + computed: true + replication_specs.region_configs.electable_specs.disk_size_gb: + computability: + optional: true + computed: true + replication_specs.region_configs.read_only_specs: + computability: + optional: true + computed: true + replication_specs.region_configs.read_only_specs.disk_iops: + computability: + optional: true + computed: true + replication_specs.region_configs.read_only_specs.disk_size_gb: + computability: + optional: true + computed: true + replication_specs.region_configs.read_only_specs.instance_size: + computability: + optional: true + computed: true + replication_specs.region_configs.read_only_specs.node_count: + computability: + optional: true + computed: true + replication_specs.zone_name: + computability: + optional: true + computed: true + + custom_db_role_api: + read: + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles + method: POST + update: + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + method: DELETE + version_header: application/vnd.atlas.2023-01-01+json + + database_user_api: + read: + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/databaseUsers + method: POST + update: + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} + method: DELETE + version_header: application/vnd.atlas.2023-01-01+json + schema: + ignores: ["links"] + overrides: + password: + sensitive: true + description: + include_null_on_update: true + + # Singleton resource in project. + # Create uses PATCH. + maintenance_window_api: + read: + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + method: PATCH + update: + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + method: DELETE + version_header: application/vnd.atlas.2023-01-01+json + schema: + overrides: + hour_of_day: # hour_of_day should be Required in API spec, getting this error if not set: ATLAS_INVALID_MAINTENANCE_WINDOW_HOUR_OF_DAY. + computability: + required: true + auto_defer_once_enabled: # optional but when not configured, Atlas returns a default value. + computability: + optional: true + computed: true + + project_api: + read: + path: /api/atlas/v2/groups/{groupId} + method: GET + create: + path: /api/atlas/v2/groups + method: POST + update: + path: /api/atlas/v2/groups/{groupId} + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId} + method: DELETE + version_header: application/vnd.atlas.2023-01-01+json + schema: + ignores: ["links"] + aliases: + group_id: id # path param name does not match the API response property + + push_based_log_export_api: + read: + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + method: POST + wait: &pble-create-wait + state_property: "state" + pending_states: ["INITIATING", "BUCKET_VERIFIED"] + target_states: ["ACTIVE"] + timeout_seconds: 900 # 15 minutes + min_timeout_seconds: 60 + delay_seconds: 10 + update: + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + method: PATCH + wait: *pble-create-wait + delete: + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + method: DELETE + wait: + <<: *pble-create-wait + pending_states: ["ACTIVE", "INITIATING", "BUCKET_VERIFIED"] + target_states: ["UNCONFIGURED", "DELETED"] # DELETED is a special state value when API returns 404 or empty object + version_header: application/vnd.atlas.2023-01-01+json + schema: + ignores: ["links"] + + resource_policy_api: + read: + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId} + method: GET + create: + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies + method: POST + update: + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId} + method: PATCH + delete: + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId} + method: DELETE + version_header: application/vnd.atlas.2024-08-05+json + schema: + aliases: + resource_policy_id: id # path param name does not match the API response property + + search_deployment_api: + read: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + method: POST + wait: &search-deployment-create-wait + state_property: "stateName" + pending_states: ["UPDATING", "PAUSED"] + target_states: ["IDLE"] + timeout_seconds: 10800 # 3 hours + min_timeout_seconds: 60 + delay_seconds: 60 + update: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + method: PATCH + wait: *search-deployment-create-wait + delete: + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + method: DELETE + wait: + <<: *search-deployment-create-wait + min_timeout_seconds: 30 + pending_states: ["IDLE", "UPDATING", "PAUSED"] + target_states: ["DELETED"] # DELETED is a special state value when API returns 404 or empty object + version_header: application/vnd.atlas.2025-03-12+json + + # Update doesn't work because API defines incorrectly region and cloud_provider at root level in PATCH instead of inside data_process_region as in the other endpoints. + # id should be Computed but is ignored because it's defined as _id which is not a legal name for a Terraform attribute as they can't start with an underscore. + stream_instance_api: + read: + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName} + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/streams + method: POST + update: + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName} + method: PATCH + delete: + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName} + method: DELETE + version_header: application/vnd.atlas.2023-02-01+json + schema: + # region and cloud_provider are incorrectly declared in PATCH as root attributes, _id can't be used in Terraform schema + ignores: + [ + "_id", + "region", + "cloud_provider", + "links", + "connections.links", + "connections.authentication.links", + "connections.aws.links", + "connections.db_role_to_execute.links", + "connections.networking.links", + "connections.networking.access.links", + "connections.security.links", + "data_process_region.links", + "sample_connections.links", + "stream_config.links", + ] + aliases: + tenant_name: name # path param name does not match the API request property + + # id should be Computed but is ignored because it's defined as _id which is not a legal name for a Terraform attribute as they can't start with an underscore. + # Custom methods :startWith and :stop are not called so state attribute is not supported as Optional like in the curated resource, only as Computed. + stream_processor_api: + read: + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName} + method: GET + create: + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor + method: POST + wait: &stream-processor-create-wait + state_property: "state" + pending_states: ["INIT", "CREATING"] + target_states: ["CREATED"] + timeout_seconds: 300 # 5 minutes + min_timeout_seconds: 10 + delay_seconds: 10 + update: + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName} + method: PATCH + wait: *stream-processor-create-wait + delete: + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName} + method: DELETE + wait: + <<: *stream-processor-create-wait + pending_states: ["INIT", "CREATING", "CREATED", "STARTED", "STOPPED"] + target_states: ["DELETED"] # DELETED is a special state value when API returns 404 or empty object + version_header: application/vnd.atlas.2024-05-30+json + schema: + ignores: ["links", "options.links", "options.dlq.links", "_id"] + aliases: + processor_name: name # path param name does not match the API request property. + overrides: + options: # optional but when not configured, Atlas returns a default value. + computability: + optional: true + computed: true diff --git a/tools/codegen/config/config_model.go b/tools/codegen/config/config_model.go new file mode 100644 index 0000000000..071c96ac95 --- /dev/null +++ b/tools/codegen/config/config_model.go @@ -0,0 +1,62 @@ +package config + +type Config struct { + Resources map[string]Resource `yaml:"resources"` +} + +type Resource struct { + Create *APIOperation `yaml:"create"` + Read *APIOperation `yaml:"read"` + Update *APIOperation `yaml:"update"` + Delete *APIOperation `yaml:"delete"` + VersionHeader string `yaml:"version_header"` // when not defined latest version defined in API Spec of the resource is used + SchemaOptions SchemaOptions `yaml:"schema"` +} + +type APIOperation struct { + Wait *Wait `yaml:"wait"` + Path string `yaml:"path"` + Method string `yaml:"method"` + StaticRequestBody string `yaml:"static_request_body"` // use at the moment for Delete when it's done with a PATCH or PUT and needs to send a static request body. +} + +type Wait struct { + StateProperty string `yaml:"state_property"` // defined in camel case as found in API response body, e.g. "stateName" + PendingStates []string `yaml:"pending_states"` + TargetStates []string `yaml:"target_states"` + TimeoutSeconds int `yaml:"timeout_seconds"` + MinTimeoutSeconds int `yaml:"min_timeout_seconds"` + DelaySeconds int `yaml:"delay_seconds"` +} + +type SchemaOptions struct { + Ignores []string `yaml:"ignores"` + Aliases map[string]string `yaml:"aliases"` // only supports modifying path param names, full alias support is not yet implemented in conversion logic for request/response bodies + Overrides map[string]Override `yaml:"overrides"` + Timeouts []string `yaml:"timeouts"` +} + +type Override struct { + Computability *Computability `yaml:"computability,omitempty"` + Sensitive *bool `yaml:"sensitive"` + IncludeNullOnUpdate *bool `yaml:"include_null_on_update"` + Description string `yaml:"description"` + PlanModifiers []PlanModifier `yaml:"plan_modifiers"` + Validators []Validator `yaml:"validators"` +} + +type PlanModifier struct { + Definition string `yaml:"definition"` + Imports []string `yaml:"imports"` +} + +type Validator struct { + Definition string `yaml:"definition"` + Imports []string `yaml:"imports"` +} + +type Computability struct { + Optional bool `yaml:"optional"` + Computed bool `yaml:"computed"` + Required bool `yaml:"required"` +} diff --git a/tools/codegen/config/parser.go b/tools/codegen/config/parser.go new file mode 100644 index 0000000000..73495b10f9 --- /dev/null +++ b/tools/codegen/config/parser.go @@ -0,0 +1,22 @@ +package config + +import ( + "os" + + "gopkg.in/yaml.v3" +) + +func ParseGenConfigYAML(path string) (*Config, error) { + data, err := os.ReadFile(path) + if err != nil { + return nil, err + } + + var config Config + err = yaml.Unmarshal(data, &config) + if err != nil { + return nil, err + } + + return &config, nil +} diff --git a/tools/codegen/go.mod b/tools/codegen/go.mod new file mode 100644 index 0000000000..a7c6e81929 --- /dev/null +++ b/tools/codegen/go.mod @@ -0,0 +1,31 @@ +module github.com/mongodb/openapi/tools/codegen + +go 1.24.0 + +require ( + github.com/getkin/kin-openapi v0.132.0 + github.com/huandu/xstrings v1.5.0 + github.com/oasdiff/oasdiff v1.11.4 + github.com/pb33f/libopenapi v0.23.0 + github.com/stretchr/testify v1.10.0 + gopkg.in/yaml.v3 v3.0.1 +) + +require ( + github.com/bahlo/generic-list-go v0.2.0 // indirect + github.com/buger/jsonparser v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/go-openapi/jsonpointer v0.21.0 // indirect + github.com/go-openapi/swag v0.23.0 // indirect + github.com/go-test/deep v1.1.1 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/mailru/easyjson v0.9.0 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 // indirect + github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/speakeasy-api/jsonpath v0.6.2 // indirect + github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240815153524-6ea36470d1bd // indirect + github.com/yargevad/filepathx v1.0.0 // indirect +) diff --git a/tools/codegen/go.sum b/tools/codegen/go.sum new file mode 100644 index 0000000000..2595b93ad7 --- /dev/null +++ b/tools/codegen/go.sum @@ -0,0 +1,55 @@ +github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= +github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/getkin/kin-openapi v0.132.0 h1:3ISeLMsQzcb5v26yeJrBcdTCEQTag36ZjaGk7MIRUwk= +github.com/getkin/kin-openapi v0.132.0/go.mod h1:3OlG51PCYNsPByuiMB0t4fjnNlIDnaEDsjiKUV8nL58= +github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= +github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= +github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= +github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= +github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= +github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= +github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= +github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/oasdiff/oasdiff v1.11.4 h1:FgThY78WNwOhWCLIhMk7AsKoHpVZZggRpKEGfd+IOIs= +github.com/oasdiff/oasdiff v1.11.4/go.mod h1:+bDxqI7wMl30OJ97hBfHR5loUsKCctk9UZOujHl8Gtk= +github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY= +github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw= +github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c= +github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90/go.mod h1:y5+oSEHCPT/DGrS++Wc/479ERge0zTFxaF8PbGKcg2o= +github.com/pb33f/libopenapi v0.23.0 h1:gZP1zrtvMwk7spGDTZf4OufKgpOH8M9gHAZ77rf39Oo= +github.com/pb33f/libopenapi v0.23.0/go.mod h1:utT5sD2/mnN7YK68FfZT5yEPbI1wwRBpSS4Hi0oOrBU= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/speakeasy-api/jsonpath v0.6.2 h1:Mys71yd6u8kuowNCR0gCVPlVAHCmKtoGXYoAtcEbqXQ= +github.com/speakeasy-api/jsonpath v0.6.2/go.mod h1:ymb2iSkyOycmzKwbEAYPJV/yi2rSmvBCLZJcyD+VVWw= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240815153524-6ea36470d1bd h1:dLuIF2kX9c+KknGJUdJi1Il1SDiTSK158/BB9kdgAew= +github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240815153524-6ea36470d1bd/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= +github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc= +github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/codegen/main.go b/tools/codegen/main.go new file mode 100644 index 0000000000..3863dd9577 --- /dev/null +++ b/tools/codegen/main.go @@ -0,0 +1,76 @@ +package main + +import ( + "fmt" + "gopkg.in/yaml.v3" + "log" + "os" + "os/exec" + "path/filepath" + + "github.com/mongodb/openapi/tools/codegen/codespec" + "github.com/mongodb/openapi/tools/codegen/openapi" +) + +const ( + atlasAdminAPISpecURL = "https://raw.githubusercontent.com/mongodb/atlas-sdk-go/main/openapi/atlas-api-transformed.yaml" + configPath = "config.yml" + specFilePath = "open-api-spec.yml" +) + +func main() { + resourceName := getOsArg() + + if err := openapi.DownloadOpenAPISpec(atlasAdminAPISpecURL, specFilePath); err != nil { + log.Fatalf("an error occurred when downloading Atlas Admin API spec: %v", err) + } + + model, err := codespec.ToCodeSpecModel(specFilePath, configPath, resourceName) + if err != nil { + log.Fatalf("an error occurred while generating codespec.Model: %v", err) + } + + file, err := yaml.Marshal(model) + if err != nil { + log.Fatalf("an error occurred while marshalling model: %v", err) + } + err = os.WriteFile("codegen.yaml", file, 0o600) +} + +func getOsArg() *string { + if len(os.Args) < 2 { + return nil + } + return &os.Args[1] +} + +func writeToFile(fileName, content string) error { + // read/write/execute for owner, and read/execute for group and others + const filePermission = 0o755 + + // Create directories if they don't exist + dir := filepath.Dir(fileName) + dirPermission := os.FileMode(filePermission) + if err := os.MkdirAll(dir, dirPermission); err != nil { + return fmt.Errorf("failed to create directory %s: %w", dir, err) + } + + // Write content to file (will override content if file exists) + if err := os.WriteFile(fileName, []byte(content), filePermission); err != nil { + return fmt.Errorf("failed to write to file %s: %w", fileName, err) + } + return nil +} + +// formatGoFile runs goimports and fieldalignment on the specified Go file +func formatGoFile(filePath string) { + goimportsCmd := exec.Command("goimports", "-w", filePath) + if output, err := goimportsCmd.CombinedOutput(); err != nil { + log.Printf("warning: goimports failed for %s: %v\nOutput: %s", filePath, err, output) + } + + fieldalignmentCmd := exec.Command("fieldalignment", "-fix", filePath) + if output, err := fieldalignmentCmd.CombinedOutput(); err != nil { + log.Printf("warning: fieldalignment failed for %s: %v\nOutput: %s", filePath, err, output) + } +} diff --git a/tools/codegen/open-api-spec.yml b/tools/codegen/open-api-spec.yml new file mode 100644 index 0000000000..71995f91c7 --- /dev/null +++ b/tools/codegen/open-api-spec.yml @@ -0,0 +1,55820 @@ +components: + parameters: + collectionName: + description: Human-readable label that identifies the collection. + in: path + name: collectionName + required: true + schema: + example: mycoll + type: string + databaseName: + description: Human-readable label that identifies the database. + in: path + name: databaseName + required: true + schema: + example: mydb + type: string + end: + description: Date and time when MongoDB Cloud stops reporting the metrics. This parameter expresses its value in the ISO 8601 timestamp format in UTC. Include this parameter when you do not set **period**. + in: query + name: end + schema: + format: date-time + type: string + envelope: + description: Flag that indicates whether Application wraps the response in an `envelope` JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body. + in: query + name: envelope + schema: + default: false + type: boolean + federationSettingsId: + description: Unique 24-hexadecimal digit string that identifies your federation. + in: path + name: federationSettingsId + required: true + schema: + example: 55fa922fb343282757d9554e + pattern: ^([a-f0-9]{24})$ + type: string + granularity: + description: Duration that specifies the interval at which Atlas reports the metrics. This parameter expresses its value in the ISO 8601 duration format in UTC. + in: query + name: granularity + required: true + schema: + example: PT1M + type: string + groupId: + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + in: path + name: groupId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + identityProviderId: + description: Legacy 20-hexadecimal digit string that identifies the identity provider. This id can be found within the Federation Management Console > Identity Providers tab by clicking the info icon in the IdP ID row of a configured identity provider. + in: path + name: identityProviderId + required: true + schema: + example: c2777a9eca931f29fc2f + pattern: ^([a-f0-9]{20})$ + type: string + includeCount: + description: Flag that indicates whether the response returns the total number of items (**totalCount**) in the response. + in: query + name: includeCount + schema: + default: true + type: boolean + indexName: + description: Human-readable label that identifies the index. + in: path + name: indexName + required: true + schema: + example: myindex + type: string + itemsPerPage: + description: Number of items that the response returns per page. + in: query + name: itemsPerPage + schema: + default: 100 + maximum: 500 + minimum: 1 + type: integer + liveMigrationId: + description: Unique 24-hexadecimal digit string that identifies the migration. + in: path + name: liveMigrationId + required: true + schema: + example: 6296fb4c7c7aa997cf94e9a8 + pattern: ^([a-f0-9]{24})$ + type: string + orgId: + description: Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + in: path + name: orgId + required: true + schema: + example: 4888442a3354817a7320eb61 + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + pageNum: + description: Number of the page that displays the current set of the total objects that the response returns. + in: query + name: pageNum + schema: + default: 1 + minimum: 1 + type: integer + period: + description: Duration over which Atlas reports the metrics. This parameter expresses its value in the ISO 8601 duration format in UTC. Include this parameter when you do not set **start** and **end**. + in: query + name: period + schema: + example: PT10H + type: string + pretty: + description: Flag that indicates whether the response body should be in the prettyprint format. + in: query + name: pretty + schema: + default: false + externalDocs: + description: Prettyprint + url: https://en.wikipedia.org/wiki/Prettyprint + type: boolean + processId: + description: Combination of hostname and IANA port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (mongod or mongos). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + example: my.host.name.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + start: + description: Date and time when MongoDB Cloud begins reporting the metrics. This parameter expresses its value in the ISO 8601 timestamp format in UTC. Include this parameter when you do not set **period**. + in: query + name: start + schema: + format: date-time + type: string + responses: + accepted: + description: Accepted. + badRequest: + content: + application/json: + example: + detail: (This is just an example, the exception may not be related to this endpoint) No provider AWS exists. + error: 400 + errorCode: VALIDATION_ERROR + reason: Bad Request + schema: + $ref: "#/components/schemas/ApiError" + description: Bad Request. + conflict: + content: + application/json: + example: + detail: "(This is just an example, the exception may not be related to this endpoint) Cannot delete organization link while there is active migration in following project ids: 60c4fd418ebe251047c50554" + error: 409 + errorCode: CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK + reason: Conflict + schema: + $ref: "#/components/schemas/ApiError" + description: Conflict. + forbidden: + content: + application/json: + example: + detail: (This is just an example, the exception may not be related to this endpoint) + error: 403 + errorCode: CANNOT_CHANGE_GROUP_NAME + reason: Forbidden + schema: + $ref: "#/components/schemas/ApiError" + description: Forbidden. + gone: + content: + application/json: + example: + detail: This happens when a resource is marked for sunset and the sunset date is in the past. + error: 410 + errorCode: VERSION_GONE + reason: Gone + schema: + $ref: "#/components/schemas/ApiError" + description: Gone. + internalServerError: + content: + application/json: + example: + detail: (This is just an example, the exception may not be related to this endpoint) + error: 500 + errorCode: UNEXPECTED_ERROR + reason: Internal Server Error + schema: + $ref: "#/components/schemas/ApiError" + description: Internal Server Error. + methodNotAllowed: + content: + application/json: + example: + detail: (This is just an example, the exception may not be related to this endpoint) + error: 405 + errorCode: ATLAS_BACKUP_CANCEL_SHARD_RESTORE_JOB_NOT_ALLOWED + reason: Method Not Allowed + schema: + $ref: "#/components/schemas/ApiError" + description: Method Not Allowed. + noBody: + description: This endpoint does not return a response body. + notFound: + content: + application/json: + example: + detail: (This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS + error: 404 + errorCode: RESOURCE_NOT_FOUND + reason: Not Found + schema: + $ref: "#/components/schemas/ApiError" + description: Not Found. + paymentRequired: + content: + application/json: + example: + detail: (This is just an example, the exception may not be related to this endpoint) + error: 402 + errorCode: NO_PAYMENT_INFORMATION_FOUND + reason: Payment Required + schema: + $ref: "#/components/schemas/ApiError" + description: Payment Required. + tooManyRequests: + content: + application/json: + example: + detail: (This is just an example, the exception may not be related to this endpoint) + error: 429 + errorCode: RATE_LIMITED + reason: Too Many Requests + schema: + $ref: "#/components/schemas/ApiError" + description: Too Many Requests. + unauthorized: + content: + application/json: + example: + detail: (This is just an example, the exception may not be related to this endpoint) + error: 401 + errorCode: NOT_ORG_GROUP_CREATOR + reason: Unauthorized + schema: + $ref: "#/components/schemas/ApiError" + description: Unauthorized. + schemas: + AWSKMSConfiguration: + description: Amazon Web Services (AWS) KMS configuration details and encryption at rest configuration set for the specified project. + externalDocs: + description: Amazon Web Services Key Management Service + url: https://www.mongodb.com/docs/atlas/security-aws-kms/ + properties: + accessKeyID: + description: Unique alphanumeric string that identifies an Identity and Access Management (IAM) access key with permissions required to access your Amazon Web Services (AWS) Customer Master Key (CMK). + example: 019dd98d94b4bb778e7552e4 + maxLength: 128 + minLength: 16 + type: string + customerMasterKeyID: + description: Unique alphanumeric string that identifies the Amazon Web Services (AWS) Customer Master Key (CMK) you used to encrypt and decrypt the MongoDB master keys. + maxLength: 2048 + minLength: 1 + type: string + enabled: + description: Flag that indicates whether someone enabled encryption at rest for the specified project through Amazon Web Services (AWS) Key Management Service (KMS). To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of `false`. + type: boolean + region: + description: Physical location where MongoDB Cloud deploys your AWS-hosted MongoDB cluster nodes. The region you choose can affect network latency for clients accessing your databases. When MongoDB Cloud deploys a dedicated cluster, it checks if a VPC or VPC connection exists for that provider and region. If not, MongoDB Cloud creates them as part of the deployment. MongoDB Cloud assigns the VPC a CIDR block. To limit a new VPC peering connection to one CIDR block and region, create the connection first. Deploy the cluster after the connection starts. + title: AWS Regions + type: string + requirePrivateNetworking: + description: Enable connection to your Amazon Web Services (AWS) Key Management Service (KMS) over private networking. + type: boolean + roleId: + description: Unique 24-hexadecimal digit string that identifies an Amazon Web Services (AWS) Identity and Access Management (IAM) role. This IAM role has the permissions required to manage your AWS customer master key. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + secretAccessKey: + description: Human-readable label of the Identity and Access Management (IAM) secret access key with permissions required to access your Amazon Web Services (AWS) customer master key. + type: string + writeOnly: true + valid: + description: Flag that indicates whether the Amazon Web Services (AWS) Key Management Service (KMS) encryption key can encrypt and decrypt data. + readOnly: true + type: boolean + type: object + AccountDetails: + description: Account details for the group, region, and provider. + type: object + properties: + awsAccountId: + description: The AWS Account ID. + type: string + cidrBlock: + description: The VPC CIDR Block. + type: string + cloudProvider: + description: Cloud provider. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + vpcId: + description: The VPC ID. + type: string + azureSubscriptionId: + description: The Azure Subscription ID. + type: string + virtualNetworkName: + description: The name of the virtual network. + type: string + AcknowledgeAlert: + description: Acknowledging an alert prevents successive notifications. Specify the acknowledgeUntil date and optional comment or unacknowledgeAlert boolean. + properties: + acknowledgedUntil: + description: Date and time until which this alert has been acknowledged. This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter if a MongoDB User previously acknowledged this alert. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + type: string + acknowledgementComment: + description: Comment that a MongoDB Cloud user submitted when acknowledging the alert. + example: Expiration on 3/19. Silencing for 7days. + maxLength: 200 + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + unacknowledgeAlert: + description: Flag that indicates to unacknowledge a previously acknowledged alert. By default this value is set to false. If set to true, it will override the acknowledgedUntil parameter. + type: boolean + title: Acknowledge Alert + type: object + AddOrRemoveGroupRole: + properties: + groupRole: + description: Project-level role. + type: string + required: + - groupRole + type: object + AddOrRemoveOrgRole: + properties: + orgRole: + description: Organization-level role. + type: string + required: + - orgRole + type: object + AddOrRemoveUserFromTeam: + properties: + id: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + required: + - id + type: object + AddUserToTeam: + properties: + id: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + required: + - id + type: object + AdvancedAutoScalingSettings: + description: Options that determine how this cluster handles resource scaling. + properties: + compute: + $ref: "#/components/schemas/AdvancedComputeAutoScaling" + diskGB: + $ref: "#/components/schemas/DiskGBAutoScaling" + title: Automatic Scaling Settings + type: object + AdvancedComputeAutoScaling: + description: Options that determine how this cluster handles CPU scaling. + properties: + enabled: + description: |- + Flag that indicates whether instance size reactive auto-scaling is enabled. + + - Set to `true` to enable instance size reactive auto-scaling. If enabled, you must specify a value for **replicationSpecs[n].regionConfigs[m].autoScaling.compute.maxInstanceSize**. + - Set to `false` to disable instance size reactive auto-scaling. + type: boolean + maxInstanceSize: + $ref: "#/components/schemas/BaseCloudProviderInstanceSize" + minInstanceSize: + $ref: "#/components/schemas/BaseCloudProviderInstanceSize" + predictiveEnabled: + description: |- + Flag that indicates whether predictive instance size auto-scaling is enabled. + + - Set to `true` to enable predictive instance size auto-scaling. MongoDB Cloud requires **replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled** to be `true` in order to enable this feature. + - Set to `false` to disable predictive instance size auto-scaling. + type: boolean + scaleDownEnabled: + description: Flag that indicates whether the instance size may scale down via reactive auto-scaling. MongoDB Cloud requires this parameter if **replicationSpecs[n].regionConfigs[m].autoScaling.compute.enabled** is `true`. If you enable this option, specify a value for **replicationSpecs[n].regionConfigs[m].autoScaling.compute.minInstanceSize**. + type: boolean + title: Automatic Compute Scaling Settings + type: object + AdvancedDiskBackupSnapshotSchedulePolicy: + description: List that contains a document for each backup policy item in the desired backup policy. + properties: + id: + description: Unique 24-hexadecimal digit string that identifies this backup policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + policyItems: + description: List that contains the specifications for one policy. + items: + $ref: "#/components/schemas/DiskBackupApiPolicyItem" + type: array + type: object + AlertViewForNdsGroup: + type: object + properties: + acknowledgedUntil: + description: |- + Date and time until which this alert has been acknowledged. This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter if a MongoDB User previously acknowledged this alert. + + - To acknowledge this alert forever, set the parameter value to 100 years in the future. + + - To unacknowledge a previously acknowledged alert, do not set this parameter value. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + type: string + acknowledgementComment: + description: Comment that a MongoDB Cloud user submitted when acknowledging the alert. + example: Expiration on 3/19. Silencing for 7days. + maxLength: 200 + type: string + acknowledgingUsername: + description: MongoDB Cloud username of the person who acknowledged the alert. The response returns this parameter if a MongoDB Cloud user previously acknowledged this alert. + format: email + readOnly: true + type: string + alertConfigId: + description: Unique 24-hexadecimal digit string that identifies the alert configuration that sets this alert. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + created: + description: Date and time when MongoDB Cloud created this alert. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + readOnly: true + type: string + eventTypeName: + description: Incident that triggered this alert. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project that owns this alert. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies this alert. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lastNotified: + description: Date and time that any notifications were last sent for this alert. This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter if MongoDB Cloud has sent notifications for this alert. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + orgId: + description: Unique 24-hexadecimal character string that identifies the organization that owns the project to which this alert applies. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + resolved: + description: 'Date and time that this alert changed to `"status" : "CLOSED"`. This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter once `"status" : "CLOSED"`.' + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + readOnly: true + type: string + status: + description: State of this alert at the time you requested its details. + example: OPEN + readOnly: true + type: string + updated: + description: Date and time when someone last updated this alert. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + readOnly: true + type: string + clusterName: + description: Human-readable label that identifies the cluster to which this alert applies. This resource returns this parameter for alerts of events impacting backups, replica sets, or sharded clusters. + example: cluster1 + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + hostnameAndPort: + description: Hostname and port of the host to which this alert applies. The resource returns this parameter for alerts of events impacting hosts or replica sets. + example: cloud-test.mongodb.com:27017 + readOnly: true + type: string + replicaSetName: + description: Name of the replica set to which this alert applies. The response returns this parameter for alerts of events impacting backups, hosts, or replica sets. + example: event-replica-set + readOnly: true + type: string + currentValue: + $ref: "#/components/schemas/NumberMetricValue" + metricName: + description: |- + Name of the metric against which Atlas checks the configured `metricThreshold.threshold`. + + To learn more about the available metrics, see Host Metrics. + + **NOTE**: If you set eventTypeName to OUTSIDE_SERVERLESS_METRIC_THRESHOLD, you can specify only metrics available for serverless. To learn more, see Serverless Measurements. + example: ASSERT_USER + readOnly: true + type: string + nonRunningHostIds: + description: List of unique 24-hexadecimal character strings that identify the replica set members that are not in PRIMARY nor SECONDARY state. + items: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{8,32})$ + readOnly: true + type: string + readOnly: true + type: array + parentClusterId: + description: Unique 24-hexadecimal character string that identifies the parent cluster to which this alert applies. The parent cluster contains the sharded nodes. MongoDB Cloud returns this parameter only for alerts of events impacting sharded clusters. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + instanceName: + description: The name of the Stream Processing Instance to which this alert applies. The resource returns this parameter for alerts of events impacting Stream Processing Instances. + example: foobar + readOnly: true + type: string + processorErrorMsg: + description: The error message associated with the Stream Processor to which this alert applies. + example: "MongoServerError: Failed to start stream processor: (Location77175) Could not connect to the Kafka topic with kafka error code: -195, message: Local: Broker transport failure.: (Location77175)" + readOnly: true + type: string + processorName: + description: The name of the Stream Processor to which this alert applies. The resource returns this parameter for alerts of events impacting Stream Processors. + example: foobar + readOnly: true + type: string + processorState: + description: The state of the Stream Processor to which this alert applies. The resource returns this parameter for alerts of events impacting Stream Processors. + example: STARTED + readOnly: true + type: string + AlertsNotificationRootForGroup: + description: One target that MongoDB Cloud sends notifications when an alert triggers. + type: object + properties: + datadogApiKey: + description: |- + Datadog API Key that MongoDB Cloud needs to send alert notifications to Datadog. You can find this API key in the Datadog dashboard. The resource requires this parameter when `"notifications.[n].typeName" : "DATADOG"`. + + **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: + + * View or edit the alert through the Atlas UI. + + * Query the alert for the notification through the Atlas Administration API. + example: "****************************a23c" + type: string + datadogRegion: + default: US + description: 'Datadog region that indicates which API Uniform Resource Locator (URL) to use. The resource requires this parameter when `"notifications.[n].typeName" : "DATADOG"`.' + externalDocs: + description: Datadog regions + url: https://docs.datadoghq.com/getting_started/site/ + type: string + delayMin: + description: Number of minutes that MongoDB Cloud waits after detecting an alert condition before it sends out the first notification. + format: int32 + type: integer + integrationId: + description: The id of the associated integration, the credentials of which to use for requests. + example: 32b6e34b3d91647abb20e7b8 + type: string + intervalMin: + description: |- + Number of minutes to wait between successive notifications. MongoDB Cloud sends notifications until someone acknowledges the unacknowledged alert. + + PagerDuty, VictorOps, and OpsGenie notifications don't return this element. Configure and manage the notification interval within each of those services. + format: int32 + minimum: 5 + type: integer + notifierId: + description: The notifierId is a system-generated unique identifier assigned to each notification method. This is needed when updating third-party notifications without requiring explicit authentication credentials. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + typeName: + description: Human-readable label that displays the alert notification type. + type: string + emailAddress: + description: |- + Email address to which MongoDB Cloud sends alert notifications. The resource requires this parameter when `"notifications.[n].typeName" : "EMAIL"`. You don't need to set this value to send emails to individual or groups of MongoDB Cloud users including: + + - specific MongoDB Cloud users (`"notifications.[n].typeName" : "USER"`) + - MongoDB Cloud users with specific project roles (`"notifications.[n].typeName" : "GROUP"`) + - MongoDB Cloud users with specific organization roles (`"notifications.[n].typeName" : "ORG"`) + - MongoDB Cloud teams (`"notifications.[n].typeName" : "TEAM"`) + + To send emails to one MongoDB Cloud user or grouping of users, set the `notifications.[n].emailEnabled` parameter. + format: email + type: string + emailEnabled: + description: |- + Flag that indicates whether MongoDB Cloud should send email notifications. The resource requires this parameter when one of the following values have been set: + + - `"notifications.[n].typeName" : "ORG"` + - `"notifications.[n].typeName" : "GROUP"` + - `"notifications.[n].typeName" : "USER"` + type: boolean + roles: + description: 'List that contains the one or more organization roles that receive the configured alert. This parameter is available when `"notifications.[n].typeName" : "GROUP"` or `"notifications.[n].typeName" : "ORG"`. If you include this parameter, MongoDB Cloud sends alerts only to users assigned the roles you specify in the array. If you omit this parameter, MongoDB Cloud sends alerts to users assigned any role.' + externalDocs: + description: Organization Roles + url: https://dochub.mongodb.org/core/atlas-org-roles + items: + description: One or more organization roles that receive the configured alert. + type: string + type: array + smsEnabled: + description: |- + Flag that indicates whether MongoDB Cloud should send text message notifications. The resource requires this parameter when one of the following values have been set: + + - `"notifications.[n].typeName" : "ORG"` + - `"notifications.[n].typeName" : "GROUP"` + - `"notifications.[n].typeName" : "USER"` + type: boolean + notificationToken: + description: |- + HipChat API token that MongoDB Cloud needs to send alert notifications to HipChat. The resource requires this parameter when `"notifications.[n].typeName" : "HIP_CHAT"`". If the token later becomes invalid, MongoDB Cloud sends an email to the project owners. If the token remains invalid, MongoDB Cloud removes it. + + **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: + + * View or edit the alert through the Atlas UI. + + * Query the alert for the notification through the Atlas Administration API. + example: "************************************1234" + type: string + roomName: + description: 'HipChat API room name to which MongoDB Cloud sends alert notifications. The resource requires this parameter when `"notifications.[n].typeName" : "HIP_CHAT"`".' + example: test room + type: string + microsoftTeamsWebhookUrl: + description: |- + Microsoft Teams Webhook Uniform Resource Locator (URL) that MongoDB Cloud needs to send this notification via Microsoft Teams. The resource requires this parameter when `"notifications.[n].typeName" : "MICROSOFT_TEAMS"`. If the URL later becomes invalid, MongoDB Cloud sends an email to the project owners. If the key remains invalid, MongoDB Cloud removes it. + + **NOTE**: When you view or edit the alert for a Microsoft Teams notification, the URL appears partially redacted. + example: https://webhook.com/**** + type: string + opsGenieApiKey: + description: |- + API Key that MongoDB Cloud needs to send this notification via Opsgenie. The resource requires this parameter when `"notifications.[n].typeName" : "OPS_GENIE"`. If the key later becomes invalid, MongoDB Cloud sends an email to the project owners. If the key remains invalid, MongoDB Cloud removes it. + + **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: + + * View or edit the alert through the Atlas UI. + + * Query the alert for the notification through the Atlas Administration API. + example: "********************************a111" + type: string + opsGenieRegion: + default: US + description: Opsgenie region that indicates which API Uniform Resource Locator (URL) to use. + type: string + region: + default: US + description: PagerDuty region that indicates which API Uniform Resource Locator (URL) to use. + type: string + serviceKey: + description: |- + PagerDuty service key that MongoDB Cloud needs to send notifications via PagerDuty. The resource requires this parameter when `"notifications.[n].typeName" : "PAGER_DUTY"`. If the key later becomes invalid, MongoDB Cloud sends an email to the project owners. If the key remains invalid, MongoDB Cloud removes it. + + **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: + + * View or edit the alert through the Atlas UI. + + * Query the alert for the notification through the Atlas Administration API. + example: "****************************7890" + type: string + apiToken: + description: |- + Slack API token or Bot token that MongoDB Cloud needs to send alert notifications via Slack. The resource requires this parameter when `"notifications.[n].typeName" : "SLACK"`. If the token later becomes invalid, MongoDB Cloud sends an email to the project owners. If the token remains invalid, MongoDB Cloud removes the token. + + **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: + + * View or edit the alert through the Atlas UI. + + * Query the alert for the notification through the Atlas Administration API. + example: "**********************************************************************abcd" + type: string + channelName: + description: 'Name of the Slack channel to which MongoDB Cloud sends alert notifications. The resource requires this parameter when `"notifications.[n].typeName" : "SLACK"`.' + example: alerts + type: string + mobileNumber: + description: 'Mobile phone number to which MongoDB Cloud sends alert notifications. The resource requires this parameter when `"notifications.[n].typeName" : "SMS"`.' + example: "1233337892" + type: string + teamId: + description: 'Unique 24-hexadecimal digit string that identifies one MongoDB Cloud team. The resource requires this parameter when `"notifications.[n].typeName" : "TEAM"`.' + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + teamName: + description: 'Name of the MongoDB Cloud team that receives this notification. The resource requires this parameter when `"notifications.[n].typeName" : "TEAM"`.' + example: Atlas + type: string + username: + description: 'MongoDB Cloud username of the person to whom MongoDB Cloud sends notifications. Specify only MongoDB Cloud users who belong to the project that owns the alert configuration. The resource requires this parameter when `"notifications.[n].typeName" : "USER"`.' + format: email + type: string + victorOpsApiKey: + description: |- + API key that MongoDB Cloud needs to send alert notifications to Splunk On-Call. The resource requires this parameter when `"notifications.[n].typeName" : "VICTOR_OPS"`. If the key later becomes invalid, MongoDB Cloud sends an email to the project owners. If the key remains invalid, MongoDB Cloud removes it. + + **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: + + * View or edit the alert through the Atlas UI. + + * Query the alert for the notification through the Atlas Administration API. + example: "********************************9abc" + type: string + victorOpsRoutingKey: + description: 'Routing key that MongoDB Cloud needs to send alert notifications to Splunk On-Call. The resource requires this parameter when `"notifications.[n].typeName" : "VICTOR_OPS"`. If the key later becomes invalid, MongoDB Cloud sends an email to the project owners. If the key remains invalid, MongoDB Cloud removes it.' + example: test routing + type: string + webhookSecret: + description: |- + Authentication secret for a webhook-based alert. + + Atlas returns this value if you set `"notifications.[n].typeName" :"WEBHOOK"` and either: + * You set `notification.[n].webhookSecret` to a non-empty string + * You set a default webhookSecret either on the Integrations page, or with the [Integrations API](#tag/Third-Party-Service-Integrations/operation/createIntegration) + + **NOTE**: When you view or edit the alert for a webhook notification, the secret appears completely redacted. + externalDocs: + description: Integrations page + url: https://www.mongodb.com/docs/atlas/tutorial/third-party-service-integrations/#std-label-third-party-integrations + format: password + type: string + webhookUrl: + description: |- + Target URL for a webhook-based alert. + + Atlas returns this value if you set `"notifications.[n].typeName" :"WEBHOOK"` and either: + * You set `notification.[n].webhookURL` to a non-empty string + * You set a default webhookUrl either on the [Integrations](https://www.mongodb.com/docs/atlas/tutorial/third-party-service-integrations/#std-label-third-party-integrations) page, or with the [Integrations API](#tag/Third-Party-Service-Integrations/operation/createIntegration) + + **NOTE**: When you view or edit the alert for a Webhook URL notification, the URL appears partially redacted. + example: https://webhook.com/**** + type: string + AlertsToggle: + description: Enables or disables the specified alert configuration in the specified project. + properties: + enabled: + description: Flag that indicates whether to enable or disable the specified alert configuration in the specified project. + type: boolean + title: Toggle Request + type: object + ApiError: + properties: + badRequestDetail: + $ref: "#/components/schemas/BadRequestDetail" + detail: + description: Describes the specific conditions or reasons that cause each type of error. + type: string + error: + description: HTTP status code returned with this error. + externalDocs: + url: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status + format: int32 + readOnly: true + type: integer + errorCode: + description: Application error code returned with this error. + readOnly: true + type: string + parameters: + description: Parameters used to give more information about the error. + items: {} + readOnly: true + type: array + reason: + description: Application error message returned with this error. + readOnly: true + type: string + required: + - error + - errorCode + type: object + ApiHostView_Atlas: + properties: + created: + description: Date and time when MongoDB Cloud created this MongoDB process. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. The project contains MongoDB processes that you want to return. The MongoDB process can be either the `mongod` or `mongos`. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + hostname: + description: Hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?$ + readOnly: true + type: string + id: + description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + readOnly: true + type: string + lastPing: + description: Date and time when MongoDB Cloud received the last ping for this MongoDB process. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link_Atlas" + readOnly: true + type: array + port: + description: Internet Assigned Numbers Authority (IANA) port on which the MongoDB process listens for requests. + format: int32 + readOnly: true + type: integer + replicaSetName: + description: Human-readable label that identifies the replica set that contains this process. This resource returns this parameter if this process belongs to a replica set. + readOnly: true + type: string + shardName: + description: Human-readable label that identifies the shard that contains this process. This resource returns this value only if this process belongs to a sharded cluster. + readOnly: true + type: string + typeName: + description: Type of MongoDB process that MongoDB Cloud tracks. MongoDB Cloud returns new processes as **NO_DATA** until MongoDB Cloud completes deploying the process. + readOnly: true + type: string + userAlias: + description: Human-readable label that identifies the cluster node. MongoDB Cloud sets this hostname usually to the standard hostname for the cluster node. It appears in the connection string for a cluster instead of the value of the hostname parameter. + readOnly: true + type: string + version: + description: Version of MongoDB that this process runs. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + type: object + ApiKey: + description: Details contained in one API key. + properties: + accessList: + description: List of network addresses granted access to this API using this API key. + items: + $ref: "#/components/schemas/AccessListItem" + readOnly: true + type: array + id: + description: Unique 24-hexadecimal digit string that identifies this organization API key. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + publicKey: + description: Public API key value set for the specified organization API key. + maxLength: 8 + minLength: 8 + readOnly: true + type: string + roles: + description: List that contains roles that the API key needs to have. All roles you provide must be valid for the specified project or organization. Each request must include a minimum of one valid role. The resource returns all project and organization roles assigned to the Cloud user. + items: + $ref: "#/components/schemas/CloudAccessRoleAssignment" + readOnly: true + type: array + readOnly: true + required: + - id + - publicKey + type: object + ApiKeyUserDetails: + description: Details of the Programmatic API Keys. + properties: + desc: + description: Purpose or explanation provided when someone created this organization API key. + maxLength: 250 + minLength: 1 + type: string + id: + description: Unique 24-hexadecimal digit string that identifies this organization API key assigned to this project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + privateKey: + description: Redacted private key returned for this organization API key. This key displays unredacted when first created. + example: 55c3bbb6-b4bb-0be1-e66d20841f3e + readOnly: true + type: string + publicKey: + description: Public API key value set for the specified organization API key. + example: zmmrboas + maxLength: 8 + minLength: 8 + readOnly: true + type: string + roles: + description: List that contains the roles that the API key needs to have. All roles you provide must be valid for the specified project or organization. Each request must include a minimum of one valid role. The resource returns all project and organization roles assigned to the API key. + items: + $ref: "#/components/schemas/CloudAccessRoleAssignment" + type: array + type: object + ApiMeasurementsGeneralView_Atlas: + properties: + databaseName: + description: Human-readable label that identifies the database that the specified MongoDB process serves. + readOnly: true + type: string + end: + description: Date and time that specifies when to stop retrieving measurements. If you set **end**, you must set **start**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + granularity: + description: Duration that specifies the interval between measurement data points. The parameter expresses its value in ISO 8601 timestamp format in UTC. If you set this parameter, you must set either **period** or **start** and **end**. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. The project contains MongoDB processes that you want to return. The MongoDB process can be either the `mongod` or `mongos`. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + hostId: + description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link_Atlas" + readOnly: true + type: array + measurements: + description: List that contains measurements and their data points. + items: + $ref: "#/components/schemas/MetricsMeasurement_Atlas" + readOnly: true + type: array + partitionName: + description: Human-readable label of the disk or partition to which the measurements apply. + readOnly: true + type: string + processId: + description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + readOnly: true + type: string + start: + description: Date and time that specifies when to start retrieving measurements. If you set **start**, you must set **end**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + type: object + ApiPrivateDownloadDeliveryUrl: + description: One Uniform Resource Locator (URL) that points to the compressed snapshot files for manual download and the corresponding private endpoint. + properties: + deliveryUrl: + description: One Uniform Resource Locator that points to the compressed snapshot files for manual download. + type: string + endpointId: + description: Unique 22-character alphanumeric string that identifies the private endpoint. + example: vpce-3bf78b0ddee411ba1 + pattern: ^vpce-[0-9a-f]{17}$ + type: string + type: object + ApiPublicUsageDetailsQueryRequest: + description: Request body for an Invoice Usage Details query with filtering, pagination, and sort. + properties: + filters: + $ref: "#/components/schemas/UsageDetailsFilterRequest" + sortField: + description: Specify the field used to specify how to sort query results. Default to bill date. + type: string + sortOrder: + description: Specify the sort order (ascending / descending) used to specify how to sort query results. Defaults to descending. + type: string + type: object + AtlasClusterOutageSimulationOutageFilter: + properties: + cloudProvider: + description: The cloud provider of the region that undergoes the outage simulation. + type: string + regionName: + description: The name of the region to undergo an outage simulation. + type: string + type: + description: The type of cluster outage to simulate. `REGION` simulates a cluster outage for a region. + type: string + type: object + AtlasOrganization: + description: Details that describe the organization. + properties: + id: + description: Unique 24-hexadecimal digit string that identifies the organization. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + isDeleted: + description: Flag that indicates whether this organization has been deleted. + readOnly: true + type: boolean + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the organization. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + type: string + skipDefaultAlertsSettings: + default: false + description: Disables automatic alert creation. When set to true, no organization level alerts will be created automatically. + type: boolean + required: + - name + type: object + AtlasSearchAnalyzer: + properties: + charFilters: + description: Filters that examine text one character at a time and perform filtering operations. + items: + $ref: "#/components/schemas/BasicDBObject" + type: array + name: + description: |- + Name that identifies the custom analyzer. Names must be unique within an index, and must not start with any of the following strings: + - `lucene.` + - `builtin.` + - `mongodb.` + type: string + tokenFilters: + description: |- + Filter that performs operations such as: + + - Stemming, which reduces related words, such as "talking", "talked", and "talks" to their root word "talk". + + - Redaction, which is the removal of sensitive information from public documents. + items: + $ref: "#/components/schemas/BasicDBObject" + type: array + tokenizer: + description: Tokenizer that you want to use to create tokens. Tokens determine how Atlas Search splits up text into discrete chunks for indexing. + type: object + required: + - name + - tokenizer + title: Atlas Search Analyzer + type: object + AtlasTenantClusterUpgradeRequest20240805: + description: Request containing target state of tenant cluster to be upgraded + properties: + acceptDataRisksAndForceReplicaSetReconfig: + description: If reconfiguration is necessary to regain a primary due to a regional outage, submit this field alongside your topology reconfiguration to request a new regional outage resistant topology. Forced reconfigurations during an outage of the majority of electable nodes carry a risk of data loss if replicated writes (even majority committed writes) have not been replicated to the new primary node. MongoDB Atlas docs contain more information. To proceed with an operation which carries that risk, set **acceptDataRisksAndForceReplicaSetReconfig** to the current date. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: Reconfiguring a Replica Set during a regional outage + url: https://dochub.mongodb.org/core/regional-outage-reconfigure-replica-set + format: date-time + type: string + advancedConfiguration: + $ref: "#/components/schemas/ApiAtlasClusterAdvancedConfiguration" + backupEnabled: + default: false + description: Flag that indicates whether the cluster can perform backups. If set to `true`, the cluster can perform backups. You must set this value to `true` for NVMe clusters. Backup uses Cloud Backups for dedicated clusters and [Shared Cluster Backups](https://docs.atlas.mongodb.com/backup/shared-tier/overview/) for tenant clusters. If set to `false`, the cluster doesn't use backups. + externalDocs: + description: Cloud Backups + url: https://docs.atlas.mongodb.com/backup/cloud-backup/overview/ + type: boolean + biConnector: + $ref: "#/components/schemas/BiConnector" + clusterType: + description: Configuration of nodes that comprise the cluster. + type: string + configServerManagementMode: + default: ATLAS_MANAGED + description: |- + Config Server Management Mode for creating or updating a sharded cluster. + + When configured as ATLAS_MANAGED, atlas may automatically switch the cluster's config server type for optimal performance and savings. + + When configured as FIXED_TO_DEDICATED, the cluster will always use a dedicated config server. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + type: string + configServerType: + description: Describes a sharded cluster's config server type. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + readOnly: true + type: string + connectionStrings: + $ref: "#/components/schemas/ClusterConnectionStrings" + createDate: + description: Date and time when MongoDB Cloud created this cluster. This parameter expresses its value in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + diskWarmingMode: + default: FULLY_WARMED + description: Disk warming mode selection. + externalDocs: + description: Reduce Secondary Disk Warming Impact + url: https://docs.atlas.mongodb.com/reference/replica-set-tags/#reduce-secondary-disk-warming-impact + type: string + encryptionAtRestProvider: + description: 'Cloud service provider that manages your customer keys to provide an additional layer of encryption at rest for the cluster. To enable customer key management for encryption at rest, the cluster **replicationSpecs[n].regionConfigs[m].{type}Specs.instanceSize** setting must be `M10` or higher and `"backupEnabled" : false` or omitted entirely.' + externalDocs: + description: Encryption at Rest using Customer Key Management + url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ + type: string + featureCompatibilityVersion: + description: Feature compatibility version of the cluster. This will always appear regardless of whether FCV is pinned. + readOnly: true + type: string + featureCompatibilityVersionExpirationDate: + description: Feature compatibility version expiration date. Will only appear if FCV is pinned. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + globalClusterSelfManagedSharding: + description: |- + Set this field to configure the Sharding Management Mode when creating a new Global Cluster. + + When set to false, the management mode is set to Atlas-Managed Sharding. This mode fully manages the sharding of your Global Cluster and is built to provide a seamless deployment experience. + + When set to true, the management mode is set to Self-Managed Sharding. This mode leaves the management of shards in your hands and is built to provide an advanced and flexible deployment experience. + + This setting cannot be changed once the cluster is deployed. + externalDocs: + description: Creating a Global Cluster + url: https://dochub.mongodb.org/core/global-cluster-management + type: boolean + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + labels: + deprecated: true + description: |- + Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels. + + Cluster labels are deprecated and will be removed in a future release. We strongly recommend that you use Resource Tags instead. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ComponentLabel" + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongoDBEmployeeAccessGrant: + $ref: "#/components/schemas/EmployeeAccessGrant" + mongoDBMajorVersion: + description: |- + MongoDB major version of the cluster. Set to the binary major version. + + On creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLtsVersions). + + On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version. + externalDocs: + description: Available MongoDB Versions in Atlas + url: https://www.mongodb.com/docs/atlas/reference/faq/database/#which-versions-of-mongodb-do-service-clusters-use- + type: string + mongoDBVersion: + description: Version of MongoDB that the cluster runs. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + name: + description: Human-readable label that identifies the cluster. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + paused: + description: Flag that indicates whether the cluster is paused. + type: boolean + pitEnabled: + description: Flag that indicates whether the cluster uses continuous cloud backups. + externalDocs: + description: Continuous Cloud Backups + url: https://docs.atlas.mongodb.com/backup/cloud-backup/overview/ + type: boolean + redactClientLogData: + description: |- + Enable or disable log redaction. + + This setting configures the ``mongod`` or ``mongos`` to redact any document field contents from a message accompanying a given log event before logging. This prevents the program from writing potentially sensitive data stored on the database to the diagnostic log. Metadata such as error or operation codes, line numbers, and source file names are still visible in the logs. + + Use ``redactClientLogData`` in conjunction with Encryption at Rest and TLS/SSL (Transport Encryption) to assist compliance with regulatory requirements. + + *Note*: changing this setting on a cluster will trigger a rolling restart as soon as the cluster is updated. + externalDocs: + description: Log Redaction + url: https://www.mongodb.com/docs/manual/administration/monitoring/#log-redaction + type: boolean + replicaSetScalingStrategy: + default: WORKLOAD_TYPE + description: |- + Set this field to configure the replica set scaling mode for your cluster. + + By default, Atlas scales under WORKLOAD_TYPE. This mode allows Atlas to scale your analytics nodes in parallel to your operational nodes. + + When configured as SEQUENTIAL, Atlas scales all nodes sequentially. This mode is intended for steady-state workloads and applications performing latency-sensitive secondary reads. + + When configured as NODE_TYPE, Atlas scales your electable nodes in parallel with your read-only and analytics nodes. This mode is intended for large, dynamic workloads requiring frequent and timely cluster tier scaling. This is the fastest scaling strategy, but it might impact latency of workloads when performing extensive secondary reads. + externalDocs: + description: Modify the Replica Set Scaling Mode + url: https://dochub.mongodb.org/core/scale-nodes + type: string + replicationSpecs: + description: List of settings that configure your cluster regions. This array has one object per shard representing node configurations in each shard. For replica sets there is only one object representing node configurations. + items: + $ref: "#/components/schemas/ReplicationSpec20240805" + type: array + rootCertType: + default: ISRGROOTX1 + description: Root Certificate Authority that MongoDB Atlas cluster uses. MongoDB Cloud supports Internet Security Research Group. + type: string + stateName: + description: Human-readable label that indicates the current operating condition of this cluster. + readOnly: true + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. + type: boolean + versionReleaseSystem: + default: LTS + description: Method by which the cluster maintains the MongoDB versions. If value is `CONTINUOUS`, you must not specify **mongoDBMajorVersion**. + type: string + required: + - name + title: Tenant Cluster Upgrade Request + type: object + AuditLog: + properties: + auditAuthorizationSuccess: + default: false + description: 'Flag that indicates whether someone set auditing to track successful authentications. This only applies to the `"atype" : "authCheck"` audit filter. Setting this parameter to `true` degrades cluster performance.' + externalDocs: + description: System Auditing Messages + url: https://docs.mongodb.com/manual/reference/audit-message/#audit-event-actions-details-and-results + type: boolean + auditFilter: + description: JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (`\`). + externalDocs: + description: Custom Auditing Filter + url: https://docs.atlas.mongodb.com/tutorial/auditing-custom-filter/ + type: string + configurationType: + description: Human-readable label that displays how to configure the audit filter. + readOnly: true + type: string + enabled: + default: false + description: Flag that indicates whether someone enabled database auditing for the specified project. + type: boolean + type: object + AuthFederationRoleMapping: + description: Mapping settings that link one IdP and MongoDB Cloud. + properties: + externalGroupName: + description: Unique human-readable label that identifies the identity provider group to which this role mapping applies. + maxLength: 200 + minLength: 1 + type: string + id: + description: Unique 24-hexadecimal digit string that identifies this role mapping. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + roleAssignments: + description: Atlas roles and the unique identifiers of the groups and organizations associated with each role. The array must include at least one element with an Organization role and its respective **orgId**. Each element in the array can have a value for **orgId** or **groupId**, but not both. + items: + $ref: "#/components/schemas/ConnectedOrgConfigRoleAssignment" + type: array + uniqueItems: true + required: + - externalGroupName + title: Federated Authentication Role Mapping + type: object + AvailableCloudProviderRegion: + properties: + default: + description: Flag that indicates whether the cloud provider sets this region as its default. AWS defaults to US_EAST_1, GCP defaults to CENTRAL_US, and AZURE defaults to US_WEST_2. + readOnly: true + type: boolean + name: + description: Human-readable label that identifies the supported region. + readOnly: true + type: string + type: object + AvailableClustersDeployment: + description: Deployments that can be migrated to MongoDB Atlas. + properties: + agentVersion: + description: Version of MongoDB Agent that monitors/manages the cluster. + readOnly: true + type: string + clusterId: + description: Unique 24-hexadecimal digit string that identifies the cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + dbSizeBytes: + description: Size of this database on disk at the time of the request expressed in bytes. + example: 8192 + format: int64 + readOnly: true + type: integer + featureCompatibilityVersion: + description: Version of MongoDB features that this cluster supports. + externalDocs: + description: MongoDB feature versions + url: https://docs.mongodb.com/manual/reference/command/setFeatureCompatibilityVersion + readOnly: true + type: string + managed: + description: Flag that indicates whether Automation manages this cluster. + readOnly: true + type: boolean + mongoDBVersion: + description: Version of MongoDB that this cluster runs. + readOnly: true + type: string + name: + description: Human-readable label that identifies this cluster. + example: Project X sharded cluster + readOnly: true + type: string + oplogSizeMB: + description: Size of the Oplog on disk at the time of the request expressed in MB. + example: 3 + format: int32 + readOnly: true + type: integer + sharded: + description: |- + Flag that indicates whether someone configured this cluster as a sharded cluster. + + - If `true`, this cluster serves as a sharded cluster. + - If `false`, this cluster serves as a replica set. + readOnly: true + type: boolean + shardsSize: + description: Number of shards that comprise this cluster. + example: 3 + format: int32 + readOnly: true + type: integer + tlsEnabled: + description: Flag that indicates whether someone enabled TLS for this cluster. + readOnly: true + type: boolean + required: + - featureCompatibilityVersion + - managed + - mongoDBVersion + - name + - sharded + - tlsEnabled + title: Available Clusters + type: object + AzureKeyVault: + description: Details that define the configuration of Encryption at Rest using Azure Key Vault (AKV). + externalDocs: + description: Azure Key Vault + url: https://www.mongodb.com/docs/atlas/security-azure-kms/ + properties: + azureEnvironment: + description: Azure environment in which your account credentials reside. + type: string + clientID: + description: Unique 36-hexadecimal character string that identifies an Azure application associated with your Azure Active Directory tenant. + format: uuid + type: string + enabled: + description: Flag that indicates whether someone enabled encryption at rest for the specified project. To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of `false`. + type: boolean + keyIdentifier: + description: Web address with a unique key that identifies for your Azure Key Vault. + example: https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86 + type: string + keyVaultName: + description: Unique string that identifies the Azure Key Vault that contains your key. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault. + type: string + requirePrivateNetworking: + description: Enable connection to your Azure Key Vault over private networking. + type: boolean + resourceGroupName: + description: Name of the Azure resource group that contains your Azure Key Vault. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault. + type: string + secret: + description: Private data that you need secured and that belongs to the specified Azure Key Vault (AKV) tenant (**azureKeyVault.tenantID**). This data can include any type of sensitive data such as passwords, database connection strings, API keys, and the like. AKV stores this information as encrypted binary data. + externalDocs: + description: Azure Key Vault Secrets + url: https://docs.microsoft.com/en-us/azure/key-vault/secrets/about-secrets + type: string + writeOnly: true + subscriptionID: + description: Unique 36-hexadecimal character string that identifies your Azure subscription. This field cannot be modified when you enable and set up private endpoint connections to your Azure Key Vault. + format: uuid + type: string + tenantID: + description: Unique 36-hexadecimal character string that identifies the Azure Active Directory tenant within your Azure subscription. + format: uuid + type: string + valid: + description: Flag that indicates whether the Azure encryption key can encrypt and decrypt data. + readOnly: true + type: boolean + type: object + BackupComplianceOnDemandPolicyItem: + description: Specifications for on-demand policy. + properties: + frequencyInterval: + description: Number that indicates the frequency interval for a set of snapshots. MongoDB Cloud ignores this setting for non-hourly policy items in Backup Compliance Policy settings. + format: int32 + type: integer + frequencyType: + description: Human-readable label that identifies the frequency type associated with the backup policy. + type: string + id: + description: Unique 24-hexadecimal digit string that identifies this backup policy item. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + retentionUnit: + description: Unit of time in which MongoDB Cloud measures snapshot retention. + type: string + retentionValue: + description: |- + Duration in days, weeks, months, or years that MongoDB Cloud retains the snapshot. For less frequent policy items, MongoDB Cloud requires that you specify a value greater than or equal to the value specified for more frequent policy items. + + For example: If the hourly policy item specifies a retention of two days, you must specify two days or greater for the retention of the weekly policy item. + format: int32 + type: integer + required: + - frequencyInterval + - frequencyType + - retentionUnit + - retentionValue + type: object + BackupComplianceScheduledPolicyItem: + description: Specifications for scheduled policy. + properties: + frequencyInterval: + description: |- + Number that indicates the frequency interval for a set of Snapshots. A value of `1` specifies the first instance of the corresponding `frequencyType`. + + - In a yearly policy item, `1` indicates that the yearly Snapshot occurs on the first day of January and `12` indicates the first day of December. + + - In a monthly policy item, `1` indicates that the monthly Snapshot occurs on the first day of the month and `40` indicates the last day of the month. + + - In a weekly policy item, `1` indicates that the weekly Snapshot occurs on Monday and `7` indicates Sunday. + + - In an hourly policy item, you can set the frequency interval to `1`, `2`, `4`, `6`, `8`, or `12`. For hourly policy items for NVMe clusters, MongoDB Cloud accepts only `12` as the frequency interval value. + + MongoDB Cloud ignores this setting for non-hourly policy items in Backup Compliance Policy settings. + format: int32 + type: integer + frequencyType: + description: Human-readable label that identifies the frequency type associated with the backup policy. + type: string + id: + description: Unique 24-hexadecimal digit string that identifies this backup policy item. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + retentionUnit: + description: Unit of time in which MongoDB Cloud measures Snapshot retention. + type: string + retentionValue: + description: |- + Duration in days, weeks, months, or years that MongoDB Cloud retains the Snapshot. For less frequent policy items, MongoDB Cloud requires that you specify a value greater than or equal to the value specified for more frequent policy items. + + For example: If the hourly policy item specifies a retention of two days, you must specify two days or greater for the retention of the weekly policy item. + format: int32 + type: integer + required: + - frequencyInterval + - frequencyType + - retentionUnit + - retentionValue + type: object + BackupLabel: + description: Collection of key-value pairs that represent custom data to add to the metadata file that MongoDB Cloud uploads to the bucket when the export job finishes. + properties: + key: + description: Key for the metadata file that MongoDB Cloud uploads to the bucket when the export job finishes. + type: string + value: + description: Value for the key to include in file that MongoDB Cloud uploads to the bucket when the export job finishes. + type: string + type: object + BackupOnlineArchive: + properties: + _id: + description: Unique 24-hexadecimal digit string that identifies the online archive. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + clusterName: + description: Human-readable label that identifies the cluster that contains the collection for which you want to create an online archive. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + collName: + description: Human-readable label that identifies the collection for which you created the online archive. + readOnly: true + type: string + collectionType: + default: STANDARD + description: |- + Classification of MongoDB database collection that you want to return. + + If you set this parameter to `TIMESERIES`, set `"criteria.type" : "date"` and `"criteria.dateFormat" : "ISODATE"`. + readOnly: true + type: string + criteria: + $ref: "#/components/schemas/Criteria" + dataExpirationRule: + $ref: "#/components/schemas/DataExpirationRule" + dataProcessRegion: + $ref: "#/components/schemas/DataProcessRegion" + dataSetName: + description: Human-readable label that identifies the dataset that Atlas generates for this online archive. + readOnly: true + type: string + dbName: + description: Human-readable label of the database that contains the collection that contains the online archive. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project that contains the specified cluster. The specified cluster contains the collection for which to create the online archive. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + partitionFields: + description: "List that contains document parameters to use to logically divide data within a collection. Partitions provide a coarse level of filtering of the underlying collection data. To divide your data, specify parameters that you frequently query. If you \"specified :criteria.type\": \"DATE\" in the CREATE ONE ONLINE ARCHIVE endpoint, then you can specify up to three parameters by which to query. One of these parameters must be the DATE value, which is required in this case. If you \"specified :criteria.type\": \"CUSTOM\" in the CREATE ONE ONLINE ARCHIVE endpoint, then you can specify up to two parameters by which to query. Queries that don't use \":criteria.type\": \"DATE\" or \":criteria.type\": \"CUSTOM\" parameters cause MongoDB to scan a full collection of all archived documents. This takes more time and increases your costs." + items: + $ref: "#/components/schemas/PartitionField" + minItems: 1 + readOnly: true + type: array + paused: + description: Flag that indicates whether this online archive exists in the paused state. A request to resume fails if the collection has another active online archive. To pause an active online archive or resume a paused online archive, you must include this parameter. To pause an active archive, set this to **true**. To resume a paused archive, set this to **false**. + type: boolean + schedule: + $ref: "#/components/schemas/OnlineArchiveSchedule" + state: + description: |- + Phase of the process to create this online archive when you made this request. + + | State | Indication | + |-------------|------------| + | `PENDING` | MongoDB Cloud has queued documents for archive. Archiving hasn't started. | + | `ARCHIVING` | MongoDB Cloud started archiving documents that meet the archival criteria. | + | `IDLE` | MongoDB Cloud waits to start the next archival job. | + | `PAUSING` | Someone chose to stop archiving. MongoDB Cloud finishes the running archival job then changes the state to `PAUSED` when that job completes. | + | `PAUSED` | MongoDB Cloud has stopped archiving. Archived documents can be queried. The specified archiving operation on the active cluster cannot archive additional documents. You can resume archiving for paused archives at any time. | + | `ORPHANED` | Someone has deleted the collection associated with an active or paused archive. MongoDB Cloud doesn't delete the archived data. You must manually delete the online archives associated with the deleted collection. | + | `DELETED` | Someone has deleted the archive was deleted. When someone deletes an online archive, MongoDB Cloud removes all associated archived documents from the cloud object storage. | + readOnly: true + type: string + type: object + BackupOnlineArchiveCreate: + properties: + _id: + description: Unique 24-hexadecimal digit string that identifies the online archive. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + clusterName: + description: Human-readable label that identifies the cluster that contains the collection for which you want to create an online archive. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + collName: + description: Human-readable label that identifies the collection for which you created the online archive. + type: string + writeOnly: true + collectionType: + default: STANDARD + description: |- + Classification of MongoDB database collection that you want to return. + + If you set this parameter to `TIMESERIES`, set `"criteria.type" : "date"` and `"criteria.dateFormat" : "ISODATE"`. + type: string + writeOnly: true + criteria: + $ref: "#/components/schemas/Criteria" + dataExpirationRule: + $ref: "#/components/schemas/DataExpirationRule" + dataProcessRegion: + $ref: "#/components/schemas/CreateDataProcessRegion" + dataSetName: + description: Human-readable label that identifies the dataset that Atlas generates for this online archive. + readOnly: true + type: string + dbName: + description: Human-readable label of the database that contains the collection that contains the online archive. + type: string + writeOnly: true + groupId: + description: Unique 24-hexadecimal digit string that identifies the project that contains the specified cluster. The specified cluster contains the collection for which to create the online archive. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + partitionFields: + description: "List that contains document parameters to use to logically divide data within a collection. Partitions provide a coarse level of filtering of the underlying collection data. To divide your data, specify parameters that you frequently query. If you \"specified :criteria.type\": \"DATE\" in the CREATE ONE ONLINE ARCHIVE endpoint, then you can specify up to three parameters by which to query. One of these parameters must be the DATE value, which is required in this case. If you \"specified :criteria.type\": \"CUSTOM\" in the CREATE ONE ONLINE ARCHIVE endpoint, then you can specify up to two parameters by which to query. Queries that don't use \":criteria.type\": \"DATE\" or \":criteria.type\": \"CUSTOM\" parameters cause MongoDB to scan a full collection of all archived documents. This takes more time and increases your costs." + items: + $ref: "#/components/schemas/PartitionField" + minItems: 1 + type: array + writeOnly: true + paused: + description: Flag that indicates whether this online archive exists in the paused state. A request to resume fails if the collection has another active online archive. To pause an active online archive or resume a paused online archive, you must include this parameter. To pause an active archive, set this to **true**. To resume a paused archive, set this to **false**. + type: boolean + schedule: + $ref: "#/components/schemas/OnlineArchiveSchedule" + state: + description: |- + Phase of the process to create this online archive when you made this request. + + | State | Indication | + |-------------|------------| + | `PENDING` | MongoDB Cloud has queued documents for archive. Archiving hasn't started. | + | `ARCHIVING` | MongoDB Cloud started archiving documents that meet the archival criteria. | + | `IDLE` | MongoDB Cloud waits to start the next archival job. | + | `PAUSING` | Someone chose to stop archiving. MongoDB Cloud finishes the running archival job then changes the state to `PAUSED` when that job completes. | + | `PAUSED` | MongoDB Cloud has stopped archiving. Archived documents can be queried. The specified archiving operation on the active cluster cannot archive additional documents. You can resume archiving for paused archives at any time. | + | `ORPHANED` | Someone has deleted the collection associated with an active or paused archive. MongoDB Cloud doesn't delete the archived data. You must manually delete the online archives associated with the deleted collection. | + | `DELETED` | Someone has deleted the archive was deleted. When someone deletes an online archive, MongoDB Cloud removes all associated archived documents from the cloud object storage. | + readOnly: true + type: string + required: + - collName + - criteria + - dbName + type: object + BackupRestoreJob: + properties: + batchId: + description: Unique 24-hexadecimal digit string that identifies the batch to which this restore job belongs. This parameter exists only for a sharded cluster restore. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + checkpointId: + description: |- + Unique 24-hexadecimal digit string that identifies the sharded cluster checkpoint. The checkpoint represents the point in time back to which you want to restore you data. This parameter applies when `"delivery.methodName" : "AUTOMATED_RESTORE"`. Use this parameter with sharded clusters only. + + - If you set **checkpointId**, you can't set **oplogInc**, **oplogTs**, **snapshotId**, or **pointInTimeUTCMillis**. + - If you provide this parameter, this endpoint restores all data up to this checkpoint to the database you specify in the **delivery** object. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + clusterId: + description: Unique 24-hexadecimal digit string that identifies the cluster with the snapshot you want to return. This parameter returns for restore clusters. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + clusterName: + description: Human-readable label that identifies the cluster containing the snapshots you want to retrieve. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + created: + description: Date and time when someone requested this restore job. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + delivery: + $ref: "#/components/schemas/BackupRestoreJobDelivery" + encryptionEnabled: + description: Flag that indicates whether someone encrypted the data in the restored snapshot. + readOnly: true + type: boolean + groupId: + description: Unique 24-hexadecimal digit string that identifies the project that owns the snapshots. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + hashes: + description: 'List that contains documents mapping each restore file to a hashed checksum. This parameter applies after you download the corresponding **delivery.url**. If `"methodName" : "HTTP"`, this list contains one object that represents the hash of the **.tar.gz** file.' + items: + $ref: "#/components/schemas/RestoreJobFileHash" + readOnly: true + type: array + id: + description: Unique 24-hexadecimal digit string that identifies the restore job. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + masterKeyUUID: + description: 'Universally Unique Identifier (UUID) that identifies the Key Management Interoperability (KMIP) master key used to encrypt the snapshot data. This parameter applies only when `"encryptionEnabled" : "true"`.' + format: uuid + readOnly: true + type: string + oplogInc: + description: |- + Thirty-two-bit incrementing ordinal that represents operations within a given second. When paired with **oplogTs**, this represents the point in time to which MongoDB Cloud restores your data. This parameter applies when `"delivery.methodName" : "AUTOMATED_RESTORE"`. + + - If you set **oplogInc**, you must set **oplogTs**, and can't set **checkpointId**, **snapshotId**, or **pointInTimeUTCMillis**. + - If you provide this parameter, this endpoint restores all data up to and including this Oplog timestamp to the database you specified in the **delivery** object. + format: int32 + minimum: 1 + type: integer + writeOnly: true + oplogTs: + description: |- + Date and time from which you want to restore this snapshot. This parameter expresses its value in ISO 8601 format in UTC. This represents the first part of an Oplog timestamp. When paired with **oplogInc**, they represent the last database operation to which you want to restore your data. This parameter applies when `"delivery.methodName" : "AUTOMATED_RESTORE"`. Run a query against **local.oplog.rs** on your replica set to find the desired timestamp. + + - If you set **oplogTs**, you must set **oplogInc**, and you can't set **checkpointId**, **snapshotId**, or **pointInTimeUTCMillis**. + - If you provide this parameter, this endpoint restores all data up to and including this Oplog timestamp to the database you specified in the **delivery** object. + pattern: ^(?:[1-9]\\d{3}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1\\d|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[1-9]\\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)-02-29)T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{1,9})?(?:Z|[+-][01]\\d:[0-5]\\d)$ + type: string + writeOnly: true + pointInTimeUTCMillis: + description: |- + Timestamp from which you want to restore this snapshot. This parameter expresses its value in the number of milliseconds elapsed since the UNIX epoch. This timestamp must fall within the last 24 hours of the current time. This parameter applies when `"delivery.methodName" : "AUTOMATED_RESTORE"`. + + - If you provide this parameter, this endpoint restores all data up to this point in time to the database you specified in the **delivery** object. + - If you set **pointInTimeUTCMillis**, you can't set **oplogInc**, **oplogTs**, **snapshotId**, or **checkpointId**. + externalDocs: + description: UNIX Epoch + url: https://en.wikipedia.org/wiki/Unix_time + format: int64 + minimum: 1199145600000 + type: integer + writeOnly: true + snapshotId: + description: Unique 24-hexadecimal digit string that identifies the snapshot to restore. If you set **snapshotId**, you can't set **oplogInc**, **oplogTs**, **pointInTimeUTCMillis**, or **checkpointId**. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + statusName: + description: Human-readable label that identifies the status of the downloadable file at the time of the request. + readOnly: true + type: string + timestamp: + $ref: "#/components/schemas/ApiBSONTimestamp" + required: + - delivery + type: object + BackupRestoreJobDelivery: + description: Method and details that indicate how to deliver the restored snapshot data. + properties: + authHeader: + description: 'Header name to use when downloading the restore, used with `"delivery.methodName" : "HTTP"`.' + readOnly: true + type: string + authValue: + description: 'Header value to use when downloading the restore, used with `"delivery.methodName" : "HTTP"`.' + readOnly: true + type: string + expirationHours: + description: 'Number of hours after the restore job completes that indicates when the Uniform Resource Locator (URL) for the snapshot download file expires. The resource returns this parameter when `"delivery.methodName" : "HTTP"`.' + format: int32 + minimum: 1 + type: integer + expires: + description: 'Date and time when the Uniform Resource Locator (URL) for the snapshot download file expires. This parameter expresses its value in the ISO 8601 timestamp format in UTC. The resource returns this parameter when `"delivery.methodName" : "HTTP"`.' + format: date-time + readOnly: true + type: string + maxDownloads: + description: 'Positive integer that indicates how many times you can use the Uniform Resource Locator (URL) for the snapshot download file. The resource returns this parameter when `"delivery.methodName" : "HTTP"`.' + format: int32 + minimum: 1 + type: integer + methodName: + description: 'Human-readable label that identifies the means for delivering the data. If you set `"delivery.methodName" : "AUTOMATED_RESTORE"`, you must also set: **delivery.targetGroupId** and **delivery.targetClusterName** or **delivery.targetClusterId**. The response returns `"delivery.methodName" : "HTTP"` as an automated restore uses HyperText Transport Protocol (HTTP) to deliver the restore job to the target host.' + type: string + statusName: + description: State of the downloadable snapshot file when MongoDB Cloud received this request. + readOnly: true + type: string + targetClusterId: + description: |- + Unique 24-hexadecimal digit string that identifies the target cluster. Use the **clusterId** returned in the response body of the **Get All Snapshots** and **Get a Snapshot** endpoints. This parameter applies when `"delivery.methodName" : "AUTOMATED_RESTORE"`. + + If the target cluster doesn't have backup enabled, two resources return parameters with empty values: + + - **Get All Snapshots** endpoint returns an empty results array without **clusterId** elements + - **Get a Snapshot** endpoint doesn't return a **clusterId** parameter. + + To return a response with the **clusterId** parameter, either use the **delivery.targetClusterName** parameter or enable backup on the target cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + targetClusterName: + description: |- + Human-readable label that identifies the target cluster. Use the **clusterName** returned in the response body of the **Get All Snapshots** and **Get a Snapshot** endpoints. This parameter applies when `"delivery.methodName" : "AUTOMATED_RESTORE"`. + + If the target cluster doesn't have backup enabled, two resources return parameters with empty values: + + - **Get All Snapshots** endpoint returns an empty results array without **clusterId** elements + - **Get a Snapshot** endpoint doesn't return a **clusterId** parameter. + + To return a response with the **clusterId** parameter, either use the **delivery.targetClusterName** parameter or enable backup on the target cluster. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + targetGroupId: + description: 'Unique 24-hexadecimal digit string that identifies the project that contains the destination cluster for the restore job. The resource returns this parameter when `"delivery.methodName" : "AUTOMATED_RESTORE"`.' + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + url: + deprecated: true + description: 'Uniform Resource Locator (URL) from which you can download the restored snapshot data. Url includes the verification key. The resource returns this parameter when `"delivery.methodName" : "HTTP"`.' + readOnly: true + type: string + urlV2: + description: 'Uniform Resource Locator (URL) from which you can download the restored snapshot data. This should be preferred over **url**. The verification key must be sent as an HTTP header. The resource returns this parameter when `"delivery.methodName" : "HTTP"`.' + readOnly: true + type: string + required: + - methodName + title: Restore Snapshot Delivery Metadata + type: object + BackupSnapshot: + properties: + clusterId: + description: Unique 24-hexadecimal digit string that identifies the cluster with the snapshots you want to return. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + clusterName: + description: Human-readable label that identifies the cluster. + readOnly: true + type: string + complete: + description: Flag that indicates whether the snapshot exists. This flag returns `false` while MongoDB Cloud creates the snapshot. + readOnly: true + type: boolean + created: + $ref: "#/components/schemas/ApiBSONTimestamp" + doNotDelete: + description: "Flag that indicates whether someone can delete this snapshot. You can't set `\"doNotDelete\" : true` and set a timestamp for **expires** in the same request." + type: boolean + expires: + description: 'Date and time when MongoDB Cloud deletes the snapshot. If `"doNotDelete" : true`, MongoDB Cloud removes any value set for this parameter. This parameter expresses its value in the ISO 8601 timestamp format in UTC.' + format: date-time + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project that owns the snapshots. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + incremental: + description: Flag indicating if this is an incremental or a full snapshot. + readOnly: true + type: boolean + lastOplogAppliedTimestamp: + $ref: "#/components/schemas/ApiBSONTimestamp" + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + parts: + description: |- + Metadata that describes the complete snapshot. + + - For a replica set, this array contains a single document. + - For a sharded cluster, this array contains one document for each shard plus one document for the config host. + items: + $ref: "#/components/schemas/BackupSnapshotPart" + readOnly: true + type: array + type: object + BackupSnapshotPart: + description: Characteristics that identify this snapshot. + properties: + clusterId: + description: Unique 24-hexadecimal digit string that identifies the cluster with the snapshots you want to return. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + completedTime: + description: Date and time when the snapshot completed. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + compressionSetting: + description: Human-readable label that identifies the method of compression for the snapshot. + readOnly: true + type: string + dataSizeBytes: + description: Total size of the data stored on each node in the cluster. This parameter expresses its value in bytes. + format: int64 + readOnly: true + type: integer + encryptionEnabled: + description: Flag that indicates whether someone encrypted this snapshot. + readOnly: true + type: boolean + fcv: + description: Number that indicates the feature compatibility version of MongoDB that the replica set primary ran when MongoDB Cloud created the snapshot. + readOnly: true + type: string + fileSizeBytes: + description: Number that indicates the total size of the data files in bytes. + format: int64 + readOnly: true + type: integer + machineId: + description: Hostname and port that indicate the node on which MongoDB Cloud created the snapshot. + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + readOnly: true + type: string + masterKeyUUID: + description: 'Unique string that identifies the Key Management Interoperability (KMIP) master key used to encrypt the snapshot data. The resource returns this parameter when `"parts.encryptionEnabled" : true`.' + format: uuid + readOnly: true + type: string + mongodVersion: + description: Number that indicates the version of MongoDB that the replica set primary ran when MongoDB Cloud created the snapshot. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + replicaSetName: + description: Human-readable label that identifies the replica set. + readOnly: true + type: string + replicaState: + description: The node's role at the time when snapshot process began. + readOnly: true + type: string + storageSizeBytes: + description: Number that indicates the total size of space allocated for document storage. + format: int64 + readOnly: true + type: integer + typeName: + description: Human-readable label that identifies the type of server from which MongoDB Cloud took this snapshot. + readOnly: true + type: string + readOnly: true + title: Snapshot Components + type: object + BackupSnapshotRetention: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + retentionUnit: + description: Quantity of time in which MongoDB Cloud measures snapshot retention. + type: string + retentionValue: + description: Number that indicates the amount of days, weeks, months, or years that MongoDB Cloud retains the snapshot. For less frequent policy items, MongoDB Cloud requires that you specify a value greater than or equal to the value specified for more frequent policy items. If the hourly policy item specifies a retention of two days, specify two days or greater for the retention of the weekly policy item. + example: 5 + format: int32 + type: integer + required: + - retentionUnit + - retentionValue + type: object + BackupTenantSnapshot: + properties: + expiration: + description: Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + finishTime: + description: Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the restore job. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongoDBVersion: + description: MongoDB host version that the snapshot runs. + readOnly: true + type: string + scheduledTime: + description: Date and time when MongoDB Cloud will take the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + startTime: + description: Date and time when MongoDB Cloud began taking the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + status: + description: Phase of the workflow for this snapshot at the time this resource made this request. + readOnly: true + type: string + type: object + BadRequestDetail: + description: Bad request detail. + properties: + fields: + description: Describes all violations in a client request. + items: + $ref: "#/components/schemas/FieldViolation" + type: array + readOnly: true + type: object + BaseAtlasDataLakeRegion: + description: Name of the region to which the data lake routes client connections. + type: string + BaseCloudProviderInstanceSize: + description: Instance size boundary to which your cluster can automatically scale. + readOnly: true + type: string + BaseNetworkPeeringConnectionSettings: + properties: + containerId: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud network container that contains the specified network peering connection. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the network peering connection. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + providerName: + description: Cloud service provider that serves the requested network peering connection. + type: string + accepterRegionName: + description: Amazon Web Services (AWS) region where the Virtual Peering Connection (VPC) that you peered with the MongoDB Cloud VPC resides. The resource returns `null` if your VPC and the MongoDB Cloud VPC reside in the same region. + type: string + awsAccountId: + description: Unique twelve-digit string that identifies the Amazon Web Services (AWS) account that owns the VPC that you peered with the MongoDB Cloud VPC. + pattern: ^[0-9]{12}$ + type: string + connectionId: + description: Unique string that identifies the peering connection on AWS. + readOnly: true + type: string + errorStateName: + description: Type of error that can be returned when requesting an Amazon Web Services (AWS) peering connection. The resource returns `null` if the request succeeded. + readOnly: true + type: string + routeTableCidrBlock: + description: Internet Protocol (IP) addresses expressed in Classless Inter-Domain Routing (CIDR) notation of the VPC's subnet that you want to peer with the MongoDB Cloud VPC. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + statusName: + description: State of the network peering connection at the time you made the request. + readOnly: true + type: string + vpcId: + description: Unique string that identifies the VPC on Amazon Web Services (AWS) that you want to peer with the MongoDB Cloud VPC. + pattern: ^vpc-[0-9a-f]{17}$ + type: string + azureDirectoryId: + description: Unique string that identifies the Azure AD directory in which the VNet peered with the MongoDB Cloud VNet resides. + format: uuid + type: string + azureSubscriptionId: + description: Unique string that identifies the Azure subscription in which the VNet you peered with the MongoDB Cloud VNet resides. + format: uuid + type: string + errorState: + description: 'Error message returned when a requested Azure network peering resource returns `"status" : "FAILED"`. The resource returns `null` if the request succeeded.' + readOnly: true + type: string + resourceGroupName: + description: Human-readable label that identifies the resource group in which the VNet to peer with the MongoDB Cloud VNet resides. + pattern: ^([-\w._()])+$ + type: string + status: + description: State of the network peering connection at the time you made the request. + readOnly: true + type: string + vnetName: + description: Human-readable label that identifies the VNet that you want to peer with the MongoDB Cloud VNet. + pattern: ^([-\w._()])$ + type: string + errorMessage: + description: Details of the error returned when requesting a GCP network peering resource. The resource returns `null` if the request succeeded. + readOnly: true + type: string + gcpProjectId: + description: Human-readable label that identifies the GCP project that contains the network that you want to peer with the MongoDB Cloud VPC. + pattern: ^[a-z][0-9a-z-]{4,28}[0-9a-z]{1} + type: string + networkName: + description: Human-readable label that identifies the network to peer with the MongoDB Cloud VPC. + pattern: "[a-z]([-a-z0-9]{0,62}[a-z0-9]{0,1})?" + type: string + required: + - containerId + type: object + BaseStreamsRegion: + description: Name of the cloud provider region hosting Atlas Stream Processing. + type: string + BasicDBObject: + type: object + BiConnector: + description: Settings needed to configure the MongoDB Connector for Business Intelligence for this cluster. + externalDocs: + description: MongoDB Connector for Business Intelligence + url: https://docs.mongodb.com/bi-connector/current/ + properties: + enabled: + description: Flag that indicates whether MongoDB Connector for Business Intelligence is enabled on the specified cluster. + type: boolean + readPreference: + description: Data source node designated for the MongoDB Connector for Business Intelligence on MongoDB Cloud. The MongoDB Connector for Business Intelligence on MongoDB Cloud reads data from the primary, secondary, or analytics node based on your read preferences. Defaults to `ANALYTICS` node, or `SECONDARY` if there are no `ANALYTICS` nodes. + externalDocs: + description: Read preferences for BI Connector + url: https://docs.atlas.mongodb.com/cluster-config/enable-bic/#std-label-bic-read-preferences + type: string + title: MongoDB Connector for Business Intelligence Settings + type: object + BillingInvoice: + properties: + amountBilledCents: + description: Sum of services that the specified organization consumed in the period covered in this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + amountPaidCents: + description: Sum that the specified organization paid toward this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + created: + description: Date and time when MongoDB Cloud created this invoice. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + creditsCents: + description: Sum that MongoDB credited the specified organization toward this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + endDate: + description: Date and time when MongoDB Cloud finished the billing period that this invoice covers. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the invoice submitted to the specified organization. Charges typically post the next day. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lineItems: + description: List that contains individual services included in this invoice. + items: + $ref: "#/components/schemas/InvoiceLineItem" + readOnly: true + type: array + linkedInvoices: + description: List that contains the invoices for organizations linked to the paying organization. + items: + $ref: "#/components/schemas/BillingInvoice" + readOnly: true + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + orgId: + description: Unique 24-hexadecimal digit string that identifies the organization charged for services consumed from MongoDB Cloud. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + payments: + description: List that contains funds transferred to MongoDB to cover the specified service noted in this invoice. + items: + $ref: "#/components/schemas/BillingPayment" + readOnly: true + type: array + refunds: + description: List that contains payments that MongoDB returned to the organization for this invoice. + items: + $ref: "#/components/schemas/BillingRefund" + readOnly: true + type: array + salesTaxCents: + description: Sum of sales tax applied to this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + startDate: + description: Date and time when MongoDB Cloud began the billing period that this invoice covers. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + startingBalanceCents: + description: Sum that the specified organization owed to MongoDB when MongoDB issued this invoice. This parameter expresses its value in US Dollars. + format: int64 + readOnly: true + type: integer + statusName: + description: |- + Phase of payment processing in which this invoice exists when you made this request. Accepted phases include: + + - `CLOSED`: MongoDB finalized all charges in the billing cycle but has yet to charge the customer. + - `FAILED`: MongoDB attempted to charge the provided credit card but charge for that amount failed. + - `FORGIVEN`: Customer initiated payment which MongoDB later forgave. + - `FREE`: All charges totalled zero so the customer won't be charged. + - `INVOICED`: MongoDB handled these charges using elastic invoicing. + - `PAID`: MongoDB succeeded in charging the provided credit card. + - `PENDING`: Invoice includes charges for the current billing cycle. + - `PREPAID`: Customer has a pre-paid plan so they won't be charged. + type: string + subtotalCents: + description: Sum of all positive invoice line items contained in this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + updated: + description: Date and time when MongoDB Cloud last updated the value of this payment. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + type: object + BillingInvoiceMetadata: + properties: + amountBilledCents: + description: Sum of services that the specified organization consumed in the period covered in this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + amountPaidCents: + description: Sum that the specified organization paid toward this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + created: + description: Date and time when MongoDB Cloud created this invoice. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + creditsCents: + description: Sum that MongoDB credited the specified organization toward this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + endDate: + description: Date and time when MongoDB Cloud finished the billing period that this invoice covers. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the invoice submitted to the specified organization. Charges typically post the next day. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + linkedInvoices: + description: List that contains the invoices for organizations linked to the paying organization. + items: + $ref: "#/components/schemas/BillingInvoiceMetadata" + readOnly: true + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + orgId: + description: Unique 24-hexadecimal digit string that identifies the organization charged for services consumed from MongoDB Cloud. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + salesTaxCents: + description: Sum of sales tax applied to this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + startDate: + description: Date and time when MongoDB Cloud began the billing period that this invoice covers. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + startingBalanceCents: + description: Sum that the specified organization owed to MongoDB when MongoDB issued this invoice. This parameter expresses its value in US Dollars. + format: int64 + readOnly: true + type: integer + statusName: + description: |- + Phase of payment processing in which this invoice exists when you made this request. Accepted phases include: + + - `CLOSED`: MongoDB finalized all charges in the billing cycle but has yet to charge the customer. + - `FAILED`: MongoDB attempted to charge the provided credit card but charge for that amount failed. + - `FORGIVEN`: Customer initiated payment which MongoDB later forgave. + - `FREE`: All charges totalled zero so the customer won't be charged. + - `INVOICED`: MongoDB handled these charges using elastic invoicing. + - `PAID`: MongoDB succeeded in charging the provided credit card. + - `PENDING`: Invoice includes charges for the current billing cycle. + - `PREPAID`: Customer has a pre-paid plan so they won't be charged. + type: string + subtotalCents: + description: Sum of all positive invoice line items contained in this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + updated: + description: Date and time when MongoDB Cloud last updated the value of this payment. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + type: object + BillingPayment: + description: Funds transferred to MongoDB to cover the specified service in this invoice. + properties: + amountBilledCents: + description: Sum of services that the specified organization consumed in the period covered in this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + amountPaidCents: + description: Sum that the specified organization paid toward the associated invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + created: + description: Date and time when the customer made this payment attempt. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + currency: + description: The currency in which payment was paid. This parameter expresses its value in 3-letter ISO 4217 currency code. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies this payment toward the associated invoice. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + salesTaxCents: + description: Sum of sales tax applied to this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + statusName: + description: |- + Phase of payment processing for the associated invoice when you made this request. These phases include: + + - `CANCELLED`: Customer or MongoDB cancelled the payment. + - `ERROR`: Issue arose when attempting to complete payment. + - `FAILED`: MongoDB tried to charge the credit card without success. + - `FAILED_AUTHENTICATION`: Strong Customer Authentication has failed. Confirm that your payment method is authenticated. + - `FORGIVEN`: Customer initiated payment which MongoDB later forgave. + - `INVOICED`: MongoDB issued an invoice that included this line item. + - `NEW`: Customer provided a method of payment, but MongoDB hasn't tried to charge the credit card. + - `PAID`: Customer submitted a successful payment. + - `PARTIAL_PAID`: Customer paid for part of this line item. + type: string + subtotalCents: + description: Sum of all positive invoice line items contained in this invoice. This parameter expresses its value in cents (100ths of one US Dollar). + format: int64 + readOnly: true + type: integer + unitPrice: + description: The unit price applied to amountBilledCents to compute total payment amount. This value is represented as a decimal string. + readOnly: true + type: string + updated: + description: Date and time when the customer made an update to this payment attempt. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + title: Payment + type: object + BillingRefund: + description: One payment that MongoDB returned to the organization for this invoice. + properties: + amountCents: + description: Sum of the funds returned to the specified organization expressed in cents (100th of US Dollar). + format: int64 + readOnly: true + type: integer + created: + description: Date and time when MongoDB Cloud created this refund. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + paymentId: + description: Unique 24-hexadecimal digit string that identifies the payment that the organization had made. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + reason: + description: Justification that MongoDB accepted to return funds to the organization. + readOnly: true + type: string + title: Refund + type: object + CloudAccessRoleAssignment: + description: MongoDB Cloud user's roles and the corresponding organization or project to which that role applies. Each role can apply to one organization or one project but not both. + properties: + groupId: + description: Unique 24-hexadecimal digit string that identifies the project to which this role belongs. You can set a value for this parameter or **orgId** but not both in the same request. + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + type: string + orgId: + description: Unique 24-hexadecimal digit string that identifies the organization to which this role belongs. You can set a value for this parameter or **groupId** but not both in the same request. + example: 32b6e34b3d91647abb20e7b8 + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + type: string + roleName: + description: Human-readable label that identifies the collection of privileges that MongoDB Cloud grants a specific API key, MongoDB Cloud user, or MongoDB Cloud team. These roles include organization- and project-level roles. + type: string + title: Role Assignment + type: object + CloudAppUser: + properties: + country: + description: Two alphabet characters that identifies MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format. + pattern: ^([A-Z]{2})$ + type: string + createdAt: + description: Date and time when the current account is created. This value is in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + emailAddress: + deprecated: true + description: Email address that belongs to the MongoDB Cloud user. + format: email + readOnly: true + type: string + firstName: + description: First or given name that belongs to the MongoDB Cloud user. + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lastAuth: + description: Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + lastName: + description: Last name, family name, or surname that belongs to the MongoDB Cloud user. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mobileNumber: + description: Mobile phone number that belongs to the MongoDB Cloud user. + pattern: (?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})$ + type: string + password: + description: Password applied with the username to log in to MongoDB Cloud. MongoDB Cloud does not return this parameter except in response to creating a new MongoDB Cloud user. Only the MongoDB Cloud user can update their password after it has been set from the MongoDB Cloud console. + format: password + minLength: 8 + type: string + roles: + description: List of objects that display the MongoDB Cloud user's roles and the corresponding organization or project to which that role applies. A role can apply to one organization or one project but not both. + items: + $ref: "#/components/schemas/CloudAccessRoleAssignment" + type: array + teamIds: + description: List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs. + items: + description: Unique 24-hexadecimal digit string that identifies the team to which this MongoDB Cloud user belongs. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + readOnly: true + type: array + uniqueItems: true + username: + description: Email address that represents the username of the MongoDB Cloud user. + format: email + type: string + required: + - country + - emailAddress + - firstName + - lastName + - mobileNumber + - password + - username + type: object + CloudCluster: + description: Settings that describe the clusters in each project that the API key is authorized to view. + properties: + alertCount: + description: Whole number that indicates the quantity of alerts open on the cluster. + format: int32 + readOnly: true + type: integer + authEnabled: + description: Flag that indicates whether authentication is required to access the nodes in this cluster. + readOnly: true + type: boolean + availability: + description: Term that expresses how many nodes of the cluster can be accessed when MongoDB Cloud receives this request. This parameter returns `available` when all nodes are accessible, `warning` only when some nodes in the cluster can be accessed, `unavailable` when the cluster can't be accessed, or `dead` when the cluster has been deactivated. + readOnly: true + type: string + backupEnabled: + description: Flag that indicates whether the cluster can perform backups. If set to `true`, the cluster can perform backups. You must set this value to `true` for NVMe clusters. Backup uses Cloud Backups for dedicated clusters and Shared Cluster Backups for tenant clusters. If set to `false`, the cluster doesn't use MongoDB Cloud backups. + readOnly: true + type: boolean + clusterId: + description: Unique 24-hexadecimal character string that identifies the cluster. Each ``clusterId`` is used only once across all MongoDB Cloud deployments. + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + dataSizeBytes: + description: Total size of the data stored on each node in the cluster. The resource expresses this value in bytes. + format: int64 + readOnly: true + type: integer + name: + description: Human-readable label that identifies the cluster. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + nodeCount: + description: Whole number that indicates the quantity of nodes that comprise the cluster. + format: int32 + readOnly: true + type: integer + sslEnabled: + description: Flag that indicates whether TLS authentication is required to access the nodes in this cluster. + readOnly: true + type: boolean + type: + description: Human-readable label that indicates the cluster type. + readOnly: true + type: string + versions: + description: List that contains the versions of MongoDB that each node in the cluster runs. + items: + type: string + readOnly: true + type: array + uniqueItems: true + readOnly: true + type: object + CloudDatabaseUser: + properties: + awsIAMType: + default: NONE + description: Human-readable label that indicates whether the new database user authenticates with the Amazon Web Services (AWS) Identity and Access Management (IAM) credentials associated with the user or the user's role. + type: string + databaseName: + default: admin + description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. + type: string + deleteAfterDate: + description: Date and time when MongoDB Cloud deletes the user. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. You must specify a future date that falls within one week of making the Application Programming Interface (API) request. + format: date-time + type: string + description: + description: Description of this database user. + maxLength: 100 + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. + type: string + writeOnly: true + labels: + description: List that contains the key-value pairs for tagging and categorizing the MongoDB database user. The labels that you define do not appear in the console. + items: + $ref: "#/components/schemas/ComponentLabel" + type: array + ldapAuthType: + default: NONE + description: Part of the Lightweight Directory Access Protocol (LDAP) record that the database uses to authenticate this database user on the LDAP host. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + oidcAuthType: + default: NONE + description: Human-readable label that indicates whether the new database user or group authenticates with OIDC federated authentication. To create a federated authentication user, specify the value of USER in this field. To create a federated authentication group, specify the value of IDP_GROUP in this field. + type: string + password: + description: Alphanumeric string that authenticates this database user against the database specified in `databaseName`. To authenticate with SCRAM-SHA, you must specify this parameter. This parameter doesn't appear in this response. + externalDocs: + description: SCRAM-SHA + url: https://docs.mongodb.com/manual/core/security-scram/ + minLength: 8 + type: string + writeOnly: true + roles: + description: List that provides the pairings of one role with one applicable database. + items: + $ref: "#/components/schemas/DatabaseUserRole" + type: array + scopes: + description: List that contains clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances that this database user can access. If omitted, MongoDB Cloud grants the database user access to all the clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances in the project. + items: + $ref: "#/components/schemas/UserScope" + type: array + username: + description: | + Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: + + | Authentication Method | Parameter Needed | Parameter Value | username Format | + |---|---|---|---| + | AWS IAM | awsIAMType | ROLE | ARN | + | AWS IAM | awsIAMType | USER | ARN | + | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | + | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | + | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | + maxLength: 1024 + type: string + x509Type: + default: NONE + description: |- + X.509 method that MongoDB Cloud uses to authenticate the database user. + + - For application-managed X.509, specify `MANAGED`. + - For self-managed X.509, specify `CUSTOMER`. + + Users created with the `CUSTOMER` method require a Common Name (CN) in the **username** parameter. You must create externally authenticated users on the `$external` database. + type: string + required: + - databaseName + - groupId + - username + type: object + CloudProviderAccessAWSIAMRole: + allOf: + - $ref: "#/components/schemas/CloudProviderAccessRole" + - properties: + atlasAWSAccountArn: + description: Amazon Resource Name that identifies the Amazon Web Services (AWS) user account that MongoDB Cloud uses when it assumes the Identity and Access Management (IAM) role. + example: arn:aws:iam::772401394250:role/my-test-aws-role + maxLength: 2048 + minLength: 20 + readOnly: true + type: string + atlasAssumedRoleExternalId: + description: Unique external ID that MongoDB Cloud uses when it assumes the IAM role in your Amazon Web Services (AWS) account. + format: uuid + readOnly: true + type: string + authorizedDate: + description: Date and time when someone authorized this role for the specified cloud service provider. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + createdDate: + description: Date and time when someone created this role for the specified cloud service provider. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + featureUsages: + description: List that contains application features associated with this Amazon Web Services (AWS) Identity and Access Management (IAM) role. + items: + $ref: "#/components/schemas/CloudProviderAccessFeatureUsage" + readOnly: true + type: array + iamAssumedRoleArn: + description: Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account. + example: arn:aws:iam::123456789012:root + maxLength: 2048 + minLength: 20 + type: string + roleId: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + type: object + description: Details that describe the features linked to the Amazon Web Services (AWS) Identity and Access Management (IAM) role. + required: + - providerName + type: object + properties: + atlasAWSAccountArn: + description: Amazon Resource Name that identifies the Amazon Web Services (AWS) user account that MongoDB Cloud uses when it assumes the Identity and Access Management (IAM) role. + example: arn:aws:iam::772401394250:role/my-test-aws-role + maxLength: 2048 + minLength: 20 + readOnly: true + type: string + atlasAssumedRoleExternalId: + description: Unique external ID that MongoDB Cloud uses when it assumes the IAM role in your Amazon Web Services (AWS) account. + format: uuid + readOnly: true + type: string + authorizedDate: + description: Date and time when someone authorized this role for the specified cloud service provider. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + createdDate: + description: Date and time when someone created this role for the specified cloud service provider. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + featureUsages: + description: List that contains application features associated with this Amazon Web Services (AWS) Identity and Access Management (IAM) role. + items: + $ref: "#/components/schemas/CloudProviderAccessFeatureUsage" + readOnly: true + type: array + iamAssumedRoleArn: + description: Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account. + example: arn:aws:iam::123456789012:root + maxLength: 2048 + minLength: 20 + type: string + roleId: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + CloudProviderAccessAzureServicePrincipal: + allOf: + - $ref: "#/components/schemas/CloudProviderAccessRole" + - properties: + _id: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + atlasAzureAppId: + description: Azure Active Directory Application ID of Atlas. + format: uuid + type: string + createdDate: + description: Date and time when this Azure Service Principal was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + featureUsages: + description: List that contains application features associated with this Azure Service Principal. + items: + $ref: "#/components/schemas/CloudProviderAccessFeatureUsage" + readOnly: true + type: array + lastUpdatedDate: + description: Date and time when this Azure Service Principal was last updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + servicePrincipalId: + description: UUID string that identifies the Azure Service Principal. + format: uuid + type: string + tenantId: + description: UUID String that identifies the Azure Active Directory Tenant ID. + format: uuid + type: string + type: object + description: Details that describe the features linked to the Azure Service Principal. + required: + - providerName + type: object + properties: + _id: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + atlasAzureAppId: + description: Azure Active Directory Application ID of Atlas. + format: uuid + type: string + createdDate: + description: Date and time when this Azure Service Principal was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + featureUsages: + description: List that contains application features associated with this Azure Service Principal. + items: + $ref: "#/components/schemas/CloudProviderAccessFeatureUsage" + readOnly: true + type: array + lastUpdatedDate: + description: Date and time when this Azure Service Principal was last updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + servicePrincipalId: + description: UUID string that identifies the Azure Service Principal. + format: uuid + type: string + tenantId: + description: UUID String that identifies the Azure Active Directory Tenant ID. + format: uuid + type: string + CloudProviderAccessFeatureUsage: + description: MongoDB Cloud features associated with this Amazon Web Services (AWS) Identity and Access Management (IAM) role. + properties: + featureType: + description: Human-readable label that describes one MongoDB Cloud feature linked to this Amazon Web Services (AWS) Identity and Access Management (IAM) role. + readOnly: true + type: string + featureId: + $ref: "#/components/schemas/CloudProviderAccessFeatureUsagePushBasedLogExportFeatureId" + type: object + CloudProviderAccessFeatureUsagePushBasedLogExportFeatureId: + description: Identifying characteristics about the Amazon Web Services (AWS) Simple Storage Service (S3) export bucket linked to this AWS Identity and Access Management (IAM) role. + properties: + bucketName: + description: Name of the AWS S3 bucket to which your logs will be exported to. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies your project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + type: object + CloudProviderAccessRole: + description: Cloud provider access role. + properties: + providerName: + description: Human-readable label that identifies the cloud provider of the role. + type: string + atlasAWSAccountArn: + description: Amazon Resource Name that identifies the Amazon Web Services (AWS) user account that MongoDB Cloud uses when it assumes the Identity and Access Management (IAM) role. + example: arn:aws:iam::772401394250:role/my-test-aws-role + maxLength: 2048 + minLength: 20 + readOnly: true + type: string + atlasAssumedRoleExternalId: + description: Unique external ID that MongoDB Cloud uses when it assumes the IAM role in your Amazon Web Services (AWS) account. + format: uuid + readOnly: true + type: string + authorizedDate: + description: Date and time when someone authorized this role for the specified cloud service provider. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + createdDate: + description: Date and time when this Google Service Account was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + featureUsages: + description: List that contains application features associated with this Google Service Account. + items: + $ref: "#/components/schemas/CloudProviderAccessFeatureUsage" + readOnly: true + type: array + iamAssumedRoleArn: + description: Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account. + example: arn:aws:iam::123456789012:root + maxLength: 2048 + minLength: 20 + type: string + roleId: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + _id: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + atlasAzureAppId: + description: Azure Active Directory Application ID of Atlas. + format: uuid + type: string + lastUpdatedDate: + description: Date and time when this Azure Service Principal was last updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + servicePrincipalId: + description: UUID string that identifies the Azure Service Principal. + format: uuid + type: string + tenantId: + description: UUID String that identifies the Azure Active Directory Tenant ID. + format: uuid + type: string + gcpServiceAccountForAtlas: + description: Email address for the Google Service Account created by Atlas. + pattern: ^mongodb-atlas-[0-9a-z]{16}@p-[0-9a-z]{24}.iam.gserviceaccount.com$ + type: string + required: + - providerName + type: object + CloudProviderAccessRoleRequest: + description: Cloud provider access role. + properties: + providerName: + description: Human-readable label that identifies the cloud provider of the role. + type: string + atlasAWSAccountArn: + description: Amazon Resource Name that identifies the Amazon Web Services (AWS) user account that MongoDB Cloud uses when it assumes the Identity and Access Management (IAM) role. + example: arn:aws:iam::772401394250:role/my-test-aws-role + maxLength: 2048 + minLength: 20 + readOnly: true + type: string + atlasAssumedRoleExternalId: + description: Unique external ID that MongoDB Cloud uses when it assumes the IAM role in your Amazon Web Services (AWS) account. + format: uuid + readOnly: true + type: string + authorizedDate: + description: Date and time when someone authorized this role for the specified cloud service provider. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + createdDate: + description: Date and time when this GCP Service Account was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + featureUsages: + description: List that contains application features associated with this GCP Service Account. + items: + $ref: "#/components/schemas/CloudProviderAccessFeatureUsage" + readOnly: true + type: array + roleId: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + _id: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + atlasAzureAppId: + description: Azure Active Directory Application ID of Atlas. + format: uuid + type: string + lastUpdatedDate: + description: Date and time when this Azure Service Principal was last updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + servicePrincipalId: + description: UUID string that identifies the Azure Service Principal. + format: uuid + type: string + tenantId: + description: UUID String that identifies the Azure Active Directory Tenant ID. + format: uuid + type: string + gcpServiceAccountForAtlas: + description: ID string that identifies the GCP Service Account used by Atlas. + readOnly: true + type: string + required: + - providerName + type: object + CloudProviderAccessRoleRequestUpdate: + description: Cloud provider access role. + properties: + providerName: + description: Human-readable label that identifies the cloud provider of the role. + type: string + atlasAWSAccountArn: + description: Amazon Resource Name that identifies the Amazon Web Services (AWS) user account that MongoDB Cloud uses when it assumes the Identity and Access Management (IAM) role. + example: arn:aws:iam::772401394250:role/my-test-aws-role + maxLength: 2048 + minLength: 20 + readOnly: true + type: string + atlasAssumedRoleExternalId: + description: Unique external ID that MongoDB Cloud uses when it assumes the IAM role in your Amazon Web Services (AWS) account. + format: uuid + readOnly: true + type: string + authorizedDate: + description: Date and time when someone authorized this role for the specified cloud service provider. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + createdDate: + description: Date and time when this Azure Service Principal was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + featureUsages: + description: List that contains application features associated with this Azure Service Principal. + items: + $ref: "#/components/schemas/CloudProviderAccessFeatureUsage" + readOnly: true + type: array + iamAssumedRoleArn: + description: Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account. + example: arn:aws:iam::123456789012:root + maxLength: 2048 + minLength: 20 + type: string + roleId: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + _id: + description: Unique 24-hexadecimal digit string that identifies the role. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + atlasAzureAppId: + description: Azure Active Directory Application ID of Atlas. + format: uuid + type: string + lastUpdatedDate: + description: Date and time when this Azure Service Principal was last updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + servicePrincipalId: + description: UUID string that identifies the Azure Service Principal. + format: uuid + type: string + tenantId: + description: UUID String that identifies the Azure Active Directory Tenant ID. + format: uuid + type: string + required: + - providerName + type: object + CloudProviderAccessRoles: + properties: + awsIamRoles: + description: List that contains the Amazon Web Services (AWS) IAM roles registered and authorized with MongoDB Cloud. + items: + $ref: "#/components/schemas/CloudProviderAccessAWSIAMRole" + type: array + azureServicePrincipals: + description: List that contains the Azure Service Principals registered with MongoDB Cloud. + items: + $ref: "#/components/schemas/CloudProviderAccessAzureServicePrincipal" + type: array + type: object + CloudProviderContainer: + description: Collection of settings that configures the network container for a virtual private connection on Amazon Web Services. + properties: + id: + description: Unique 24-hexadecimal digit string that identifies the network peering container. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + providerName: + description: Cloud service provider that serves the requested network peering containers. + type: string + provisioned: + description: Flag that indicates whether MongoDB Cloud clusters exist in the specified network peering container. + readOnly: true + type: boolean + atlasCidrBlock: + description: |- + IP addresses expressed in Classless Inter-Domain Routing (CIDR) notation that MongoDB Cloud uses for the network peering containers in your project. MongoDB Cloud assigns all of the project's clusters deployed to this cloud provider an IP address from this range. MongoDB Cloud locks this value if an M10 or greater cluster or a network peering connection exists in this project. + + These CIDR blocks must fall within the ranges reserved per RFC 1918. AWS and Azure further limit the block to between the `/24` and `/21` ranges. + + To modify the CIDR block, the target project cannot have: + + - Any M10 or greater clusters + - Any other VPC peering connections + + You can also create a new project and create a network peering connection to set the desired MongoDB Cloud network peering container CIDR block for that project. MongoDB Cloud limits the number of MongoDB nodes per network peering connection based on the CIDR block and the region selected for the project. + + **Example:** A project in an Amazon Web Services (AWS) region supporting three availability zones and an MongoDB CIDR network peering container block of limit of `/24` equals 27 three-node replica sets. + pattern: ^((([0-9]{1,3}\.){3}[0-9]{1,3})|(:{0,2}([0-9a-f]{1,4}:){0,7}[0-9a-f]{1,4}[:]{0,2}))((%2[fF]|/)[0-9]{1,3})+$ + type: string + azureSubscriptionId: + description: Unique string that identifies the Azure subscription in which the MongoDB Cloud VNet resides. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + region: + description: Azure region to which MongoDB Cloud deployed this network peering container. + type: string + vnetName: + description: Unique string that identifies the Azure VNet in which MongoDB Cloud clusters in this network peering container exist. The response returns **null** if no clusters exist in this network peering container. + pattern: ^([-\w._()])$ + readOnly: true + type: string + gcpProjectId: + description: Unique string that identifies the GCP project in which MongoDB Cloud clusters in this network peering container exist. The response returns **null** if no clusters exist in this network peering container. + pattern: ^p-[0-9a-z]{24}$ + readOnly: true + type: string + networkName: + description: Human-readable label that identifies the network in which MongoDB Cloud clusters in this network peering container exist. MongoDB Cloud returns **null** if no clusters exist in this network peering container. + pattern: ^nt-[0-9a-f]{24}-[0-9a-z]{8}$ + readOnly: true + type: string + regions: + description: List of GCP regions to which you want to deploy this MongoDB Cloud network peering container. In this MongoDB Cloud project, you can deploy clusters only to the GCP regions in this list. To deploy MongoDB Cloud clusters to other GCP regions, create additional projects. + items: + description: List of GCP regions to which you want to deploy this MongoDB Cloud network peering container. In this MongoDB Cloud project, you can deploy clusters only to the GCP regions in this list. To deploy MongoDB Cloud clusters to other GCP regions, create additional projects. + type: string + x-xgen-IPA-exception: + xgen-IPA-123-allowable-enum-values-should-not-exceed-20: Schema predates IPA validation + type: array + regionName: + description: Geographic area that Amazon Web Services (AWS) defines to which MongoDB Cloud deployed this network peering container. + type: string + vpcId: + description: Unique string that identifies the MongoDB Cloud VPC on AWS. + example: vpc-b555d3b0d9cb783b0 + pattern: ^vpc-[0-9a-f]{17}$ + readOnly: true + type: string + type: object + CloudProviderEndpointServiceRequest: + properties: + providerName: + description: Human-readable label that identifies the cloud service provider for which you want to create the private endpoint service. + type: string + writeOnly: true + region: + description: Cloud provider region in which you want to create the private endpoint service. Regions accepted as values differ for [Amazon Web Services](https://docs.atlas.mongodb.com/reference/amazon-aws/), [Google Cloud Platform](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Microsoft Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/). + type: string + writeOnly: true + required: + - providerName + - region + type: object + CloudProviderRegions: + properties: + instanceSizes: + description: List of instances sizes that this cloud provider supports. + items: + $ref: "#/components/schemas/ClusterCloudProviderInstanceSize" + readOnly: true + type: array + provider: + description: Human-readable label that identifies the Cloud provider. + type: string + type: object + CloudRegionConfig20240805: + description: Cloud service provider on which MongoDB Cloud provisions the hosts. + properties: + electableSpecs: + $ref: "#/components/schemas/HardwareSpec20240805" + priority: + description: |- + Precedence is given to this region when a primary election occurs. If your **regionConfigs** has only **readOnlySpecs**, **analyticsSpecs**, or both, set this value to `0`. If you have multiple **regionConfigs** objects (your cluster is multi-region or multi-cloud), they must have priorities in descending order. The highest priority is `7`. + + **Example:** If you have three regions, their priorities would be `7`, `6`, and `5` respectively. If you added two more regions for supporting electable nodes, the priorities of those regions would be `4` and `3` respectively. + format: int32 + maximum: 7 + minimum: 0 + type: integer + providerName: + description: Cloud service provider on which MongoDB Cloud provisions the hosts. Set dedicated clusters to `AWS`, `GCP`, `AZURE` or `TENANT`. + type: string + regionName: + description: Physical location of your MongoDB cluster nodes. The region you choose can affect network latency for clients accessing your databases. The region name is only returned in the response for single-region clusters. When MongoDB Cloud deploys a dedicated cluster, it checks if a VPC or VPC connection exists for that provider and region. If not, MongoDB Cloud creates them as part of the deployment. It assigns the VPC a Classless Inter-Domain Routing (CIDR) block. To limit a new VPC peering connection to one Classless Inter-Domain Routing (CIDR) block and region, create the connection first. Deploy the cluster after the connection starts. GCP Clusters and Multi-region clusters require one VPC peering connection for each region. MongoDB nodes can use only the peering connection that resides in the same region as the nodes to communicate with the peered VPC. + type: string + analyticsAutoScaling: + $ref: "#/components/schemas/AdvancedAutoScalingSettings" + analyticsSpecs: + $ref: "#/components/schemas/DedicatedHardwareSpec20240805" + autoScaling: + $ref: "#/components/schemas/AdvancedAutoScalingSettings" + readOnlySpecs: + $ref: "#/components/schemas/DedicatedHardwareSpec20240805" + backingProviderName: + description: |- + Cloud service provider on which MongoDB Cloud provisioned the multi-tenant cluster. The resource returns this parameter when **providerName** is `TENANT` and **electableSpecs.instanceSize** is `M0`, `M2` or `M5`. + + Please note that using an instanceSize of M2 or M5 will create a Flex cluster instead. Support for the instanceSize of M2 or M5 will be discontinued in January 2026. We recommend using the createFlexCluster API for such configurations moving forward. + externalDocs: + description: createFlexCluster API + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/createFlexCluster + type: string + title: Cloud Service Provider Settings + type: object + CloudSearchMetrics: + properties: + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + hardwareMetrics: + description: List that contains all host compute, memory, and storage utilization dedicated to Atlas Search when MongoDB Atlas received this request. + items: + $ref: "#/components/schemas/FTSMetric" + readOnly: true + type: array + indexMetrics: + description: List that contains all performance and utilization measurements that Atlas Search index performed by the time MongoDB Atlas received this request. + items: + $ref: "#/components/schemas/FTSMetric" + readOnly: true + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + processId: + description: Hostname and port that identifies the process. + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + readOnly: true + type: string + statusMetrics: + description: List that contains all available Atlas Search status metrics when MongoDB Atlas received this request. + items: + $ref: "#/components/schemas/FTSMetric" + readOnly: true + type: array + required: + - groupId + - processId + type: object + ClusterAutoScalingSettings: + description: Range of instance sizes to which your cluster can scale. + externalDocs: + description: Cluster Auto-Scaling + url: https://docs.atlas.mongodb.com/cluster-autoscaling/ + properties: + compute: + $ref: "#/components/schemas/ClusterComputeAutoScaling" + diskGBEnabled: + default: false + description: Flag that indicates whether someone enabled disk auto-scaling for this cluster. + type: boolean + title: Automatic Cluster Scaling Settings + type: object + ClusterCloudProviderInstanceSize: + properties: + availableRegions: + description: List of regions that this cloud provider supports for this instance size. + items: + $ref: "#/components/schemas/AvailableCloudProviderRegion" + readOnly: true + type: array + name: + description: Human-readable label that identifies the instance size or cluster tier. + readOnly: true + type: string + type: object + ClusterComputeAutoScaling: + description: Collection of settings that configures how a cluster might scale its cluster tier and whether the cluster can scale down. Cluster tier auto-scaling is unavailable for clusters using Low CPU or NVME storage classes. + properties: + enabled: + default: false + description: |- + Flag that indicates whether instance size reactive auto-scaling is enabled. + + - Set to `true` to enable instance size reactive auto-scaling. If enabled, you must specify a value for **providerSettings.autoScaling.compute.maxInstanceSize**. + - Set to `false` to disable instance size reactive auto-scaling. + type: boolean + predictiveEnabled: + default: false + description: |- + Flag that indicates whether predictive instance size auto-scaling is enabled. + + - Set to `true` to enable predictive instance size auto-scaling. MongoDB Cloud requires **autoScaling.compute.enabled** is `true` in order to enable this feature. + - Set to `false` to disable predictive instance size auto-scaling. + type: boolean + scaleDownEnabled: + default: false + description: Flag that indicates whether the cluster tier can scale down via reactive auto-scaling. This is required if **autoScaling.compute.enabled** is `true`. If you enable this option, specify a value for **providerSettings.autoScaling.compute.minInstanceSize**. + type: boolean + type: object + ClusterConnectionStrings: + description: Collection of Uniform Resource Locators that point to the MongoDB database. + externalDocs: + description: Connection string URI format. + url: https://docs.mongodb.com/manual/reference/connection-string/ + properties: + awsPrivateLink: + additionalProperties: + description: Private endpoint-aware connection strings that use AWS-hosted clusters with Amazon Web Services (AWS) PrivateLink. Each key identifies an Amazon Web Services (AWS) interface endpoint. Each value identifies the related `mongodb://` connection string that you use to connect to MongoDB Cloud through the interface endpoint that the key names. + externalDocs: + description: Network Peering Connection + url: https://docs.atlas.mongodb.com/security-vpc-peering/#std-label-vpc-peering/ + readOnly: true + type: string + description: Private endpoint-aware connection strings that use AWS-hosted clusters with Amazon Web Services (AWS) PrivateLink. Each key identifies an Amazon Web Services (AWS) interface endpoint. Each value identifies the related `mongodb://` connection string that you use to connect to MongoDB Cloud through the interface endpoint that the key names. + externalDocs: + description: Network Peering Connection + url: https://docs.atlas.mongodb.com/security-vpc-peering/#std-label-vpc-peering/ + readOnly: true + type: object + awsPrivateLinkSrv: + additionalProperties: + description: Private endpoint-aware connection strings that use AWS-hosted clusters with Amazon Web Services (AWS) PrivateLink. Each key identifies an Amazon Web Services (AWS) interface endpoint. Each value identifies the related `mongodb://` connection string that you use to connect to Atlas through the interface endpoint that the key names. If the cluster uses an optimized connection string, `awsPrivateLinkSrv` contains the optimized connection string. If the cluster has the non-optimized (legacy) connection string, `awsPrivateLinkSrv` contains the non-optimized connection string even if an optimized connection string is also present. + externalDocs: + description: Network Peering Connection + url: https://docs.atlas.mongodb.com/security-vpc-peering/#std-label-vpc-peering/ + readOnly: true + type: string + description: Private endpoint-aware connection strings that use AWS-hosted clusters with Amazon Web Services (AWS) PrivateLink. Each key identifies an Amazon Web Services (AWS) interface endpoint. Each value identifies the related `mongodb://` connection string that you use to connect to Atlas through the interface endpoint that the key names. If the cluster uses an optimized connection string, `awsPrivateLinkSrv` contains the optimized connection string. If the cluster has the non-optimized (legacy) connection string, `awsPrivateLinkSrv` contains the non-optimized connection string even if an optimized connection string is also present. + externalDocs: + description: Network Peering Connection + url: https://docs.atlas.mongodb.com/security-vpc-peering/#std-label-vpc-peering/ + readOnly: true + type: object + private: + description: Network peering connection strings for each interface Virtual Private Cloud (VPC) endpoint that you configured to connect to this cluster. This connection string uses the `mongodb+srv://` protocol. The resource returns this parameter once someone creates a network peering connection to this cluster. This protocol tells the application to look up the host seed list in the Domain Name System (DNS). This list synchronizes with the nodes in a cluster. If the connection string uses this Uniform Resource Identifier (URI) format, you don't need to append the seed list or change the URI if the nodes change. Use this URI format if your driver supports it. If it doesn't, use connectionStrings.private. For Amazon Web Services (AWS) clusters, this resource returns this parameter only if you enable custom DNS. + externalDocs: + description: Network Peering Connection + url: https://docs.atlas.mongodb.com/security-vpc-peering/#std-label-vpc-peering/ + readOnly: true + type: string + privateEndpoint: + description: List of private endpoint-aware connection strings that you can use to connect to this cluster through a private endpoint. This parameter returns only if you deployed a private endpoint to all regions to which you deployed this clusters' nodes. + items: + $ref: "#/components/schemas/ClusterDescriptionConnectionStringsPrivateEndpoint" + readOnly: true + type: array + privateSrv: + description: Network peering connection strings for each interface Virtual Private Cloud (VPC) endpoint that you configured to connect to this cluster. This connection string uses the `mongodb+srv://` protocol. The resource returns this parameter when someone creates a network peering connection to this cluster. This protocol tells the application to look up the host seed list in the Domain Name System (DNS). This list synchronizes with the nodes in a cluster. If the connection string uses this Uniform Resource Identifier (URI) format, you don't need to append the seed list or change the Uniform Resource Identifier (URI) if the nodes change. Use this Uniform Resource Identifier (URI) format if your driver supports it. If it doesn't, use `connectionStrings.private`. For Amazon Web Services (AWS) clusters, this parameter returns only if you [enable custom DNS](https://docs.atlas.mongodb.com/reference/api/aws-custom-dns-update/). + externalDocs: + description: Network Peering Connection + url: https://docs.atlas.mongodb.com/security-vpc-peering/#std-label-vpc-peering/ + readOnly: true + type: string + standard: + description: Public connection string that you can use to connect to this cluster. This connection string uses the `mongodb://` protocol. + externalDocs: + description: Connection String URI Format + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + standardSrv: + description: Public connection string that you can use to connect to this cluster. This connection string uses the `mongodb+srv://` protocol. + externalDocs: + description: Connection String URI Format + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + readOnly: true + title: Cluster Connection Strings + type: object + ClusterDescription20240805: + properties: + acceptDataRisksAndForceReplicaSetReconfig: + description: If reconfiguration is necessary to regain a primary due to a regional outage, submit this field alongside your topology reconfiguration to request a new regional outage resistant topology. Forced reconfigurations during an outage of the majority of electable nodes carry a risk of data loss if replicated writes (even majority committed writes) have not been replicated to the new primary node. MongoDB Atlas docs contain more information. To proceed with an operation which carries that risk, set **acceptDataRisksAndForceReplicaSetReconfig** to the current date. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: Reconfiguring a Replica Set during a regional outage + url: https://dochub.mongodb.org/core/regional-outage-reconfigure-replica-set + format: date-time + type: string + advancedConfiguration: + $ref: "#/components/schemas/ApiAtlasClusterAdvancedConfiguration" + backupEnabled: + default: false + description: Flag that indicates whether the cluster can perform backups. If set to `true`, the cluster can perform backups. You must set this value to `true` for NVMe clusters. Backup uses Cloud Backups for dedicated clusters and [Shared Cluster Backups](https://docs.atlas.mongodb.com/backup/shared-tier/overview/) for tenant clusters. If set to `false`, the cluster doesn't use backups. + externalDocs: + description: Cloud Backups + url: https://docs.atlas.mongodb.com/backup/cloud-backup/overview/ + type: boolean + biConnector: + $ref: "#/components/schemas/BiConnector" + clusterType: + description: Configuration of nodes that comprise the cluster. + type: string + configServerManagementMode: + default: ATLAS_MANAGED + description: |- + Config Server Management Mode for creating or updating a sharded cluster. + + When configured as ATLAS_MANAGED, atlas may automatically switch the cluster's config server type for optimal performance and savings. + + When configured as FIXED_TO_DEDICATED, the cluster will always use a dedicated config server. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + type: string + configServerType: + description: Describes a sharded cluster's config server type. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + readOnly: true + type: string + connectionStrings: + $ref: "#/components/schemas/ClusterConnectionStrings" + createDate: + description: Date and time when MongoDB Cloud created this cluster. This parameter expresses its value in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + diskWarmingMode: + default: FULLY_WARMED + description: Disk warming mode selection. + externalDocs: + description: Reduce Secondary Disk Warming Impact + url: https://docs.atlas.mongodb.com/reference/replica-set-tags/#reduce-secondary-disk-warming-impact + type: string + encryptionAtRestProvider: + description: 'Cloud service provider that manages your customer keys to provide an additional layer of encryption at rest for the cluster. To enable customer key management for encryption at rest, the cluster **replicationSpecs[n].regionConfigs[m].{type}Specs.instanceSize** setting must be `M10` or higher and `"backupEnabled" : false` or omitted entirely.' + externalDocs: + description: Encryption at Rest using Customer Key Management + url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ + type: string + featureCompatibilityVersion: + description: Feature compatibility version of the cluster. This will always appear regardless of whether FCV is pinned. + readOnly: true + type: string + featureCompatibilityVersionExpirationDate: + description: Feature compatibility version expiration date. Will only appear if FCV is pinned. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + globalClusterSelfManagedSharding: + description: |- + Set this field to configure the Sharding Management Mode when creating a new Global Cluster. + + When set to false, the management mode is set to Atlas-Managed Sharding. This mode fully manages the sharding of your Global Cluster and is built to provide a seamless deployment experience. + + When set to true, the management mode is set to Self-Managed Sharding. This mode leaves the management of shards in your hands and is built to provide an advanced and flexible deployment experience. + + This setting cannot be changed once the cluster is deployed. + externalDocs: + description: Creating a Global Cluster + url: https://dochub.mongodb.org/core/global-cluster-management + type: boolean + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + labels: + deprecated: true + description: |- + Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels. + + Cluster labels are deprecated and will be removed in a future release. We strongly recommend that you use Resource Tags instead. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ComponentLabel" + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongoDBEmployeeAccessGrant: + $ref: "#/components/schemas/EmployeeAccessGrant" + mongoDBMajorVersion: + description: |- + MongoDB major version of the cluster. Set to the binary major version. + + On creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLtsVersions). + + On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version. + externalDocs: + description: Available MongoDB Versions in Atlas + url: https://www.mongodb.com/docs/atlas/reference/faq/database/#which-versions-of-mongodb-do-service-clusters-use- + type: string + mongoDBVersion: + description: Version of MongoDB that the cluster runs. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + name: + description: Human-readable label that identifies the cluster. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + paused: + description: Flag that indicates whether the cluster is paused. + type: boolean + pitEnabled: + description: Flag that indicates whether the cluster uses continuous cloud backups. + externalDocs: + description: Continuous Cloud Backups + url: https://docs.atlas.mongodb.com/backup/cloud-backup/overview/ + type: boolean + redactClientLogData: + description: |- + Enable or disable log redaction. + + This setting configures the ``mongod`` or ``mongos`` to redact any document field contents from a message accompanying a given log event before logging. This prevents the program from writing potentially sensitive data stored on the database to the diagnostic log. Metadata such as error or operation codes, line numbers, and source file names are still visible in the logs. + + Use ``redactClientLogData`` in conjunction with Encryption at Rest and TLS/SSL (Transport Encryption) to assist compliance with regulatory requirements. + + *Note*: changing this setting on a cluster will trigger a rolling restart as soon as the cluster is updated. + externalDocs: + description: Log Redaction + url: https://www.mongodb.com/docs/manual/administration/monitoring/#log-redaction + type: boolean + replicaSetScalingStrategy: + default: WORKLOAD_TYPE + description: |- + Set this field to configure the replica set scaling mode for your cluster. + + By default, Atlas scales under WORKLOAD_TYPE. This mode allows Atlas to scale your analytics nodes in parallel to your operational nodes. + + When configured as SEQUENTIAL, Atlas scales all nodes sequentially. This mode is intended for steady-state workloads and applications performing latency-sensitive secondary reads. + + When configured as NODE_TYPE, Atlas scales your electable nodes in parallel with your read-only and analytics nodes. This mode is intended for large, dynamic workloads requiring frequent and timely cluster tier scaling. This is the fastest scaling strategy, but it might impact latency of workloads when performing extensive secondary reads. + externalDocs: + description: Modify the Replica Set Scaling Mode + url: https://dochub.mongodb.org/core/scale-nodes + type: string + replicationSpecs: + description: List of settings that configure your cluster regions. This array has one object per shard representing node configurations in each shard. For replica sets there is only one object representing node configurations. + items: + $ref: "#/components/schemas/ReplicationSpec20240805" + type: array + rootCertType: + default: ISRGROOTX1 + description: Root Certificate Authority that MongoDB Atlas cluster uses. MongoDB Cloud supports Internet Security Research Group. + type: string + stateName: + description: Human-readable label that indicates the current operating condition of this cluster. + readOnly: true + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. + type: boolean + versionReleaseSystem: + default: LTS + description: Method by which the cluster maintains the MongoDB versions. If value is `CONTINUOUS`, you must not specify **mongoDBMajorVersion**. + type: string + type: object + ClusterDescriptionAutoScalingModeConfiguration: + description: Contains the internal configuration of AutoScaling on sharded clusters. + properties: + autoScalingMode: + description: Describes whether cluster nodes scale together across all shards or independently. + type: string + title: Internal configuration of AutoScaling on sharded clusters + type: object + ClusterDescriptionConnectionStringsPrivateEndpoint: + description: Private endpoint-aware connection string that you can use to connect to this cluster through a private endpoint. + externalDocs: + description: Private Endpoint for Dedicated Cluster + url: https://docs.atlas.mongodb.com/security-private-endpoint/ + properties: + connectionString: + description: Private endpoint-aware connection string that uses the `mongodb://` protocol to connect to MongoDB Cloud through a private endpoint. + readOnly: true + type: string + endpoints: + description: List that contains the private endpoints through which you connect to MongoDB Cloud when you use **connectionStrings.privateEndpoint[n].connectionString** or **connectionStrings.privateEndpoint[n].srvConnectionString**. + items: + $ref: "#/components/schemas/ClusterDescriptionConnectionStringsPrivateEndpointEndpoint" + readOnly: true + type: array + srvConnectionString: + description: Private endpoint-aware connection string that uses the `mongodb+srv://` protocol to connect to MongoDB Cloud through a private endpoint. The `mongodb+srv` protocol tells the driver to look up the seed list of hosts in the Domain Name System (DNS). This list synchronizes with the nodes in a cluster. If the connection string uses this Uniform Resource Identifier (URI) format, you don't need to append the seed list or change the Uniform Resource Identifier (URI) if the nodes change. Use this Uniform Resource Identifier (URI) format if your application supports it. If it doesn't, use connectionStrings.privateEndpoint[n].connectionString. + readOnly: true + type: string + srvShardOptimizedConnectionString: + description: Private endpoint-aware connection string optimized for sharded clusters that uses the `mongodb+srv://` protocol to connect to MongoDB Cloud through a private endpoint. If the connection string uses this Uniform Resource Identifier (URI) format, you don't need to change the Uniform Resource Identifier (URI) if the nodes change. Use this Uniform Resource Identifier (URI) format if your application and Atlas cluster supports it. If it doesn't, use and consult the documentation for connectionStrings.privateEndpoint[n].srvConnectionString. + readOnly: true + type: string + type: + description: MongoDB process type to which your application connects. Use `MONGOD` for replica sets and `MONGOS` for sharded clusters. + readOnly: true + type: string + title: Cluster Private Endpoint Connection String + type: object + ClusterDescriptionConnectionStringsPrivateEndpointEndpoint: + description: Details of a private endpoint deployed for this cluster. + properties: + endpointId: + description: Unique string that the cloud provider uses to identify the private endpoint. + readOnly: true + type: string + providerName: + description: Cloud provider in which MongoDB Cloud deploys the private endpoint. + readOnly: true + type: string + region: + description: Region where the private endpoint is deployed. + readOnly: true + type: string + title: Cluster Private Endpoint Connection Strings Endpoint + type: object + ClusterDescriptionProcessArgs20240805: + properties: + changeStreamOptionsPreAndPostImagesExpireAfterSeconds: + default: -1 + description: The minimum pre- and post-image retention time in seconds. + externalDocs: + description: "This option corresponds to the ``changeStreamOptions.preAndPostImages.expireAfterSeconds`` cluster parameter. This setting controls the retention policy of change stream pre- and post-images. Pre- and post-images are the versions of a document before and after document modification, respectively. ``expireAfterSeconds`` controls how long MongoDB retains pre- and post-images. When set to -1 (off), MongoDB uses the default retention policy: pre- and post-images are retained until the corresponding change stream events are removed from the oplog. To set the minimum pre- and post-image retention time, specify an integer value greater than zero. Setting this too low could increase the risk of interrupting Realm sync or triggers processing. The default value is -1 (off)." + url: https://www.mongodb.com/docs/upcoming/reference/cluster-parameters/changeStreamOptions/#mongodb-parameter-param.changeStreamOptions.preAndPostImages.expireAfterSeconds + format: int32 + type: integer + chunkMigrationConcurrency: + description: Number of threads on the source shard and the receiving shard for chunk migration. The number of threads should not exceed the half the total number of CPU cores in the sharded cluster. + externalDocs: + description: This option corresponds to the `chunkMigrationConcurrency` `mongod` configuration file option. + url: https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.chunkMigrationConcurrency + format: int32 + type: integer + customOpensslCipherConfigTls12: + description: The custom OpenSSL cipher suite list for TLS 1.2. This field is only valid when `tlsCipherConfigMode` is set to `CUSTOM`. + externalDocs: + description: This option corresponds to the `opensslCipherConfig` `mongod` configuration file option. + url: https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.opensslCipherConfig + items: + type: string + type: array + defaultMaxTimeMS: + description: Default time limit in milliseconds for individual read operations to complete. + externalDocs: + description: This option corresponds to the defaultMaxTimeMS cluster parameter. + url: https://www.mongodb.com/docs/upcoming/reference/cluster-parameters/defaultMaxTimeMS/ + format: int32 + type: integer + defaultWriteConcern: + description: Default level of acknowledgment requested from MongoDB for write operations when none is specified by the driver. + externalDocs: + description: This option corresponds to the the implicit default write concern. + url: https://docs.mongodb.com/manual/reference/write-concern/ + type: string + javascriptEnabled: + description: Flag that indicates whether the cluster allows execution of operations that perform server-side executions of JavaScript. When using 8.0+, we recommend disabling server-side JavaScript and using operators of aggregation pipeline as more performant alternative. + externalDocs: + description: This option corresponds to modifying the `security.javascriptEnabled` configuration file option for each `mongod` and `mongos` in the cluster. + url: https://docs.mongodb.com/upcoming/reference/configuration-options/#mongodb-setting-security.javascriptEnabled + type: boolean + minimumEnabledTlsProtocol: + description: Minimum Transport Layer Security (TLS) version that the cluster accepts for incoming connections. Clusters using TLS 1.0 or 1.1 should consider setting TLS 1.2 as the minimum TLS protocol version. + externalDocs: + description: This option corresponds to the `net.ssl.disabledProtocols` `mongod` configuration file option. + url: https://docs.mongodb.com/upcoming/reference/configuration-options/#mongodb-setting-net.ssl.disabledProtocols + type: string + noTableScan: + description: Flag that indicates whether the cluster disables executing any query that requires a collection scan to return results. + externalDocs: + description: This option corresponds to the `notablescan` `mongod` configuration file option. + url: https://docs.mongodb.com/upcoming/reference/parameters/#mongodb-parameter-param.notablescan + type: boolean + oplogMinRetentionHours: + description: Minimum retention window for cluster's oplog expressed in hours. A value of null indicates that the cluster uses the default minimum oplog window that MongoDB Cloud calculates. + externalDocs: + description: This option corresponds to the `storage.oplogMinRetentionHours` `mongod` configuration file option. + url: https://docs.mongodb.com/upcoming/reference/configuration-options/#mongodb-setting-storage.oplogMinRetentionHours + format: double + type: number + oplogSizeMB: + description: Storage limit of cluster's oplog expressed in megabytes. A value of null indicates that the cluster uses the default oplog size that MongoDB Cloud calculates. + externalDocs: + description: This option corresponds to the `replication.oplogSizeMB` `mongod` configuration file option. + url: https://docs.mongodb.com/upcoming/reference/configuration-options/#mongodb-setting-replication.oplogSizeMB + format: int32 + type: integer + queryStatsLogVerbosity: + description: May be set to 1 (disabled) or 3 (enabled). When set to 3, Atlas will include redacted and anonymized $queryStats output in MongoDB logs. $queryStats output does not contain literals or field values. Enabling this setting might impact the performance of your cluster. + externalDocs: + description: This option corresponds to the queryStats component for the logComponentVerbosity server parameter. + url: https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.logComponentVerbosity + format: int32 + type: integer + sampleRefreshIntervalBIConnector: + default: 0 + description: Interval in seconds at which the mongosqld process re-samples data to create its relational schema. + externalDocs: + description: This option corresponds to the `sampleRefreshIntervalSecs` `mongosqld` option. + url: https://docs.mongodb.com/bi-connector/current/reference/mongosqld/#std-option-mongosqld.--schemaRefreshIntervalSecs + format: int32 + minimum: 0 + type: integer + sampleSizeBIConnector: + description: Number of documents per database to sample when gathering schema information. + externalDocs: + description: This option corresponds to the `sampleSize` `mongosqld` option. + url: https://docs.mongodb.com/bi-connector/current/reference/mongosqld/#std-option-mongosqld.--sampleSize + format: int32 + minimum: 0 + type: integer + tlsCipherConfigMode: + description: The TLS cipher suite configuration mode. The default mode uses the default cipher suites. The custom mode allows you to specify custom cipher suites for both TLS 1.2 and TLS 1.3. + type: string + transactionLifetimeLimitSeconds: + description: Lifetime, in seconds, of multi-document transactions. Atlas considers the transactions that exceed this limit as expired and so aborts them through a periodic cleanup process. + externalDocs: + description: This option corresponds to the `transactionLifetimeLimitSeconds` `mongod` configuration file option. + url: https://www.mongodb.com/docs/upcoming/reference/parameters/#mongodb-parameter-param.transactionLifetimeLimitSeconds + format: int64 + minimum: 1 + type: integer + type: object + ClusterFreeAutoScaling: + description: Range of instance sizes to which your cluster can scale. + properties: + compute: + $ref: "#/components/schemas/FreeComputeAutoScalingRules" + type: object + ClusterIPAddresses: + description: List of IP addresses in a cluster. + properties: + clusterName: + description: Human-readable label that identifies the cluster. + readOnly: true + type: string + futureInbound: + description: List of future inbound IP addresses associated with the cluster. If your network allows outbound HTTP requests only to specific IP addresses, you must allow access to the following IP addresses so that your application can connect to your Atlas cluster. + items: + type: string + readOnly: true + type: array + futureOutbound: + description: List of future outbound IP addresses associated with the cluster. If your network allows inbound HTTP requests only from specific IP addresses, you must allow access from the following IP addresses so that your Atlas cluster can communicate with your webhooks and KMS. + items: + type: string + readOnly: true + type: array + inbound: + description: List of inbound IP addresses associated with the cluster. If your network allows outbound HTTP requests only to specific IP addresses, you must allow access to the following IP addresses so that your application can connect to your Atlas cluster. + items: + type: string + readOnly: true + type: array + outbound: + description: List of outbound IP addresses associated with the cluster. If your network allows inbound HTTP requests only from specific IP addresses, you must allow access from the following IP addresses so that your Atlas cluster can communicate with your webhooks and KMS. + items: + type: string + readOnly: true + type: array + title: Cluster IP Addresses + type: object + ClusterOutageSimulation: + properties: + clusterName: + description: Human-readable label that identifies the cluster that undergoes outage simulation. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project that contains the cluster to undergo outage simulation. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal character string that identifies the outage simulation. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + outageFilters: + description: List of settings that specify the type of cluster outage simulation. + items: + $ref: "#/components/schemas/AtlasClusterOutageSimulationOutageFilter" + minItems: 1 + type: array + startRequestDate: + description: Date and time when MongoDB Cloud started the regional outage simulation. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + state: + description: |- + Phase of the outage simulation. + + | State | Indication | + |-------------|------------| + | `START_REQUESTED` | User has requested cluster outage simulation.| + | `STARTING` | MongoDB Cloud is starting cluster outage simulation.| + | `SIMULATING` | MongoDB Cloud is simulating cluster outage.| + | `RECOVERY_REQUESTED` | User has requested recovery from the simulated outage.| + | `RECOVERING` | MongoDB Cloud is recovering the cluster from the simulated outage.| + | `COMPLETE` | MongoDB Cloud has completed the cluster outage simulation.| + readOnly: true + type: string + type: object + ClusterProviderSettings: + description: Group of cloud provider settings that configure the provisioned MongoDB hosts. + properties: + providerName: + type: string + autoScaling: + $ref: "#/components/schemas/ClusterFreeAutoScaling" + diskIOPS: + description: Maximum Disk Input/Output Operations per Second (IOPS) that the database host can perform. + format: int32 + type: integer + encryptEBSVolume: + default: true + deprecated: true + description: Flag that indicates whether the Amazon Elastic Block Store (EBS) encryption feature encrypts the host's root volume for both data at rest within the volume and for data moving between the volume and the cluster. Clusters always have this setting enabled. + type: boolean + instanceSizeName: + description: Cluster tier, with a default storage and memory capacity, that applies to all the data-bearing hosts in your cluster. You must set **providerSettings.providerName** to `FLEX` and specify the cloud service provider in **providerSettings.backingProviderName**. + title: Flex Instance Sizes + type: string + regionName: + description: Human-readable label that identifies the geographic location of your MongoDB cluster. The region you choose can affect network latency for clients accessing your databases. For a complete list of region names, see [AWS](https://docs.atlas.mongodb.com/reference/amazon-aws/#std-label-amazon-aws), [GCP](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/). + type: string + volumeType: + description: Disk Input/Output Operations per Second (IOPS) setting for Amazon Web Services (AWS) storage that you configure only for abbr title="Amazon Web Services">AWS. Specify whether Disk Input/Output Operations per Second (IOPS) must not exceed the default Input/Output Operations per Second (IOPS) rate for the selected volume size (`STANDARD`), or must fall within the allowable Input/Output Operations per Second (IOPS) range for the selected volume size (`PROVISIONED`). You must set this value to (`PROVISIONED`) for NVMe clusters. + type: string + diskTypeName: + description: Disk type that corresponds to the host's root volume for Azure instances. If omitted, the default disk type for the selected **providerSettings.instanceSizeName** applies. + externalDocs: + description: Disk type + url: https://docs.microsoft.com/en-us/azure/virtual-machines/premium-storage-performance#premium-storage-disk-sizes + type: string + backingProviderName: + description: Cloud service provider on which MongoDB Cloud provisioned the multi-tenant host. The resource returns this parameter when **providerSettings.providerName** is `FLEX` and **providerSetting.instanceSizeName** is `FLEX`. + type: string + effectiveInstanceSizeName: + description: The true tenant instance size. This is present to support backwards compatibility for deprecated provider types and/or instance sizes. + readOnly: true + type: string + required: + - providerName + title: Cloud Service Provider Settings for a Cluster + type: object + ClusterSearchIndex: + properties: + collectionName: + description: Human-readable label that identifies the collection that contains one or more Atlas Search indexes. + type: string + database: + description: Human-readable label that identifies the database that contains the collection with one or more Atlas Search indexes. + type: string + indexID: + description: Unique 24-hexadecimal digit string that identifies this Atlas Search index. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + name: + description: Human-readable label that identifies this index. Within each namespace, names of all indexes in the namespace must be unique. + type: string + numPartitions: + default: 1 + description: Number of index partitions. Allowed values are [1, 2, 4]. + format: int32 + type: integer + status: + description: |- + Condition of the search index when you made this request. + + - `IN_PROGRESS`: Atlas is building or re-building the index after an edit. + - `STEADY`: You can use this search index. + - `FAILED`: Atlas could not build the index. + - `MIGRATING`: Atlas is upgrading the underlying cluster tier and migrating indexes. + - `PAUSED`: The cluster is paused. + readOnly: true + type: string + type: + description: Type of the index. Default type is search. + type: string + analyzer: + default: lucene.standard + description: |- + Specific pre-defined method chosen to convert database field text into searchable words. This conversion reduces the text of fields into the smallest units of text. These units are called a **term** or **token**. This process, known as tokenization, involves a variety of changes made to the text in fields: + + - extracting words + - removing punctuation + - removing accents + - changing to lowercase + - removing common words + - reducing words to their root form (stemming) + - changing words to their base form (lemmatization) + MongoDB Cloud uses the selected process to build the Atlas Search index. + externalDocs: + description: Atlas Search Analyzers + url: https://dochub.mongodb.org/core/analyzers--fts + type: string + analyzers: + description: List of user-defined methods to convert database field text into searchable words. + externalDocs: + description: Custom Atlas Search Analyzers + url: https://dochub.mongodb.org/core/custom-fts + items: + $ref: "#/components/schemas/ApiAtlasFTSAnalyzers" + type: array + mappings: + $ref: "#/components/schemas/ApiAtlasFTSMappings" + searchAnalyzer: + default: lucene.standard + description: Method applied to identify words when searching this index. + type: string + storedSource: + description: Flag that indicates whether to store all fields (true) on Atlas Search. By default, Atlas doesn't store (false) the fields on Atlas Search. Alternatively, you can specify an object that only contains the list of fields to store (include) or not store (exclude) on Atlas Search. To learn more, see documentation. + example: + include | exclude: + - field1 + - field2 + externalDocs: + description: Stored Source Fields + url: https://dochub.mongodb.org/core/atlas-search-stored-source + type: object + synonyms: + description: Rule sets that map words to their synonyms in this index. + externalDocs: + description: Synonym Mapping + url: https://dochub.mongodb.org/core/fts-synonym-mappings + items: + $ref: "#/components/schemas/SearchSynonymMappingDefinition" + type: array + fields: + description: Settings that configure the fields, one per object, to index. You must define at least one "vector" type field. You can optionally define "filter" type fields also. + externalDocs: + description: Vector Search Fields + url: https://dochub.mongodb.org/core/avs-vector-type + items: + $ref: "#/components/schemas/BasicDBObject" + type: array + required: + - collectionName + - database + - name + type: object + ClusterServerlessBackupOptions: + description: Group of settings that configure serverless backup. + properties: + serverlessContinuousBackupEnabled: + default: true + description: |- + Flag that indicates whether the serverless instance uses **Serverless Continuous Backup**. + If this parameter is `false`, the serverless instance uses **Basic Backup**. + + | Option | Description | + |---|---| + | Serverless Continuous Backup | Atlas takes incremental [snapshots](https://www.mongodb.com/docs/atlas/backup/cloud-backup/overview/#std-label-serverless-snapshots) of the data in your serverless instance every six hours and lets you restore the data from a selected point in time within the last 72 hours. Atlas also takes daily snapshots and retains these daily snapshots for 35 days. To learn more, see [Serverless Instance Costs](https://www.mongodb.com/docs/atlas/billing/serverless-instance-costs/#std-label-serverless-instance-costs). | + | Basic Backup | Atlas takes incremental [snapshots](https://www.mongodb.com/docs/atlas/backup/cloud-backup/overview/#std-label-serverless-snapshots) of the data in your serverless instance every six hours and retains only the two most recent snapshots. You can use this option for free. | + type: boolean + title: Serverless Backup Options + type: object + ClusterStatus: + properties: + changeStatus: + description: State of cluster at the time of this request. Atlas returns **Applied** if it completed adding a user to, or removing a user from, your cluster. Atlas returns **Pending** if it's still making the requested user changes. When status is **Pending**, new users can't log in. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + Collation: + description: One or more settings that specify language-specific rules to compare strings within this index. + externalDocs: + description: Collation Options + url: https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#options + properties: + alternate: + default: non-ignorable + description: Method to handle whitespace and punctuation as base characters for purposes of comparison. `"non-ignorable"` will evaluate Whitespace and Punctuation as Base Characters. `"shifted"` will not, MongoDB Cloud distinguishes these characters when `"strength" > 3`. + type: string + backwards: + default: false + description: Flag that indicates whether strings with diacritics sort from back of the string. Some French dictionary orders strings in this way. `true` will compare from back to front. `false` will compare from front to back. + type: boolean + caseFirst: + default: off + description: Method to handle sort order of case differences during tertiary level comparisons. `"upper"` sorts Uppercase before lowercase. `"lower"` sorts Lowercase before uppercase. `"off"` is similar to "lower" with slight differences. + type: string + caseLevel: + default: false + description: |- + Flag that indicates whether to include case comparison when `"strength" : 1` or `"strength" : 2`. + - `true` - Include casing in comparison + - Strength Level: 1 - Base characters and case. + - Strength Level: 2 - Base characters, diacritics (and possible other secondary differences), and case. + - `false` - Case is NOT included in comparison. + type: boolean + locale: + description: 'International Components for Unicode (ICU) code that represents a localized language. To specify simple binary comparison, set `"locale" : "simple"`.' + type: string + maxVariable: + description: 'Field that indicates which characters can be ignored when `"alternate" : "shifted"`.`"punct"` ignores both whitespace and punctuation. `"space"` ignores whitespace. Thishas no affect if `"alternate" : "non-ignorable"`.' + type: string + normalization: + default: false + description: |- + Flag that indicates whether to check if the text requires normalization and then perform it. Most text doesn't require this normalization processing. + + `true` will check if fully normalized and perform normalization to compare text. `false` will not check. + type: boolean + numericOrdering: + default: false + description: Flag that indicates whether to compare sequences of digits as numbers or as strings. `true` will compare as numbers, this results in `10 > 2`. `false` will Compare as strings. This results in `"10" < "2"`. + type: boolean + strength: + default: 3 + description: |- + Degree of comparison to perform when sorting words. + + MongoDB Cloud accepts the following _numeric values_ that correspond to the _comparison level_ and what that _comparison method_ is. + + - `1` - "Primary" - Compares the base characters only, ignoring other differences such as diacritics and case. + - `2` - "Secondary" - Compares base characters (primary) and diacritics (secondary). Primary differences take precedence over secondary differences. + - `3` - "Tertiary" - Compares base characters (primary), diacritics (secondary), and case and variants (tertiary). Differences between base characters takes precedence over secondary differences which take precedence over tertiary differences. + - `4` - "Quaternary" - Compares for the specific use case to consider punctuation when levels 1 through 3 ignore punctuation or for processing Japanese text. + - `5` - "Identical" - Compares for the specific use case of tie breaker. + format: int32 + maximum: 5 + minimum: 1 + type: integer + required: + - locale + type: object + writeOnly: true + ComponentLabel: + description: Human-readable labels applied to this MongoDB Cloud component. + properties: + key: + description: Key applied to tag and categorize this component. + maxLength: 255 + minLength: 1 + type: string + value: + description: Value set to the Key applied to tag and categorize this component. + maxLength: 255 + minLength: 1 + type: string + title: Component Label + type: object + ConnectedOrgConfig: + properties: + dataAccessIdentityProviderIds: + description: The collection of unique ids representing the identity providers that can be used for data access in this organization. + items: + description: Unique 24-hexadecimal digit string that represents the id of the identity providers that can be used for data access in this organization. + type: string + type: array + uniqueItems: true + domainAllowList: + description: Approved domains that restrict users who can join the organization based on their email address. + items: + type: string + type: array + uniqueItems: true + domainRestrictionEnabled: + description: Value that indicates whether domain restriction is enabled for this connected org. + type: boolean + identityProviderId: + description: Legacy 20-hexadecimal digit string that identifies the UI access identity provider that this connected org config is associated with. This id can be found within the Federation Management Console > Identity Providers tab by clicking the info icon in the IdP ID row of a configured identity provider. + pattern: ^([a-f0-9]{20})$ + type: string + orgId: + description: Unique 24-hexadecimal digit string that identifies the connected organization configuration. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + postAuthRoleGrants: + description: Atlas roles that are granted to a user in this organization after authenticating. Roles are a human-readable label that identifies the collection of privileges that MongoDB Cloud grants a specific MongoDB Cloud user. These roles can only be organization specific roles. + items: + type: string + type: array + uniqueItems: true + roleMappings: + description: Role mappings that are configured in this organization. + items: + $ref: "#/components/schemas/AuthFederationRoleMapping" + type: array + uniqueItems: true + userConflicts: + description: List that contains the users who have an email address that doesn't match any domain on the allowed list. + items: + $ref: "#/components/schemas/FederatedUser" + type: array + required: + - domainRestrictionEnabled + - orgId + type: object + ConnectedOrgConfigRoleAssignment: + properties: + groupId: + description: Unique 24-hexadecimal digit string that identifies the project to which this role belongs. Each element within **roleAssignments** can have a value for **groupId** or **orgId**, but not both. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + orgId: + description: Unique 24-hexadecimal digit string that identifies the organization to which this role belongs. Each element within **roleAssignments** can have a value for **orgId** or **groupId**, but not both. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + role: + description: Human-readable label that identifies the collection of privileges that MongoDB Cloud grants a specific API key, MongoDB Cloud user, or MongoDB Cloud team. These roles include organization- and project-level roles. + type: string + type: object + ControlPlaneIPAddresses: + description: List of IP addresses in the Atlas control plane. + properties: + inbound: + $ref: "#/components/schemas/InboundControlPlaneCloudProviderIPAddresses" + outbound: + $ref: "#/components/schemas/OutboundControlPlaneCloudProviderIPAddresses" + title: Control Plane IP Addresses + type: object + CostExplorerFilterRequestBody: + description: Request body for a cost explorer query. + properties: + clusters: + description: The list of projects to be included in the Cost Explorer Query. + items: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + type: array + endDate: + description: The exclusive ending date for the Cost Explorer query. The date must be the start of a month. + format: date + type: string + groupBy: + description: The dimension to group the returned usage results by. At least one filter value needs to be provided for a dimension to be used. + type: string + includePartialMatches: + description: Flag to control whether usage that matches the filter criteria, but does not have values for all filter criteria is included in response. Default is false, which excludes the partially matching data. + type: boolean + organizations: + description: The list of organizations to be included in the Cost Explorer Query. + items: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + type: array + projects: + description: The list of projects to be included in the Cost Explorer Query. + items: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + type: array + services: + description: The list of projects to be included in the Cost Explorer Query. + items: + type: string + type: array + startDate: + description: The inclusive starting date for the Cost Explorer query. The date must be the start of a month. + format: date + type: string + required: + - endDate + - startDate + type: object + CostExplorerQueryResult: + type: object + CreateAtlasOrganizationApiKey: + description: Details of the programmatic API key to be created. + properties: + desc: + description: Purpose or explanation provided when someone created this organization API key. + maxLength: 250 + minLength: 1 + type: string + roles: + description: List of roles to grant this API key. If you provide this list, provide a minimum of one role and ensure each role applies to this organization. + items: + type: string + minItems: 1 + type: array + required: + - desc + - roles + type: object + CreateAtlasProjectApiKey: + properties: + desc: + description: Purpose or explanation provided when someone created this project API key. + maxLength: 250 + minLength: 1 + type: string + roles: + description: List of roles to grant this API key. If you provide this list, provide a minimum of one role and ensure each role applies to this project. + items: + description: Human-readable label that identifies the collection of privileges that MongoDB Cloud grants a specific API key, MongoDB Cloud user, or MongoDB Cloud team. These roles include organization- and project-level roles. + type: string + minItems: 1 + type: array + required: + - desc + - roles + type: object + CreateEndpointRequest: + type: object + properties: + id: + description: Unique string that identifies the private endpoint's network interface that someone added to this private endpoint service. + example: /subscriptions/cba6d9c6-1d3f-3c11-03cb-c705d895e636/resourcegroups/qrRTqi4TSN)7yB5YLRjVDveH3.yLzpNR7Br0D3-SGrU3j0.0/providers/Microsoft.Network/privateEndpoints/pVP(vb(XeckpxtXzP0NaOsDjeWDbOK)DX8A2j2E_vBYL2.GEYIdln + type: string + writeOnly: true + privateEndpointIPAddress: + description: IPv4 address of the private endpoint in your Azure VNet that someone added to this private endpoint service. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + endpointGroupName: + description: Human-readable label that identifies a set of endpoints. + type: string + writeOnly: true + endpoints: + description: List of individual private endpoints that comprise this endpoint group. + externalDocs: + description: Google Cloud Forwarding Rule Concepts + url: https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts + items: + $ref: "#/components/schemas/CreateGCPForwardingRuleRequest" + type: array + gcpProjectId: + description: Unique string that identifies the Google Cloud project in which you created the endpoints. + example: p-fdeeb3e43b8e733e5ab627b1 + externalDocs: + description: Google Cloud Creating and Managing Projects + url: https://cloud.google.com/resource-manager/docs/creating-managing-projects + pattern: ^p-[0-9a-z]{24}$ + type: string + writeOnly: true + CreateGCPForwardingRuleRequest: + properties: + endpointName: + description: Human-readable label that identifies the Google Cloud consumer forwarding rule that you created. + externalDocs: + description: Google Cloud Forwarding Rule Concepts + url: https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts + type: string + writeOnly: true + ipAddress: + description: One Private Internet Protocol version 4 (IPv4) address to which this Google Cloud consumer forwarding rule resolves. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + writeOnly: true + title: GCP Forwarding Rules + type: object + CreateOrganizationRequest: + properties: + apiKey: + $ref: "#/components/schemas/CreateAtlasOrganizationApiKey" + federationSettingsId: + description: Unique 24-hexadecimal digit string that identifies the federation to link the newly created organization to. If specified, the proposed Organization Owner of the new organization must have the Organization Owner role in an organization associated with the federation. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + name: + description: Human-readable label that identifies the organization. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + type: string + orgOwnerId: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user that you want to assign the Organization Owner role. This user must be a member of the same organization as the calling API key. If you provide `federationSettingsId`, this user must instead have the Organization Owner role on an organization in the specified federation. This parameter is required only when you authenticate with Programmatic API Keys. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + skipDefaultAlertsSettings: + default: false + description: Disables automatic alert creation. When set to true, no organization level alerts will be created automatically. + type: boolean + required: + - name + type: object + CreateOrganizationResponse: + properties: + apiKey: + $ref: "#/components/schemas/ApiKeyUserDetails" + federationSettingsId: + description: Unique 24-hexadecimal digit string that identifies the federation that you linked the newly created organization to. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + orgOwnerId: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user that you assigned the Organization Owner role in the new organization. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + organization: + $ref: "#/components/schemas/AtlasOrganization" + skipDefaultAlertsSettings: + default: false + description: Disables automatic alert creation. When set to true, no organization level alerts will be created automatically. + type: boolean + type: object + CreatePushBasedLogExportProjectRequest: + properties: + bucketName: + description: The name of the bucket to which the agent will send the logs to. + type: string + iamRoleId: + description: ID of the AWS IAM role that will be used to write to the S3 bucket. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + prefixPath: + description: S3 directory in which vector will write to in order to store the logs. An empty string denotes the root directory. + type: string + required: + - bucketName + - iamRoleId + - prefixPath + type: object + CustomZoneMappings: + properties: + customZoneMappings: + description: |- + List that contains comma-separated key value pairs to map zones to geographic regions. These pairs map an ISO 3166-1a2 location code, with an ISO 3166-2 subdivision code when possible, to the human-readable label for the desired custom zone. MongoDB Cloud maps the ISO 3166-1a2 code to the nearest geographical zone by default. Include this parameter to override the default mappings. + + This parameter returns an empty object if no custom zones exist. + items: + $ref: "#/components/schemas/ZoneMapping" + type: array + type: object + DBRoleToExecute: + description: The name of a Built in or Custom DB Role to connect to an Atlas Cluster. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + role: + description: The name of the role to use. Can be a built in role or a custom role. + type: string + type: + description: Type of the DB role. Can be either BuiltIn or Custom. + title: DB Role Type + type: string + type: object + DBUserTLSX509Settings: + description: Settings to configure TLS Certificates for database users. + properties: + cas: + description: Concatenated list of customer certificate authority (CA) certificates needed to authenticate database users. MongoDB Cloud expects this as a PEM-formatted certificate. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + title: Database User TLS Certificate Settings + type: object + DataFederationAzureCloudProviderConfig: + description: Configuration for running Data Federation in Azure. + properties: + atlasAppId: + description: The App ID generated by Atlas for the Service Principal's access policy. + readOnly: true + type: string + roleId: + description: Unique identifier of the role that Data Federation can use to access the data stores. Required if specifying cloudProviderConfig. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + servicePrincipalId: + description: The ID of the Service Principal for which there is an access policy for Atlas to access Azure resources. + readOnly: true + type: string + tenantId: + description: The Azure Active Directory / Entra ID tenant ID associated with the Service Principal. + readOnly: true + type: string + required: + - roleId + type: object + DataFederationGCPCloudProviderConfig: + description: Configuration for running Data Federation in GCP. + properties: + gcpServiceAccount: + description: The email address of the Google Cloud Platform (GCP) service account created by Atlas which should be authorized to allow Atlas to access Google Cloud Storage. + readOnly: true + type: string + roleId: + description: Unique identifier of the role that Data Federation can use to access the data stores. Required if specifying cloudProviderConfig. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + required: + - roleId + type: object + DataFederationLimit: + description: Details of user managed limits. + properties: + currentUsage: + description: Amount that indicates the current usage of the limit. + format: int64 + readOnly: true + type: integer + defaultLimit: + description: Default value of the limit. + format: int64 + readOnly: true + type: integer + maximumLimit: + description: Maximum value of the limit. + format: int64 + readOnly: true + type: integer + name: + description: Human-readable label that identifies the user-managed limit to modify. + readOnly: true + type: string + value: + description: Amount to set the limit to. + format: int64 + type: integer + required: + - name + - value + title: Limits + type: object + DataFederationTenantQueryLimit: + description: Details of a tenant-level query limit for Data Federation. Query limit is the limit on the amount of usage during a time period based on cost. + properties: + currentUsage: + description: Amount that indicates the current usage of the limit. + format: int64 + readOnly: true + type: integer + defaultLimit: + description: Default value of the limit. + format: int64 + readOnly: true + type: integer + lastModifiedDate: + description: Only used for Data Federation limits. Timestamp that indicates when this usage limit was last modified. This field uses the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + maximumLimit: + description: Maximum value of the limit. + format: int64 + readOnly: true + type: integer + name: + description: Human-readable label that identifies the user-managed limit to modify. + readOnly: true + type: string + overrunPolicy: + description: Only used for Data Federation limits. Action to take when the usage limit is exceeded. If limit span is set to QUERY, this is ignored because MongoDB Cloud stops the query when it exceeds the usage limit. + type: string + tenantName: + description: Human-readable label that identifies the Federated Database Instance. If specified, the usage limit is for the specified federated database instance only. If omitted, the usage limit is for all federated database instances in the project. + readOnly: true + type: string + value: + description: Amount to set the limit to. + format: int64 + type: integer + required: + - name + - value + title: Data Federation Tenant-Level Query Limit + type: object + DataLakeAWSCloudProviderConfig: + description: Configuration for running Data Federation in AWS. + properties: + externalId: + description: Unique identifier associated with the Identity and Access Management (IAM) role that the data lake assumes when accessing the data stores. + readOnly: true + type: string + iamAssumedRoleARN: + description: Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role that the data lake assumes when accessing data stores. + example: arn:aws:iam::123456789012:root + maxLength: 2048 + minLength: 20 + readOnly: true + type: string + iamUserARN: + description: Amazon Resource Name (ARN) of the user that the data lake assumes when accessing data stores. + readOnly: true + type: string + roleId: + description: Unique identifier of the role that the data lake can use to access the data stores.Required if specifying cloudProviderConfig. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + testS3Bucket: + description: Name of the S3 data bucket that the provided role ID is authorized to access.Required if specifying cloudProviderConfig. + type: string + writeOnly: true + required: + - roleId + - testS3Bucket + type: object + DataLakeApiBase: + description: An aggregation pipeline that applies to the collection. + properties: + name: + description: Human-readable label that identifies the view, which corresponds to an aggregation pipeline on a collection. + type: string + pipeline: + description: Aggregation pipeline stages to apply to the source collection. + externalDocs: + description: Aggregation Pipelines + url: https://docs.mongodb.com/manual/core/aggregation-pipeline/ + type: string + source: + description: Human-readable label that identifies the source collection for the view. + type: string + type: object + DataLakeAtlasStoreReadConcern: + description: MongoDB Cloud cluster read concern, which determines the consistency and isolation properties of the data read from an Atlas cluster. + properties: + level: + description: Read Concern level that specifies the consistency and availability of the data read. + externalDocs: + description: Read Concern Level + url: https://www.mongodb.com/docs/manual/reference/read-concern/#read-concern-levels + type: string + type: object + DataLakeAtlasStoreReadPreference: + description: MongoDB Cloud cluster read preference, which describes how to route read requests to the cluster. + properties: + maxStalenessSeconds: + description: Maximum replication lag, or **staleness**, for reads from secondaries. + format: int32 + type: integer + mode: + description: Read preference mode that specifies to which replica set member to route the read requests. + externalDocs: + description: Read Preference Modes + url: https://docs.mongodb.com/manual/core/read-preference/#read-preference-modes + type: string + tagSets: + description: List that contains tag sets or tag specification documents. If specified, Atlas Data Lake routes read requests to replica set member or members that are associated with the specified tags. + externalDocs: + description: Read Preference Tag Set Lists + url: https://docs.mongodb.com/manual/core/read-preference-tags/ + items: + items: + $ref: "#/components/schemas/DataLakeAtlasStoreReadPreferenceTag" + type: array + type: array + type: object + DataLakeAtlasStoreReadPreferenceTag: + properties: + name: + description: Human-readable label of the tag. + type: string + value: + description: Value of the tag. + type: string + type: object + DataLakeCloudProviderConfig: + description: Cloud provider where this Federated Database Instance is hosted. + properties: + aws: + $ref: "#/components/schemas/DataLakeAWSCloudProviderConfig" + azure: + $ref: "#/components/schemas/DataFederationAzureCloudProviderConfig" + gcp: + $ref: "#/components/schemas/DataFederationGCPCloudProviderConfig" + title: Data Federation Cloud Provider + type: object + DataLakeDataProcessRegion: + description: Information about the cloud provider region to which the Federated Database Instance routes client connections. + properties: + cloudProvider: + description: Name of the cloud service that hosts the Federated Database Instance's infrastructure. + type: string + region: + $ref: "#/components/schemas/BaseAtlasDataLakeRegion" + required: + - cloudProvider + - region + type: object + DataLakeDatabaseCollection: + description: A collection and data sources that map to a ``stores`` data store. + properties: + dataSources: + description: Array that contains the data stores that map to a collection for this data lake. + items: + $ref: "#/components/schemas/DataLakeDatabaseDataSourceSettings" + type: array + name: + description: Human-readable label that identifies the collection to which MongoDB Cloud maps the data in the data stores. + type: string + type: object + DataLakeDatabaseDataSourceSettings: + description: Data store that maps to a collection for this data lake. + properties: + allowInsecure: + default: false + description: Flag that validates the scheme in the specified URLs. If `true`, allows insecure `HTTP` scheme, doesn't verify the server's certificate chain and hostname, and accepts any certificate with any hostname presented by the server. If `false`, allows secure `HTTPS` scheme only. + type: boolean + collection: + description: Human-readable label that identifies the collection in the database. For creating a wildcard (`*`) collection, you must omit this parameter. + type: string + collectionRegex: + description: Regex pattern to use for creating the wildcard (*) collection. To learn more about the regex syntax, see [Go programming language](https://pkg.go.dev/regexp). + type: string + database: + description: Human-readable label that identifies the database, which contains the collection in the cluster. You must omit this parameter to generate wildcard (`*`) collections for dynamically generated databases. + type: string + databaseRegex: + description: Regex pattern to use for creating the wildcard (*) database. To learn more about the regex syntax, see [Go programming language](https://pkg.go.dev/regexp). + type: string + datasetName: + description: Human-readable label that identifies the dataset that Atlas generates for an ingestion pipeline run or Online Archive. + example: v1$atlas$snapshot$Cluster0$myDatabase$myCollection$19700101T000000Z + type: string + datasetPrefix: + description: Human-readable label that matches against the dataset names for ingestion pipeline runs or Online Archives. + type: string + defaultFormat: + description: File format that MongoDB Cloud uses if it encounters a file without a file extension while searching **storeName**. + type: string + path: + description: File path that controls how MongoDB Cloud searches for and parses files in the **storeName** before mapping them to a collection.Specify ``/`` to capture all files and folders from the ``prefix`` path. + type: string + provenanceFieldName: + description: Name for the field that includes the provenance of the documents in the results. MongoDB Cloud returns different fields in the results for each supported provider. + type: string + storeName: + description: Human-readable label that identifies the data store that MongoDB Cloud maps to the collection. + type: string + trimLevel: + description: Unsigned integer that specifies how many fields of the dataset name to trim from the left of the dataset name before mapping the remaining fields to a wildcard collection name. + format: int32 + type: integer + urls: + description: URLs of the publicly accessible data files. You can't specify URLs that require authentication. Atlas Data Lake creates a partition for each URL. If empty or omitted, Data Lake uses the URLs from the store specified in the **dataSources.storeName** parameter. + items: + type: string + type: array + type: object + DataLakeDatabaseInstance: + description: Database associated with this data lake. Databases contain collections and views. + properties: + collections: + description: Array of collections and data sources that map to a ``stores`` data store. + items: + $ref: "#/components/schemas/DataLakeDatabaseCollection" + type: array + maxWildcardCollections: + default: 100 + description: Maximum number of wildcard collections in the database. This only applies to S3 data sources. + format: int32 + maximum: 1000 + minimum: 1 + type: integer + name: + description: Human-readable label that identifies the database to which the data lake maps data. + type: string + views: + description: Array of aggregation pipelines that apply to the collection. This only applies to S3 data sources. + items: + $ref: "#/components/schemas/DataLakeApiBase" + type: array + type: object + DataLakeIngestionPipeline: + description: Details of a Data Lake Pipeline. + properties: + _id: + description: Unique 24-hexadecimal digit string that identifies the Data Lake Pipeline. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + createdDate: + description: Timestamp that indicates when the Data Lake Pipeline was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + datasetRetentionPolicy: + $ref: "#/components/schemas/DatasetRetentionPolicy" + groupId: + description: Unique 24-hexadecimal digit string that identifies the group. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lastUpdatedDate: + description: Timestamp that indicates the last time that the Data Lake Pipeline was updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + name: + description: Name of this Data Lake Pipeline. + type: string + sink: + $ref: "#/components/schemas/IngestionSink" + source: + $ref: "#/components/schemas/IngestionSource" + state: + description: State of this Data Lake Pipeline. + readOnly: true + type: string + transformations: + description: Fields to be excluded for this Data Lake Pipeline. + items: + $ref: "#/components/schemas/FieldTransformation" + type: array + title: Data Lake Pipeline + type: object + DataLakePipelinesPartitionField: + description: Partition Field in the Data Lake Storage provider for a Data Lake Pipeline. + properties: + fieldName: + description: Human-readable label that identifies the field name used to partition data. + maxLength: 700 + type: string + order: + default: 0 + description: Sequence in which MongoDB Cloud slices the collection data to create partitions. The resource expresses this sequence starting with zero. + format: int32 + type: integer + required: + - fieldName + - order + title: Partition Field + type: object + DataLakeStorage: + description: Configuration information for each data store and its mapping to MongoDB Cloud databases. + properties: + databases: + description: Array that contains the queryable databases and collections for this data lake. + items: + $ref: "#/components/schemas/DataLakeDatabaseInstance" + type: array + stores: + description: Array that contains the data stores for the data lake. + items: + $ref: "#/components/schemas/DataLakeStoreSettings" + type: array + type: object + DataLakeStoreSettings: + description: Group of settings that define where the data is stored. + properties: + name: + description: Human-readable label that identifies the data store. The **databases.[n].collections.[n].dataSources.[n].storeName** field references this values as part of the mapping configuration. To use MongoDB Cloud as a data store, the data lake requires a serverless instance or an `M10` or higher cluster. + type: string + provider: + type: string + additionalStorageClasses: + description: Collection of AWS S3 [storage classes](https://aws.amazon.com/s3/storage-classes/). Atlas Data Lake includes the files in these storage classes in the query results. + items: + description: AWS S3 [storage class](https://aws.amazon.com/s3/storage-classes/) where the files to include in the results are stored. + type: string + type: array + bucket: + description: Human-readable label that identifies the Google Cloud Storage bucket. + type: string + delimiter: + description: Delimiter. + type: string + includeTags: + default: false + description: Flag that indicates whether to use S3 tags on the files in the given path as additional partition attributes. If set to `true`, data lake adds the S3 tags as additional partition attributes and adds new top-level BSON elements associating each tag to each document. + type: boolean + prefix: + description: Prefix. + type: string + public: + default: false + description: Flag that indicates whether the bucket is public. If set to `true`, MongoDB Cloud doesn't use the configured GCP service account to access the bucket. If set to `false`, the configured GCP service acccount must include permissions to access the bucket. + type: boolean + region: + description: Google Cloud Platform Regions. + title: GCP Regions + type: string + clusterName: + description: Human-readable label of the MongoDB Cloud cluster on which the store is based. + type: string + projectId: + description: Unique 24-hexadecimal digit string that identifies the project. + maxLength: 24 + minLength: 24 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + readConcern: + $ref: "#/components/schemas/DataLakeAtlasStoreReadConcern" + readPreference: + $ref: "#/components/schemas/DataLakeAtlasStoreReadPreference" + allowInsecure: + default: false + description: Flag that validates the scheme in the specified URLs. If `true`, allows insecure `HTTP` scheme, doesn't verify the server's certificate chain and hostname, and accepts any certificate with any hostname presented by the server. If `false`, allows secure `HTTPS` scheme only. + type: boolean + defaultFormat: + description: Default format that Data Lake assumes if it encounters a file without an extension while searching the `storeName`. If omitted, Data Lake attempts to detect the file type by processing a few bytes of the file. The specified format only applies to the URLs specified in the **databases.[n].collections.[n].dataSources** object. + type: string + urls: + description: Comma-separated list of publicly accessible HTTP URLs where data is stored. You can't specify URLs that require authentication. + items: + description: Comma-separated list of publicly accessible HTTP URLs where data is stored. You can't specify URLs that require authentication. + type: string + type: array + containerName: + description: Human-readable label that identifies the name of the container. + type: string + replacementDelimiter: + description: Replacement Delimiter. + type: string + serviceURL: + description: Service URL. + type: string + required: + - provider + type: object + DataLakeTenant: + properties: + cloudProviderConfig: + $ref: "#/components/schemas/DataLakeCloudProviderConfig" + dataProcessRegion: + $ref: "#/components/schemas/DataLakeDataProcessRegion" + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + hostnames: + description: List that contains the hostnames assigned to the Federated Database Instance. + items: + description: Unique hostname assigned to the Federated Database Instance. + readOnly: true + type: string + readOnly: true + type: array + name: + description: Human-readable label that identifies the Federated Database Instance. + type: string + privateEndpointHostnames: + description: List that contains the sets of private endpoints and hostnames. + items: + $ref: "#/components/schemas/PrivateEndpointHostname" + readOnly: true + type: array + state: + description: Label that indicates the status of the Federated Database Instance. + readOnly: true + type: string + storage: + $ref: "#/components/schemas/DataLakeStorage" + type: object + DataMetricUnits: + description: Element used to express the quantity. This can be an element of time, storage capacity, and the like. + example: BYTES + title: Data Metric Units + type: string + DataProtectionSettings20231001: + properties: + authorizedEmail: + description: Email address of the user who authorized to update the Backup Compliance Policy settings. + format: email + type: string + authorizedUserFirstName: + description: First name of the user who authorized to updated the Backup Compliance Policy settings. + type: string + authorizedUserLastName: + description: Last name of the user who authorized to updated the Backup Compliance Policy settings. + type: string + copyProtectionEnabled: + default: false + description: Flag that indicates whether to prevent cluster users from deleting backups copied to other regions, even if those additional snapshot regions are removed. If unspecified, this value defaults to false. + type: boolean + deletable: + default: false + description: Flag that indicates whether the Backup Compliance Policy is allowed to be disabled. It is default to false and a support ticket needs to be filed to request setting to true. + externalDocs: + description: Configure a Backup Compliance Policy + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/backup-compliance-policy/ + readOnly: true + type: boolean + encryptionAtRestEnabled: + default: false + description: Flag that indicates whether Encryption at Rest using Customer Key Management is required for all clusters with a Backup Compliance Policy. If unspecified, this value defaults to false. + externalDocs: + description: Encryption at Rest using Customer Key Management + url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ + type: boolean + onDemandPolicyItem: + $ref: "#/components/schemas/BackupComplianceOnDemandPolicyItem" + pitEnabled: + default: false + description: Flag that indicates whether the cluster uses Continuous Cloud Backups with a Backup Compliance Policy. If unspecified, this value defaults to false. + externalDocs: + description: Continuous Cloud Backups + url: https://docs.atlas.mongodb.com/backup/cloud-backup/overview/ + type: boolean + projectId: + description: Unique 24-hexadecimal digit string that identifies the project for the Backup Compliance Policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + restoreWindowDays: + description: Number of previous days that you can restore back to with Continuous Cloud Backup with a Backup Compliance Policy. You must specify a positive, non-zero integer, and the maximum retention window can't exceed the hourly retention time. This parameter applies only to Continuous Cloud Backups with a Backup Compliance Policy. + format: int32 + type: integer + scheduledPolicyItems: + description: List that contains the specifications for one scheduled policy. + items: + $ref: "#/components/schemas/BackupComplianceScheduledPolicyItem" + type: array + state: + description: Label that indicates the state of the Backup Compliance Policy settings. MongoDB Cloud ignores this setting when you enable or update the Backup Compliance Policy settings. + readOnly: true + type: string + updatedDate: + description: ISO 8601 timestamp format in UTC that indicates when the user updated the Data Protection Policy settings. MongoDB Cloud ignores this setting when you enable or update the Backup Compliance Policy settings. + format: date-time + readOnly: true + type: string + updatedUser: + description: Email address that identifies the user who updated the Backup Compliance Policy settings. MongoDB Cloud ignores this email setting when you enable or update the Backup Compliance Policy settings. + format: email + readOnly: true + type: string + required: + - authorizedEmail + - authorizedUserFirstName + - authorizedUserLastName + type: object + DatabaseInheritedRole: + description: Role inherited from another context for this database user. + externalDocs: + description: Built-in MongoDB Roles + url: https://docs.mongodb.com/manual/reference/built-in-roles/ + properties: + db: + description: Human-readable label that identifies the database on which someone grants the action to one MongoDB user. + type: string + role: + description: Human-readable label that identifies the role inherited. Set this value to `admin` for every role except `read` or `readWrite`. + externalDocs: + description: MongoDB Built-In Roles + url: https://docs.mongodb.com/manual/reference/built-in-roles/ + type: string + required: + - db + - role + title: Inherited Role + type: object + DatabasePermittedNamespaceResource: + description: Namespace to which this database user has access. + externalDocs: + description: Cluster Resources + url: https://docs.mongodb.com/manual/reference/resource-document/#cluster-resource + properties: + cluster: + description: Flag that indicates whether to grant the action on the cluster resource. If `true`, MongoDB Cloud ignores the **actions.resources.collection** and **actions.resources.db** parameters. + type: boolean + collection: + description: "Human-readable label that identifies the collection on which you grant the action to one MongoDB user. If you don't set this parameter, you grant the action to all collections in the database specified in the **actions.resources.db** parameter. If you set `\"actions.resources.cluster\" : true`, MongoDB Cloud ignores this parameter." + type: string + db: + description: 'Human-readable label that identifies the database on which you grant the action to one MongoDB user. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' + type: string + required: + - cluster + - collection + - db + title: Permitted Namespace + type: object + DatabasePrivilegeAction: + description: Privilege action that the role grants. + properties: + action: + description: Human-readable label that identifies the privilege action. + type: string + resources: + description: List of resources on which you grant the action. + items: + $ref: "#/components/schemas/DatabasePermittedNamespaceResource" + type: array + required: + - action + title: Database Privilege Action + type: object + DatabaseRollingIndexRequest: + properties: + collation: + $ref: "#/components/schemas/Collation" + collection: + description: Human-readable label of the collection for which MongoDB Cloud creates an index. + type: string + writeOnly: true + db: + description: Human-readable label of the database that holds the collection on which MongoDB Cloud creates an index. + type: string + writeOnly: true + keys: + description: List that contains one or more objects that describe the parameters that you want to index. + items: + additionalProperties: + description: Key-value pair that sets the parameter to index as the key and the type of index as its value. To create a [multikey index](https://docs.mongodb.com/manual/core/index-multikey/), list each parameter in its own object within this array. + externalDocs: + description: Index Types + url: https://docs.mongodb.com/manual/indexes/#index-types + maxProperties: 1 + minProperties: 1 + type: string + writeOnly: true + description: Key-value pair that sets the parameter to index as the key and the type of index as its value. To create a [multikey index](https://docs.mongodb.com/manual/core/index-multikey/), list each parameter in its own object within this array. + externalDocs: + description: Index Types + url: https://docs.mongodb.com/manual/indexes/#index-types + maxProperties: 1 + minProperties: 1 + type: object + writeOnly: true + type: array + writeOnly: true + options: + $ref: "#/components/schemas/IndexOptions" + required: + - collection + - db + type: object + DatabaseUserRole: + description: Range of resources available to this database user. + properties: + collectionName: + description: Collection on which this role applies. + type: string + databaseName: + description: Database to which the user is granted access privileges. + type: string + roleName: + description: Human-readable label that identifies a group of privileges assigned to a database user. This value can either be a built-in role or a custom role. + type: string + required: + - databaseName + - roleName + title: Database User Role + type: object + DatasetRetentionPolicy: + description: Dataset Retention Policy for a Scheduled Data Lake Pipeline. + properties: + lastModifiedDate: + description: Date when retention policy was last modified. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + units: + description: Quantity of time in which the Data Lake Pipeline measures dataset retention. + type: string + value: + description: Number that indicates the amount of days, weeks, or months that the Data Lake Pipeline will retain datasets. + format: int32 + minimum: 1 + type: integer + required: + - units + - value + title: Dataset Retention Policy + type: object + DedicatedHardwareSpec20240805: + description: Hardware specifications for read-only nodes in the region. Read-only nodes can never become the primary member, but can enable local reads. If you don't specify this parameter, no read-only nodes are deployed to the region. + properties: + diskSizeGB: + description: |- + Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity. + + This value must be equal for all shards and node types. + + This value is not configurable on M0/M2/M5 clusters. + + MongoDB Cloud requires this parameter if you set **replicationSpecs**. + + If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. + + Storage charge calculations depend on whether you choose the default value or a custom value. + + The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier. + externalDocs: + description: Customize Storage + url: https://dochub.mongodb.org/core/customize-storage + format: double + type: number + nodeCount: + description: Number of nodes of the given type for MongoDB Cloud to deploy to the region. + format: int32 + type: integer + diskIOPS: + description: |- + Target throughput desired for storage attached to your Azure-provisioned cluster. Change this parameter if you: + + - set `"replicationSpecs[n].regionConfigs[m].providerName" : "Azure"`. + - set `"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize" : "M40"` or greater not including `Mxx_NVME` tiers. + + The maximum input/output operations per second (IOPS) depend on the selected **.instanceSize** and **.diskSizeGB**. + This parameter defaults to the cluster tier's standard IOPS value. + Changing this value impacts cluster cost. + externalDocs: + description: Programmatic API Keys + url: https://www.mongodb.com/docs/atlas/customize-storage/#extend-iops-on-azure + format: int32 + type: integer + ebsVolumeType: + default: STANDARD + description: |- + Type of storage you want to attach to your AWS-provisioned cluster. + + - `STANDARD` volume types can't exceed the default input/output operations per second (IOPS) rate for the selected volume size. + + - `PROVISIONED` volume types must fall within the allowable IOPS range for the selected volume size. You must set this value to (`PROVISIONED`) for NVMe clusters. + type: string + instanceSize: + description: Hardware specification for the instance sizes in this region in this shard. Each instance size has a default storage and memory capacity. Electable nodes and read-only nodes (known as "base nodes") within a single shard must use the same instance size. Analytics nodes can scale independently from base nodes within a shard. Both base nodes and analytics nodes can scale independently from their equivalents in other shards. + title: GCP Instance Sizes + type: string + type: object + DeleteCopiedBackups20240805: + description: Deleted copy setting whose backup copies need to also be deleted. + properties: + cloudProvider: + description: Human-readable label that identifies the cloud provider for the deleted copy setting whose backup copies you want to delete. + type: string + writeOnly: true + regionName: + description: Target region for the deleted copy setting whose backup copies you want to delete. Please supply the 'Atlas Region'. + externalDocs: + description: Cloud Provider Regions + url: https://www.mongodb.com/docs/atlas/reference/cloud-providers/ + type: string + writeOnly: true + zoneId: + description: Unique 24-hexadecimal digit string that identifies the zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster. To find the Zone Id, do a GET request to Return One Cluster from One Project and consult the replicationSpecs array. + example: 32b6e34b3d91647abb20e7b8 + externalDocs: + description: Return One Cluster from One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/getCluster + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + type: object + writeOnly: true + Destination: + description: Document that describes the destination of the migration. + properties: + clusterName: + description: Label that identifies the destination cluster. + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the destination project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + hostnameSchemaType: + description: The network type to use between the migration host and the destination cluster. + type: string + privateLinkId: + description: Represents the endpoint to use when the host schema type is `PRIVATE_LINK`. + type: string + required: + - clusterName + - groupId + - hostnameSchemaType + type: object + DiskBackupApiPolicyItem: + description: Specifications for one policy. + properties: + frequencyInterval: + description: |- + Number that indicates the frequency interval for a set of Snapshots. A value of `1` specifies the first instance of the corresponding `frequencyType`. + + - In a yearly policy item, `1` indicates that the yearly Snapshot occurs on the first day of January and `12` indicates the first day of December. + + - In a monthly policy item, `1` indicates that the monthly Snapshot occurs on the first day of the month and `40` indicates the last day of the month. + + - In a weekly policy item, `1` indicates that the weekly Snapshot occurs on Monday and `7` indicates Sunday. + + - In an hourly policy item, you can set the frequency interval to `1`, `2`, `4`, `6`, `8`, or `12`. For hourly policy items for NVMe clusters, MongoDB Cloud accepts only `12` as the frequency interval value. + + MongoDB Cloud ignores this setting for non-hourly policy items in Backup Compliance Policy settings. + format: int32 + type: integer + frequencyType: + description: Human-readable label that identifies the frequency type associated with the backup policy. + type: string + id: + description: Unique 24-hexadecimal digit string that identifies this backup policy item. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + retentionUnit: + description: Unit of time in which MongoDB Cloud measures Snapshot retention. + type: string + retentionValue: + description: |- + Duration in days, weeks, months, or years that MongoDB Cloud retains the Snapshot. For less frequent policy items, MongoDB Cloud requires that you specify a value greater than or equal to the value specified for more frequent policy items. + + For example: If the hourly policy item specifies a retention of two days, you must specify two days or greater for the retention of the weekly policy item. + format: int32 + type: integer + required: + - frequencyInterval + - frequencyType + - retentionUnit + - retentionValue + type: object + DiskBackupCopySetting20240805: + description: Copy setting item in the desired backup policy. + properties: + cloudProvider: + description: Human-readable label that identifies the cloud provider that stores the snapshot copy. + type: string + frequencies: + description: List that describes which types of snapshots to copy. + items: + type: string + type: array + regionName: + description: Target region to copy snapshots belonging to zoneId. Please supply the 'Atlas Region'. + externalDocs: + description: Cloud Provider Regions + url: https://www.mongodb.com/docs/atlas/reference/cloud-providers/ + type: string + shouldCopyOplogs: + description: Flag that indicates whether to copy the oplogs to the target region. You can use the oplogs to perform point-in-time restores. + type: boolean + zoneId: + description: Unique 24-hexadecimal digit string that identifies the zone in a cluster. For global clusters, there can be multiple zones to choose from. For sharded clusters and replica set clusters, there is only one zone in the cluster. To find the Zone Id, do a GET request to Return One Cluster from One Project and consult the replicationSpecs array. + example: 32b6e34b3d91647abb20e7b8 + externalDocs: + description: Return One Cluster From One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/getCluster + pattern: ^([a-f0-9]{24})$ + type: string + required: + - zoneId + type: object + DiskBackupExportJob: + properties: + components: + description: Information on the export job for each replica set in the sharded cluster. + items: + $ref: "#/components/schemas/DiskBackupExportMember" + readOnly: true + type: array + createdAt: + description: Date and time when a user or Atlas created the Export Job. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + customData: + description: Collection of key-value pairs that represent custom data for the metadata file that MongoDB Cloud uploads when the Export Job finishes. + items: + $ref: "#/components/schemas/BackupLabel" + type: array + exportBucketId: + description: Unique 24-hexadecimal character string that identifies the Export Bucket. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + exportStatus: + $ref: "#/components/schemas/ExportStatus" + finishedAt: + description: Date and time when this Export Job completed. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal character string that identifies the restore job. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + prefix: + description: Prefix used for all blob storage objects uploaded as part of the Export Job. + pattern: /exported_snapshots/\{ORG-NAME\}/\{PROJECT-NAME\}/\{CLUSTER-NAME\}/\{SNAPSHOT-INITIATION-DATE\}/\{TIMESTAMP\} + readOnly: true + type: string + snapshotId: + description: Unique 24-hexadecimal character string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + state: + description: State of the Export Job. + readOnly: true + type: string + stateReason: + $ref: "#/components/schemas/StateReason" + required: + - exportBucketId + type: object + DiskBackupExportJobRequest: + properties: + customData: + description: Collection of key-value pairs that represent custom data to add to the metadata file that MongoDB Cloud uploads to the bucket when the export job finishes. + items: + $ref: "#/components/schemas/BackupLabel" + type: array + exportBucketId: + description: Unique 24-hexadecimal character string that identifies the Export Bucket. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + snapshotId: + description: Unique 24-hexadecimal character string that identifies the Cloud Backup Snapshot to export. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + required: + - exportBucketId + - snapshotId + type: object + DiskBackupExportMember: + properties: + exportId: + description: Unique 24-hexadecimal character string that identifies the the Cloud Backup snapshot export job for each shard in a sharded cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + replicaSetName: + description: Human-readable label that identifies the replica set on the sharded cluster. + readOnly: true + type: string + type: object + DiskBackupOnDemandSnapshotRequest: + properties: + description: + description: 'Human-readable phrase or sentence that explains the purpose of the snapshot. The resource returns this parameter when `"status" : "onDemand"`.' + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + retentionInDays: + description: Number of days that MongoDB Cloud should retain the on-demand snapshot. Must be at least **1**. + format: int32 + minimum: 1 + type: integer + type: object + DiskBackupReplicaSet: + description: Details of the replica set snapshot that MongoDB Cloud created. + properties: + cloudProvider: + description: 'Human-readable label that identifies the cloud provider that stores this snapshot. The resource returns this parameter when `"type": "replicaSet"`.' + readOnly: true + type: string + copyRegions: + description: List that identifies the regions to which MongoDB Cloud copies the snapshot. + items: + type: string + readOnly: true + type: array + createdAt: + description: Date and time when MongoDB Cloud took the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + description: + description: 'Human-readable phrase or sentence that explains the purpose of the snapshot. The resource returns this parameter when `"status": "onDemand"`.' + readOnly: true + type: string + expiresAt: + description: Date and time when MongoDB Cloud deletes the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + frequencyType: + description: Human-readable label that identifies how often this snapshot triggers. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + masterKeyUUID: + description: 'Unique string that identifies the Amazon Web Services (AWS) Key Management Service (KMS) Customer Master Key (CMK) used to encrypt the snapshot. The resource returns this value when `"encryptionEnabled" : true`.' + format: uuid + readOnly: true + type: string + mongodVersion: + description: Version of the MongoDB host that this snapshot backs up. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + policyItems: + description: List that contains unique identifiers for the policy items. + items: + description: Unique 24-hexadecimal digit string that identifies one policy item. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + readOnly: true + type: array + replicaSetName: + description: 'Human-readable label that identifies the replica set from which MongoDB Cloud took this snapshot. The resource returns this parameter when `"type": "replicaSet"`.' + readOnly: true + type: string + snapshotType: + description: Human-readable label that identifies when this snapshot triggers. + readOnly: true + type: string + status: + description: Human-readable label that indicates the stage of the backup process for this snapshot. + readOnly: true + type: string + storageSizeBytes: + description: Number of bytes taken to store the backup at time of snapshot. + format: int64 + readOnly: true + type: integer + type: + description: Human-readable label that categorizes the cluster as a replica set or sharded cluster. + readOnly: true + type: string + title: Replica Set Snapshot + type: object + DiskBackupRestoreMember: + properties: + downloadUrl: + description: 'One Uniform Resource Locator that points to the compressed snapshot files for manual download. MongoDB Cloud returns this parameter when `"deliveryType" : "download"`.' + readOnly: true + type: string + privateDownloadDeliveryUrls: + description: 'One or more Uniform Resource Locators (URLs) that point to the compressed snapshot files for manual download and the corresponding private endpoint(s). MongoDB Cloud returns this parameter when `"deliveryType" : "download"` and the download can be performed privately.' + items: + $ref: "#/components/schemas/ApiPrivateDownloadDeliveryUrl" + readOnly: true + type: array + replicaSetName: + description: Human-readable label that identifies the replica set on the sharded cluster. + readOnly: true + type: string + type: object + DiskBackupShardedClusterSnapshot: + description: Details of the sharded cluster snapshot that MongoDB Cloud created. + properties: + configServerType: + description: Describes a sharded cluster's config server type. + readOnly: true + type: string + createdAt: + description: Date and time when MongoDB Cloud took the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + description: + description: 'Human-readable phrase or sentence that explains the purpose of the snapshot. The resource returns this parameter when `"status": "onDemand"`.' + readOnly: true + type: string + expiresAt: + description: Date and time when MongoDB Cloud deletes the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + frequencyType: + description: Human-readable label that identifies how often this snapshot triggers. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + masterKeyUUID: + description: 'Unique string that identifies the Amazon Web Services (AWS) Key Management Service (KMS) Customer Master Key (CMK) used to encrypt the snapshot. The resource returns this value when `"encryptionEnabled" : true`.' + format: uuid + readOnly: true + type: string + members: + description: 'List that includes the snapshots and the cloud provider that stores the snapshots. The resource returns this parameter when `"type" : "SHARDED_CLUSTER"`.' + items: + $ref: "#/components/schemas/DiskBackupShardedClusterSnapshotMember" + readOnly: true + type: array + mongodVersion: + description: Version of the MongoDB host that this snapshot backs up. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + policyItems: + description: List that contains unique identifiers for the policy items. + items: + description: Unique 24-hexadecimal digit string that identifies one policy item. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + readOnly: true + type: array + snapshotIds: + description: 'List that contains the unique identifiers of the snapshots created for the shards and config host for a sharded cluster. The resource returns this parameter when `"type": "SHARDED_CLUSTER"`. These identifiers should match the ones specified in the **members[n].id** parameters. This allows you to map a snapshot to its shard or config host name.' + items: + description: Unique 24-hexadecimal digit string that identifies the snapshot for part of the sharded cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + readOnly: true + type: array + snapshotType: + description: Human-readable label that identifies when this snapshot triggers. + readOnly: true + type: string + status: + description: Human-readable label that indicates the stage of the backup process for this snapshot. + readOnly: true + type: string + storageSizeBytes: + description: Number of bytes taken to store the backup at time of snapshot. + format: int64 + readOnly: true + type: integer + type: + description: Human-readable label that categorizes the cluster as a replica set or sharded cluster. + readOnly: true + type: string + title: Sharded Cluster Snapshot + type: object + DiskBackupShardedClusterSnapshotMember: + properties: + cloudProvider: + description: 'Human-readable label that identifies the cloud provider that stores this snapshot. The resource returns this parameter when `"type": "replicaSet"`.' + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + replicaSetName: + description: Human-readable label that identifies the shard or config host from which MongoDB Cloud took this snapshot. + readOnly: true + type: string + required: + - cloudProvider + - id + - replicaSetName + type: object + DiskBackupSnapshot: + properties: + createdAt: + description: Date and time when MongoDB Cloud took the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + description: + description: 'Human-readable phrase or sentence that explains the purpose of the snapshot. The resource returns this parameter when `"status": "onDemand"`.' + readOnly: true + type: string + expiresAt: + description: Date and time when MongoDB Cloud deletes the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + frequencyType: + description: Human-readable label that identifies how often this snapshot triggers. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + masterKeyUUID: + description: 'Unique string that identifies the Amazon Web Services (AWS) Key Management Service (KMS) Customer Master Key (CMK) used to encrypt the snapshot. The resource returns this value when `"encryptionEnabled" : true`.' + format: uuid + readOnly: true + type: string + mongodVersion: + description: Version of the MongoDB host that this snapshot backs up. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + policyItems: + description: List that contains unique identifiers for the policy items. + items: + description: Unique 24-hexadecimal digit string that identifies one policy item. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + readOnly: true + type: array + snapshotType: + description: Human-readable label that identifies when this snapshot triggers. + readOnly: true + type: string + status: + description: Human-readable label that indicates the stage of the backup process for this snapshot. + readOnly: true + type: string + storageSizeBytes: + description: Number of bytes taken to store the backup at time of snapshot. + format: int64 + readOnly: true + type: integer + type: + description: Human-readable label that categorizes the cluster as a replica set or sharded cluster. + readOnly: true + type: string + cloudProvider: + description: 'Human-readable label that identifies the cloud provider that stores this snapshot. The resource returns this parameter when `"type": "replicaSet"`.' + readOnly: true + type: string + copyRegions: + description: List that identifies the regions to which MongoDB Cloud copies the snapshot. + items: + type: string + readOnly: true + type: array + replicaSetName: + description: 'Human-readable label that identifies the replica set from which MongoDB Cloud took this snapshot. The resource returns this parameter when `"type": "replicaSet"`.' + readOnly: true + type: string + configServerType: + description: Describes a sharded cluster's config server type. + readOnly: true + type: string + members: + description: 'List that includes the snapshots and the cloud provider that stores the snapshots. The resource returns this parameter when `"type" : "SHARDED_CLUSTER"`.' + items: + $ref: "#/components/schemas/DiskBackupShardedClusterSnapshotMember" + readOnly: true + type: array + snapshotIds: + description: 'List that contains the unique identifiers of the snapshots created for the shards and config host for a sharded cluster. The resource returns this parameter when `"type": "SHARDED_CLUSTER"`. These identifiers should match the ones specified in the **members[n].id** parameters. This allows you to map a snapshot to its shard or config host name.' + items: + description: Unique 24-hexadecimal digit string that identifies the snapshot for part of the sharded cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + readOnly: true + type: array + type: object + DiskBackupSnapshotExportBucketRequest: + description: Disk backup snapshot Export Bucket Request. + properties: + cloudProvider: + description: Human-readable label that identifies the cloud provider that Snapshots are exported to. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + bucketName: + description: Human-readable label that identifies the Google Cloud Storage Bucket that the role is authorized to export to. + example: export-bucket + maxLength: 63 + minLength: 3 + type: string + iamRoleId: + description: Unique 24-hexadecimal character string that identifies the Unified AWS Access role ID that MongoDB Cloud uses to access the AWS S3 bucket. + example: 32b6e34b3d91647abb20e7b8 + externalDocs: + description: Unified AWS Access role ID + url: https://www.mongodb.com/docs/atlas/security/set-up-unified-aws-access/ + pattern: ^([a-f0-9]{24})$ + type: string + roleId: + description: Unique 24-hexadecimal digit string that identifies the GCP Cloud Provider Access Role that MongoDB Cloud uses to access the Google Cloud Storage Bucket. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + serviceUrl: + description: 'URL of the Azure Storage Account to export to. For example: "https://examplestorageaccount.blob.core.windows.net/exportcontainer". Only standard endpoints (with "blob.core.windows.net") are supported.' + example: https://examplestorageaccount.blob.core.windows.net/exportcontainer + maxLength: 2048 + minLength: 33 + type: string + tenantId: + deprecated: true + description: "UUID that identifies the Azure Active Directory Tenant ID. Deprecated: this field is ignored; the tenantId of the Cloud Provider Access role (from roleId) is used." + format: uuid + type: string + required: + - cloudProvider + type: object + DiskBackupSnapshotExportBucketResponse: + description: Disk backup snapshot Export Bucket. + properties: + _id: + description: Unique 24-hexadecimal character string that identifies the Export Bucket. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + bucketName: + description: The name of the AWS S3 Bucket, Azure Storage Container, or Google Cloud Storage Bucket that Snapshots are exported to. + example: export-bucket + maxLength: 63 + minLength: 3 + type: string + cloudProvider: + description: Human-readable label that identifies the cloud provider that Snapshots will be exported to. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + iamRoleId: + description: Unique 24-hexadecimal character string that identifies the Unified AWS Access role ID that MongoDB Cloud uses to access the AWS S3 bucket. + example: 32b6e34b3d91647abb20e7b8 + externalDocs: + description: Unified AWS Access role ID + url: https://www.mongodb.com/docs/atlas/security/set-up-unified-aws-access/ + pattern: ^([a-f0-9]{24})$ + type: string + roleId: + description: Unique 24-hexadecimal digit string that identifies the GCP Cloud Provider Access Role that MongoDB Cloud uses to access the Google Cloud Storage Bucket. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + serviceUrl: + description: URL of the Azure Storage Account to export to. Only standard endpoints (with "blob.core.windows.net") are supported. + example: https://examplestorageaccount.blob.core.windows.net/exportcontainer + maxLength: 2048 + minLength: 33 + type: string + tenantId: + description: UUID that identifies the Azure Active Directory Tenant ID used during exports. + format: uuid + type: string + required: + - _id + - bucketName + - cloudProvider + type: object + DiskBackupSnapshotRestoreJob: + properties: + cancelled: + description: Flag that indicates whether someone canceled this restore job. + readOnly: true + type: boolean + components: + description: Information on the restore job for each replica set in the sharded cluster. + items: + $ref: "#/components/schemas/DiskBackupRestoreMember" + readOnly: true + type: array + deliveryType: + description: Human-readable label that categorizes the restore job to create. + type: string + deliveryUrl: + description: 'One or more Uniform Resource Locators (URLs) that point to the compressed snapshot files for manual download. MongoDB Cloud returns this parameter when `"deliveryType" : "download"`.' + items: + description: One Uniform Resource Locator that points to the compressed snapshot files for manual download. + type: string + readOnly: true + type: array + desiredTimestamp: + $ref: "#/components/schemas/ApiBSONTimestamp" + expired: + description: Flag that indicates whether the restore job expired. + readOnly: true + type: boolean + expiresAt: + description: Date and time when the restore job expires. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + failed: + description: Flag that indicates whether the restore job failed. + readOnly: true + type: boolean + finishedAt: + description: Date and time when the restore job completed. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal character string that identifies the restore job. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + oplogInc: + description: 'Oplog operation number from which you want to restore this snapshot. This number represents the second part of an Oplog timestamp. The resource returns this parameter when `"deliveryType" : "pointInTime"` and **oplogTs** exceeds `0`.' + example: 1 + format: int32 + minimum: 1 + type: integer + oplogTs: + description: 'Date and time from which you want to restore this snapshot. This parameter expresses this timestamp in the number of seconds that have elapsed since the UNIX epoch. This number represents the first part of an Oplog timestamp. The resource returns this parameter when `"deliveryType" : "pointInTime"` and **oplogTs** exceeds `0`.' + format: int32 + minimum: 1199145600 + type: integer + pointInTimeUTCSeconds: + description: 'Date and time from which MongoDB Cloud restored this snapshot. This parameter expresses this timestamp in the number of seconds that have elapsed since the UNIX epoch. The resource returns this parameter when `"deliveryType" : "pointInTime"` and **pointInTimeUTCSeconds** exceeds `0`.' + format: int32 + minimum: 1199145600 + type: integer + privateDownloadDeliveryUrls: + description: 'One or more Uniform Resource Locators (URLs) that point to the compressed snapshot files for manual download and the corresponding private endpoint(s). MongoDB Cloud returns this parameter when `"deliveryType" : "download"` and the download can be performed privately.' + items: + $ref: "#/components/schemas/ApiPrivateDownloadDeliveryUrl" + readOnly: true + type: array + snapshotId: + description: Unique 24-hexadecimal character string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + targetClusterName: + description: Human-readable label that identifies the target cluster to which the restore job restores the snapshot. The resource returns this parameter when `"deliveryType":` `"automated"`. Required for `automated` and `pointInTime` restore types. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + targetGroupId: + description: Unique 24-hexadecimal digit string that identifies the target project for the specified **targetClusterName**. Required for `automated` and `pointInTime` restore types. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + timestamp: + description: Date and time when MongoDB Cloud took the snapshot associated with **snapshotId**. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + required: + - deliveryType + type: object + DiskBackupSnapshotSchedule20240805: + properties: + autoExportEnabled: + description: Flag that indicates whether MongoDB Cloud automatically exports Cloud Backup Snapshots to the Export Bucket. + type: boolean + clusterId: + description: Unique 24-hexadecimal digit string that identifies the cluster with the Snapshot you want to return. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + clusterName: + description: Human-readable label that identifies the cluster with the Snapshot you want to return. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + copySettings: + description: List that contains a document for each copy setting item in the desired backup policy. + items: + $ref: "#/components/schemas/DiskBackupCopySetting20240805" + type: array + deleteCopiedBackups: + description: List that contains a document for each deleted copy setting whose backup copies you want to delete. + items: + $ref: "#/components/schemas/DeleteCopiedBackups20240805" + type: array + writeOnly: true + export: + $ref: "#/components/schemas/AutoExportPolicy" + extraRetentionSettings: + description: List that contains a document for each extra retention setting item in the desired backup policy. + items: + $ref: "#/components/schemas/ExtraRetentionSetting" + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + nextSnapshot: + description: Date and time when MongoDB Cloud takes the next Snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + policies: + description: Rules set for this backup schedule. + items: + $ref: "#/components/schemas/AdvancedDiskBackupSnapshotSchedulePolicy" + maxItems: 1 + type: array + referenceHourOfDay: + description: Hour of day in Coordinated Universal Time (UTC) that represents when MongoDB Cloud takes the Snapshot. + format: int32 + type: integer + referenceMinuteOfHour: + description: Minute of the **referenceHourOfDay** that represents when MongoDB Cloud takes the Snapshot. + format: int32 + type: integer + restoreWindowDays: + description: Number of previous days that you can restore back to with Continuous Cloud Backup accuracy. You must specify a positive, non-zero integer. This parameter applies to continuous Cloud Backups only. + format: int32 + type: integer + updateSnapshots: + description: Flag that indicates whether to apply the retention changes in the updated backup policy to Snapshots that MongoDB Cloud took previously. + type: boolean + writeOnly: true + useOrgAndGroupNamesInExportPrefix: + description: Flag that indicates whether to use organization and project names instead of organization and project UUIDs in the path to the metadata files that MongoDB Cloud uploads to your Export Bucket. + type: boolean + type: object + DiskGBAutoScaling: + description: Setting that enables disk auto-scaling. + properties: + enabled: + description: Flag that indicates whether this cluster enables disk auto-scaling. The maximum memory allowed for the selected cluster tier and the oplog size can limit storage auto-scaling. + type: boolean + type: object + Document: + type: object + DropIndexSuggestionsIndex: + properties: + accessCount: + description: Usage count (since last restart) of index. + format: int64 + type: integer + index: + description: List that contains documents that specify a key in the index and its sort order. + items: + description: One index key paired with its sort order. A value of `1` indicates an ascending sort order. A value of `-1` indicates a descending sort order. Keys in indexes with multiple keys appear in the same order that they appear in the index. + type: object + x-xgen-IPA-exception: + xgen-IPA-117-objects-must-be-well-defined: Schema predates IPA validation + type: array + name: + description: Name of index. + type: string + namespace: + description: Human-readable label that identifies the namespace on the specified host. The resource expresses this parameter value as `.`. + type: string + shards: + description: List that contains strings that specifies the shards where the index is found. + items: + description: Shard name. + type: string + type: array + since: + description: Date of most recent usage of index. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + sizeBytes: + description: Size of index. + format: int64 + type: integer + type: object + DropIndexSuggestionsResponse: + properties: + hiddenIndexes: + description: List that contains the documents with information about the hidden indexes that the Performance Advisor suggests to remove. + items: + $ref: "#/components/schemas/DropIndexSuggestionsIndex" + readOnly: true + type: array + redundantIndexes: + description: List that contains the documents with information about the redundant indexes that the Performance Advisor suggests to remove. + items: + $ref: "#/components/schemas/DropIndexSuggestionsIndex" + readOnly: true + type: array + unusedIndexes: + description: List that contains the documents with information about the unused indexes that the Performance Advisor suggests to remove. + items: + $ref: "#/components/schemas/DropIndexSuggestionsIndex" + readOnly: true + type: array + type: object + EARPrivateEndpoint: + description: Encryption At Rest Private Endpoint. + properties: + cloudProvider: + description: Human-readable label that identifies the cloud provider for the Encryption At Rest private endpoint. + readOnly: true + type: string + errorMessage: + description: Error message for failures associated with the Encryption At Rest private endpoint. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the Private Endpoint Service. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + regionName: + description: Cloud provider region in which the Encryption At Rest private endpoint is located. + type: string + status: + description: State of the Encryption At Rest private endpoint. + readOnly: true + type: string + privateEndpointConnectionName: + description: Resource Id of the Aws Private Endpoint. + readOnly: true + type: string + title: Encryption At Rest Private Endpoint + type: object + EncryptionAtRest: + properties: + awsKms: + $ref: "#/components/schemas/AWSKMSConfiguration" + azureKeyVault: + $ref: "#/components/schemas/AzureKeyVault" + enabledForSearchNodes: + description: Flag that indicates whether Encryption at Rest for Dedicated Search Nodes is enabled in the specified project. + type: boolean + googleCloudKms: + $ref: "#/components/schemas/GoogleCloudKMS" + type: object + EndpointService: + properties: + cloudProvider: + description: Cloud service provider that serves the requested endpoint service. + readOnly: true + type: string + errorMessage: + description: Error message returned when requesting private connection resource. The resource returns `null` if the request succeeded. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the Private Endpoint Service. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + regionName: + description: Cloud provider region that manages this Private Endpoint Service. + readOnly: true + type: string + status: + description: State of the Private Endpoint Service connection when MongoDB Cloud received this request. + readOnly: true + type: string + endpointServiceName: + description: Unique string that identifies the Amazon Web Services (AWS) PrivateLink endpoint service. MongoDB Cloud returns null while it creates the endpoint service. + pattern: ^com\.amazonaws\.vpce\.[a-z-0-9]+\.vpce-svc-[0-9a-f]{17} + readOnly: true + type: string + interfaceEndpoints: + description: List of strings that identify private endpoint interfaces applied to the specified project. + items: + description: Unique 24-hexadecimal digit string that identifies the interface endpoint. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + readOnly: true + type: array + privateEndpoints: + description: List of private endpoints assigned to this Azure Private Link Service. + items: + description: Root-relative path to one private endpoint assigned to this Azure Private Link Service. + pattern: ^\/subscriptions\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/resource[gG]roups\/([-\w._()]+)\/providers\/Microsoft\.Network\/privateEndpoints\/([-\w._()]+) + readOnly: true + type: string + readOnly: true + type: array + privateLinkServiceName: + description: Unique string that identifies the Azure Private Link Service that MongoDB Cloud manages. + pattern: ^pls_[0-9a-f]{24}$ + readOnly: true + type: string + privateLinkServiceResourceId: + description: Root-relative path that identifies of the Azure Private Link Service that MongoDB Cloud manages. Use this value to create a private endpoint connection to an Azure VNet. + example: /subscriptions/ae349d51-d12b-ee3d-2a27-7d53f6479cf0/resourcegroups/KObGGz/providers/Microsoft.Network/privateLinkServices/pls_d1820713f8153388d533e9de + readOnly: true + type: string + endpointGroupNames: + description: List of Google Cloud network endpoint groups that corresponds to the Private Service Connect endpoint service. + externalDocs: + description: Google Cloud Forwarding Rule Concepts + url: https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts + items: + description: One Google Cloud network endpoint group that corresponds to the Private Service Connect endpoint service. + type: string + type: array + serviceAttachmentNames: + description: List of Uniform Resource Locators (URLs) that identifies endpoints that MongoDB Cloud can use to access one Google Cloud Service across a Google Cloud Virtual Private Connection (VPC) network. + externalDocs: + description: Google Cloud Private Service Connect Service Attachments + url: https://cloud.google.com/vpc/docs/private-service-connect#service-attachments + items: + description: Uniform Resource Locator (URL) that identifies one endpoint that MongoDB Cloud can use to access one Google Cloud Service across a Google Cloud Virtual Private Connection (VPC) network. + pattern: https:\/\/([a-z0-9\.]+)+\.[a-z]{2,}(\/[a-z0-9\-]+)+\/projects\/p-[a-z0-9]+\/regions\/[a-z\-0-9]+\/serviceAttachments\/[a-z0-9\-]+ + type: string + type: array + required: + - cloudProvider + type: object + EventSeverity: + description: Severity of the event. + type: string + EventTypeDetails: + description: A singular type of event + properties: + alertable: + description: Whether or not this event type can be configured as an alert via the API. + readOnly: true + type: boolean + description: + description: Description of the event type. + readOnly: true + type: string + eventType: + description: Enum representation of the event type. + readOnly: true + type: string + title: Event type details + type: object + EventTypeForNdsGroup: + type: string + EventTypeForOrg: + type: string + EventViewForNdsGroup: + type: object + properties: + apiKeyId: + description: Unique 24-hexadecimal digit string that identifies the API Key that triggered the event. If this resource returns this parameter, it doesn't return the **userId** parameter. + example: 32b6e34b3d91647abb20e7b8 + externalDocs: + description: Create Programmatic API Key + url: https://dochub.mongodb.org/core/atlas-create-prog-api-key + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + created: + description: Date and time when this event occurred. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + readOnly: true + type: string + eventTypeName: + description: Unique identifier of event type. + example: RESOURCE_POLICY_VIOLATED + title: Atlas Resource Policy Audit Types + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project in which the event occurred. The **eventId** identifies the specific event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + isGlobalAdmin: + description: Flag that indicates whether a MongoDB employee triggered the specified event. + readOnly: true + type: boolean + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + orgId: + description: Unique 24-hexadecimal digit string that identifies the organization to which these events apply. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + publicKey: + description: Public part of the API key that triggered the event. If this resource returns this parameter, it doesn't return the **username** parameter. + externalDocs: + url: https://dochub.mongodb.org/core/atlas-create-prog-api-key + readOnly: true + type: string + raw: + $ref: "#/components/schemas/raw" + remoteAddress: + description: IPv4 or IPv6 address from which the user triggered this event. + example: 216.172.40.186 + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + readOnly: true + type: string + userId: + description: Unique 24-hexadecimal digit string that identifies the console user who triggered the event. If this resource returns this parameter, it doesn't return the **apiKeyId** parameter. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + username: + description: Email address for the user who triggered this event. If this resource returns this parameter, it doesn't return the **publicApiKey** parameter. + format: email + readOnly: true + type: string + alertId: + description: Unique 24-hexadecimal digit string that identifies the alert associated with the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + alertConfigId: + description: Unique 24-hexadecimal digit string that identifies the alert configuration associated with the **alertId**. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + invoiceId: + description: Unique 24-hexadecimal digit string that identifies of the invoice associated with the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + paymentId: + description: Unique 24-hexadecimal digit string that identifies the invoice payment associated with this event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + shardName: + description: Human-readable label of the shard associated with the event. + example: event-sh-01 + readOnly: true + type: string + collection: + description: Human-readable label of the collection on which the event occurred. The resource returns this parameter when the **eventTypeName** includes `DATA_EXPLORER`. + example: test_collection + readOnly: true + type: string + database: + description: 'Human-readable label of the database on which this incident occurred. The resource returns this parameter when `"eventTypeName" : "DATA_EXPLORER"` or `"eventTypeName" : "DATA_EXPLORER_CRUD"`.' + example: test_db + readOnly: true + type: string + opType: + description: 'Action that the database attempted to execute when the event triggered. The response returns this parameter when `eventTypeName" : "DATA_EXPLORER"`.' + example: insertDocument + readOnly: true + type: string + sessionId: + description: Unique 24-hexadecimal digit string that identifies the Data Explorer session associated with the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + deskLocation: + description: Desk location of MongoDB employee associated with the event. + readOnly: true + type: string + employeeIdentifier: + description: Identifier of MongoDB employee associated with the event. + readOnly: true + type: string + port: + description: IANA port on which the MongoDB process listens for requests. + example: 27017 + format: int32 + readOnly: true + type: integer + replicaSetName: + description: Human-readable label of the replica set associated with the event. + example: event-replica-set + readOnly: true + type: string + currentValue: + $ref: "#/components/schemas/NumberMetricValue" + metricName: + description: Human-readable label of the metric associated with the **alertId**. This field may change type of **currentValue** field. + readOnly: true + type: string + dbUserUsername: + description: The username of the MongoDB User that was created, deleted, or edited. + example: user1 + readOnly: true + type: string + whitelistEntry: + description: Entry in the list of source host addresses that the API key accepts and this event targets. + example: 0.0.0.0 + readOnly: true + type: string + endpointId: + description: Unique 24-hexadecimal digit string that identifies the endpoint associated with this event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + providerEndpointId: + description: Unique identification string that the cloud provider uses to identify the private endpoint. + example: vpce-0d6c248dedef65a25 + readOnly: true + type: string + teamId: + description: Unique 24-hexadecimal digit string that identifies the organization team associated with this event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + targetUsername: + description: 'Email address for the console user that this event targets. The resource returns this parameter when `"eventTypeName" : "USER"`.' + example: test.user@mongodb.com + format: email + readOnly: true + type: string + resourceId: + description: Unique 24-hexadecimal digit string that identifies the resource associated with the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + resourceType: + description: Unique identifier of resource type. + example: cluster + type: string + instanceName: + description: Name of the stream processing instance associated with the event. + example: foobar + readOnly: true + type: string + processorErrorMsg: + description: Error message linked to the stream processor associated with the event. + example: invalid auth + readOnly: true + type: string + processorName: + description: Name of the stream processor associated with the event. + example: foobar + readOnly: true + type: string + processorState: + description: State of the stream processor associated with the event. + example: FAILED + readOnly: true + type: string + resourcePolicyId: + description: Unique 24-hexadecimal character string that identifies the resource policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + violatedPolicies: + description: String representation of the violated resource policy ids. + items: + type: string + type: array + violationAction: + description: Resource policy action taken by the user and evaluated against the currently active policies. + readOnly: true + type: string + EventViewForOrg: + type: object + properties: + apiKeyId: + description: Unique 24-hexadecimal digit string that identifies the API Key that triggered the event. If this resource returns this parameter, it doesn't return the **userId** parameter. + example: 32b6e34b3d91647abb20e7b8 + externalDocs: + description: Create Programmatic API Key + url: https://dochub.mongodb.org/core/atlas-create-prog-api-key + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + created: + description: Date and time when this event occurred. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + readOnly: true + type: string + eventTypeName: + description: Unique identifier of event type. + example: RESOURCE_POLICY_CREATED + title: Atlas Resource Policy Audit Types + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project in which the event occurred. The **eventId** identifies the specific event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + isGlobalAdmin: + description: Flag that indicates whether a MongoDB employee triggered the specified event. + readOnly: true + type: boolean + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + orgId: + description: Unique 24-hexadecimal digit string that identifies the organization to which these events apply. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + publicKey: + description: Public part of the API key that triggered the event. If this resource returns this parameter, it doesn't return the **username** parameter. + externalDocs: + url: https://dochub.mongodb.org/core/atlas-create-prog-api-key + readOnly: true + type: string + raw: + $ref: "#/components/schemas/raw" + remoteAddress: + description: IPv4 or IPv6 address from which the user triggered this event. + example: 216.172.40.186 + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + readOnly: true + type: string + userId: + description: Unique 24-hexadecimal digit string that identifies the console user who triggered the event. If this resource returns this parameter, it doesn't return the **apiKeyId** parameter. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + username: + description: Email address for the user who triggered this event. If this resource returns this parameter, it doesn't return the **publicApiKey** parameter. + format: email + readOnly: true + type: string + alertId: + description: Unique 24-hexadecimal digit string that identifies the alert associated with the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + alertConfigId: + description: Unique 24-hexadecimal digit string that identifies the alert configuration associated with the **alertId**. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + invoiceId: + description: Unique 24-hexadecimal digit string that identifies of the invoice associated with the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + paymentId: + description: Unique 24-hexadecimal digit string that identifies the invoice payment associated with this event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + dbUserUsername: + description: The username of the MongoDB User that was created, deleted, or edited. + example: user1 + readOnly: true + type: string + whitelistEntry: + description: Entry in the list of source host addresses that the API key accepts and this event targets. + example: 0.0.0.0 + readOnly: true + type: string + teamId: + description: Unique 24-hexadecimal digit string that identifies the organization team associated with this event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + targetUsername: + description: 'Email address for the console user that this event targets. The resource returns this parameter when `"eventTypeName" : "USER"`.' + example: test.user@mongodb.com + format: email + readOnly: true + type: string + resourceId: + description: Unique 24-hexadecimal digit string that identifies the resource associated with the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + resourceType: + description: Unique identifier of resource type. + example: cluster + type: string + resourcePolicyId: + description: Unique 24-hexadecimal character string that identifies the resource policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + ExportStatus: + description: State of the Export Job. + properties: + exportedCollections: + description: Count of collections whose documents were exported to the Export Bucket. + format: int32 + readOnly: true + type: integer + totalCollections: + description: Total count of collections whose documents will be exported to the Export Bucket. + format: int32 + readOnly: true + type: integer + type: object + ExtraRetentionSetting: + description: extra retention setting item in the desired backup policy. + properties: + frequencyType: + description: The frequency type for the extra retention settings for the cluster. + type: string + retentionDays: + description: The number of extra retention days for the cluster. + format: int32 + type: integer + type: object + FTSMetric: + description: Measurement of one Atlas Search status when MongoDB Atlas received this request. + properties: + metricName: + description: Human-readable label that identifies this Atlas Search hardware, status, or index measurement. + readOnly: true + type: string + units: + description: Unit of measurement that applies to this Atlas Search metric. + readOnly: true + type: string + readOnly: true + required: + - metricName + - units + type: object + FederatedUser: + description: MongoDB Cloud user linked to this federated authentication. + properties: + emailAddress: + description: Email address of the MongoDB Cloud user linked to the federated organization. + format: email + type: string + federationSettingsId: + description: Unique 24-hexadecimal digit string that identifies the federation to which this MongoDB Cloud user belongs. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + firstName: + description: First or given name that belongs to the MongoDB Cloud user. + type: string + lastName: + description: Last name, family name, or surname that belongs to the MongoDB Cloud user. + type: string + userId: + description: Unique 24-hexadecimal digit string that identifies this user. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + required: + - emailAddress + - federationSettingsId + - firstName + - lastName + title: Federated User + type: object + FederationIdentityProvider: + properties: + associatedOrgs: + description: List that contains the connected organization configurations associated with the identity provider. + items: + $ref: "#/components/schemas/ConnectedOrgConfig" + type: array + uniqueItems: true + createdAt: + description: Date that the identity provider was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + description: + description: The description of the identity provider. + type: string + displayName: + description: Human-readable label that identifies the identity provider. + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the identity provider. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + idpType: + description: String enum that indicates the type of the identity provider. Default is WORKFORCE. + type: string + issuerUri: + description: Unique string that identifies the issuer of the SAML Assertion or OIDC metadata/discovery document URL. + type: string + oktaIdpId: + description: Legacy 20-hexadecimal digit string that identifies the identity provider. + pattern: ^([a-f0-9]{20})$ + type: string + protocol: + description: String enum that indicates the protocol of the identity provider. Either SAML or OIDC. + type: string + updatedAt: + description: Date that the identity provider was last updated on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + acsUrl: + description: URL that points to where to send the SAML response. + type: string + associatedDomains: + description: List that contains the domains associated with the identity provider. + items: + type: string + type: array + uniqueItems: true + audienceUri: + description: Unique string that identifies the intended audience of the SAML assertion. + type: string + pemFileInfo: + $ref: "#/components/schemas/PemFileInfo" + requestBinding: + description: SAML Authentication Request Protocol HTTP method binding (POST or REDIRECT) that Federated Authentication uses to send the authentication request. + type: string + responseSignatureAlgorithm: + description: Signature algorithm that Federated Authentication uses to encrypt the identity provider signature. + type: string + slug: + description: Custom SSO Url for the identity provider. + type: string + ssoDebugEnabled: + description: Flag that indicates whether the identity provider has SSO debug enabled. + type: boolean + ssoUrl: + description: URL that points to the receiver of the SAML authentication request. + type: string + status: + description: String enum that indicates whether the identity provider is active. + type: string + audience: + description: Identifier of the intended recipient of the token. + type: string + authorizationType: + description: Indicates whether authorization is granted based on group membership or user ID. + type: string + clientId: + description: Client identifier that is assigned to an application by the Identity Provider. + type: string + groupsClaim: + description: Identifier of the claim which contains IdP Group IDs in the token. + type: string + requestedScopes: + description: Scopes that MongoDB applications will request from the authorization endpoint. + items: + type: string + type: array + userClaim: + description: Identifier of the claim which contains the user ID in the token. + type: string + required: + - id + - oktaIdpId + type: object + FederationIdentityProviderUpdate: + properties: + description: + description: The description of the identity provider. + type: string + displayName: + description: Human-readable label that identifies the identity provider. + maxLength: 50 + minLength: 1 + type: string + idpType: + description: String enum that indicates the type of the identity provider. Default is WORKFORCE. + type: string + issuerUri: + description: Unique string that identifies the issuer of the SAML Assertion or OIDC metadata/discovery document URL. + example: urn:idp:default + type: string + protocol: + description: String enum that indicates the protocol of the identity provider. Either SAML or OIDC. + type: string + associatedDomains: + description: List that contains the domains associated with the identity provider. + items: + type: string + type: array + uniqueItems: true + pemFileInfo: + $ref: "#/components/schemas/PemFileInfoUpdate" + requestBinding: + description: SAML Authentication Request Protocol HTTP method binding (POST or REDIRECT) that Federated Authentication uses to send the authentication request. + type: string + responseSignatureAlgorithm: + description: Signature algorithm that Federated Authentication uses to encrypt the identity provider signature. + type: string + slug: + description: Custom SSO Url for the identity provider. + type: string + ssoDebugEnabled: + description: Flag that indicates whether the identity provider has SSO debug enabled. + type: boolean + ssoUrl: + description: URL that points to the receiver of the SAML authentication request. + example: https://example.com + type: string + status: + description: String enum that indicates whether the identity provider is active. + type: string + audience: + description: Identifier of the intended recipient of the token. + type: string + authorizationType: + description: Indicates whether authorization is granted based on group membership or user ID. + type: string + clientId: + description: Client identifier that is assigned to an application by the Identity Provider. + type: string + groupsClaim: + description: Identifier of the claim which contains IdP Group IDs in the token. + type: string + requestedScopes: + description: Scopes that MongoDB applications will request from the authorization endpoint. + items: + type: string + type: array + userClaim: + description: Identifier of the claim which contains the user ID in the token. + type: string + type: object + FederationOidcIdentityProvider: + properties: + associatedOrgs: + description: List that contains the connected organization configurations associated with the identity provider. + items: + $ref: "#/components/schemas/ConnectedOrgConfig" + type: array + uniqueItems: true + audience: + description: Identifier of the intended recipient of the token. + type: string + authorizationType: + description: Indicates whether authorization is granted based on group membership or user ID. + type: string + createdAt: + description: Date that the identity provider was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + description: + description: The description of the identity provider. + type: string + displayName: + description: Human-readable label that identifies the identity provider. + type: string + groupsClaim: + description: Identifier of the claim which contains IdP Group IDs in the token. + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the identity provider. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + idpType: + description: String enum that indicates the type of the identity provider. Default is WORKFORCE. + type: string + issuerUri: + description: Unique string that identifies the issuer of the SAML Assertion or OIDC metadata/discovery document URL. + type: string + oktaIdpId: + description: Legacy 20-hexadecimal digit string that identifies the identity provider. + pattern: ^([a-f0-9]{20})$ + type: string + protocol: + description: String enum that indicates the protocol of the identity provider. Either SAML or OIDC. + type: string + updatedAt: + description: Date that the identity provider was last updated on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + userClaim: + description: Identifier of the claim which contains the user ID in the token. + type: string + associatedDomains: + description: List that contains the domains associated with the identity provider. + items: + type: string + type: array + uniqueItems: true + clientId: + description: Client identifier that is assigned to an application by the Identity Provider. + type: string + requestedScopes: + description: Scopes that MongoDB applications will request from the authorization endpoint. + items: + type: string + type: array + required: + - id + - oktaIdpId + type: object + FederationOidcIdentityProviderUpdate: + properties: + audience: + description: Identifier of the intended recipient of the token. + type: string + authorizationType: + description: Indicates whether authorization is granted based on group membership or user ID. + type: string + description: + description: The description of the identity provider. + type: string + displayName: + description: Human-readable label that identifies the identity provider. + maxLength: 50 + minLength: 1 + type: string + groupsClaim: + description: Identifier of the claim which contains IdP Group IDs in the token. + type: string + idpType: + description: String enum that indicates the type of the identity provider. Default is WORKFORCE. + type: string + issuerUri: + description: Unique string that identifies the issuer of the SAML Assertion or OIDC metadata/discovery document URL. + example: urn:idp:default + type: string + protocol: + description: String enum that indicates the protocol of the identity provider. Either SAML or OIDC. + type: string + userClaim: + description: Identifier of the claim which contains the user ID in the token. + type: string + associatedDomains: + description: List that contains the domains associated with the identity provider. + items: + type: string + type: array + uniqueItems: true + clientId: + description: Client identifier that is assigned to an application by the Identity Provider. + type: string + requestedScopes: + description: Scopes that MongoDB applications will request from the authorization endpoint. + items: + type: string + type: array + type: object + FieldTransformation: + description: Field Transformations during ingestion of a Data Lake Pipeline. + properties: + field: + description: Key in the document. + type: string + type: + description: Type of transformation applied during the export of the namespace in a Data Lake Pipeline. + type: string + title: Field Transformation + type: object + FieldViolation: + properties: + description: + description: A description of why the request element is bad. + type: string + field: + description: A path that leads to a field in the request body. + type: string + required: + - description + - field + type: object + Fields: + externalDocs: + description: Atlas Search Field Mappings + url: https://dochub.mongodb.org/core/field-mapping-definition-fts#define-field-mappings + type: object + FlexBackupRestoreJob20241113: + description: Details for one restore job of a flex cluster. + properties: + deliveryType: + description: Means by which this resource returns the snapshot to the requesting MongoDB Cloud user. + readOnly: true + type: string + expirationDate: + description: Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the restore job. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + instanceName: + description: Human-readable label that identifies the source instance. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + projectId: + description: Unique 24-hexadecimal digit string that identifies the project from which the restore job originated. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + restoreFinishedDate: + description: Date and time when MongoDB Cloud completed writing this snapshot. MongoDB Cloud changes the status of the restore job to `CLOSED`. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + restoreScheduledDate: + description: Date and time when MongoDB Cloud will restore this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + snapshotFinishedDate: + description: Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + snapshotId: + description: Unique 24-hexadecimal digit string that identifies the snapshot to restore. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + snapshotUrl: + description: 'Internet address from which you can download the compressed snapshot files. The resource returns this parameter when `"deliveryType" : "DOWNLOAD"`.' + readOnly: true + type: string + status: + description: Phase of the restore workflow for this job at the time this resource made this request. + readOnly: true + type: string + targetDeploymentItemName: + description: Human-readable label that identifies the instance or cluster on the target project to which you want to restore the snapshot. You can restore the snapshot to another flex or dedicated cluster tier. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + readOnly: true + type: string + targetProjectId: + description: Unique 24-hexadecimal digit string that identifies the project that contains the instance or cluster to which you want to restore the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + title: Flex Backup Restore Job + type: object + FlexBackupRestoreJobCreate20241113: + description: Details to create one restore job of a flex cluster. + properties: + deliveryType: + description: Means by which this resource returns the snapshot to the requesting MongoDB Cloud user. + readOnly: true + type: string + expirationDate: + description: Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the restore job. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + instanceName: + description: Human-readable label that identifies the source instance. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + projectId: + description: Unique 24-hexadecimal digit string that identifies the project from which the restore job originated. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + restoreFinishedDate: + description: Date and time when MongoDB Cloud completed writing this snapshot. MongoDB Cloud changes the status of the restore job to `CLOSED`. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + restoreScheduledDate: + description: Date and time when MongoDB Cloud will restore this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + snapshotFinishedDate: + description: Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + snapshotId: + description: Unique 24-hexadecimal digit string that identifies the snapshot to restore. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + snapshotUrl: + description: 'Internet address from which you can download the compressed snapshot files. The resource returns this parameter when `"deliveryType" : "DOWNLOAD"`.' + readOnly: true + type: string + status: + description: Phase of the restore workflow for this job at the time this resource made this request. + readOnly: true + type: string + targetDeploymentItemName: + description: Human-readable label that identifies the instance or cluster on the target project to which you want to restore the snapshot. You can restore the snapshot to another flex cluster or dedicated cluster tier. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + type: string + writeOnly: true + targetProjectId: + description: Unique 24-hexadecimal digit string that identifies the project that contains the instance or cluster to which you want to restore the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + required: + - snapshotId + - targetDeploymentItemName + title: Create Flex Backup Restore Job + type: object + FlexBackupSettings20241113: + description: Flex backup configuration. + properties: + enabled: + default: true + description: Flag that indicates whether backups are performed for this flex cluster. Backup uses flex cluster backups. + externalDocs: + description: Flex Cluster Backups + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/flex-cluster-backup/ + readOnly: true + type: boolean + readOnly: true + title: Flex Backup Configuration + type: object + FlexBackupSnapshot20241113: + description: Details for one snapshot of a flex cluster. + properties: + expiration: + description: Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + finishTime: + description: Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongoDBVersion: + description: MongoDB host version that the snapshot runs. + readOnly: true + type: string + scheduledTime: + description: Date and time when MongoDB Cloud will take the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + startTime: + description: Date and time when MongoDB Cloud began taking the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + status: + description: Phase of the workflow for this snapshot at the time this resource made this request. + readOnly: true + type: string + title: Flex Backup Snapshot + type: object + FlexBackupSnapshotDownloadCreate20241113: + description: Details for one backup snapshot download of a flex cluster. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + snapshotId: + description: Unique 24-hexadecimal digit string that identifies the snapshot to download. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + required: + - snapshotId + title: Flex Backup Snapshot Download Create + type: object + FlexClusterDescription20241113: + description: Group of settings that configure a MongoDB Flex cluster. + properties: + backupSettings: + $ref: "#/components/schemas/FlexBackupSettings20241113" + clusterType: + default: REPLICASET + description: Flex cluster topology. + readOnly: true + type: string + connectionStrings: + $ref: "#/components/schemas/FlexConnectionStrings20241113" + createDate: + description: Date and time when MongoDB Cloud created this instance. This parameter expresses its value in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the instance. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongoDBVersion: + description: Version of MongoDB that the instance runs. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + name: + description: Human-readable label that identifies the instance. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + providerSettings: + $ref: "#/components/schemas/FlexProviderSettings20241113" + stateName: + description: Human-readable label that indicates the current operating condition of this instance. + readOnly: true + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the instance. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. + type: boolean + versionReleaseSystem: + default: LTS + description: Method by which the cluster maintains the MongoDB versions. + readOnly: true + type: string + required: + - providerSettings + title: Flex Cluster Description + type: object + FlexClusterDescriptionCreate20241113: + description: Settings that you can specify when you create a flex cluster. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the instance. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + writeOnly: true + providerSettings: + $ref: "#/components/schemas/FlexProviderSettingsCreate20241113" + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the instance. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. + type: boolean + required: + - name + - providerSettings + title: Flex Cluster Description Create + type: object + FlexClusterDescriptionUpdate20241113: + description: Settings that you can specify when you update a flex cluster. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the instance. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. + type: boolean + title: Flex Cluster Description Update + type: object + FlexClusterMetricThreshold: + description: Threshold for the metric that, when exceeded, triggers an alert. The metric threshold pertains to event types which reflects changes of measurements and metrics about the serverless database. + properties: + metricName: + description: Human-readable label that identifies the metric against which MongoDB Cloud checks the configured **metricThreshold.threshold**. + type: string + mode: + description: MongoDB Cloud computes the current metric value as an average. + type: string + operator: + description: Comparison operator to apply when checking the current metric value. + type: string + threshold: + description: Value of metric that, when exceeded, triggers an alert. + format: double + type: number + units: + $ref: "#/components/schemas/DataMetricUnits" + description: Element used to express the quantity. This can be an element of time, storage capacity, and the like. + required: + - metricName + title: Flex Cluster Metric Threshold + type: object + FlexConnectionStrings20241113: + description: Collection of Uniform Resource Locators that point to the MongoDB database. + externalDocs: + description: Connection string URI format. + url: https://docs.mongodb.com/manual/reference/connection-string/ + properties: + standard: + description: Public connection string that you can use to connect to this cluster. This connection string uses the mongodb:// protocol. + externalDocs: + description: Connection String URI Format + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + standardSrv: + description: Public connection string that you can use to connect to this flex cluster. This connection string uses the `mongodb+srv://` protocol. + externalDocs: + description: Connection String URI Format + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + readOnly: true + title: Flex Cluster Connection Strings + type: object + FlexProviderSettings20241113: + description: Group of cloud provider settings that configure the provisioned MongoDB flex cluster. + properties: + backingProviderName: + description: Cloud service provider on which MongoDB Cloud provisioned the flex cluster. + readOnly: true + type: string + diskSizeGB: + description: Storage capacity available to the flex cluster expressed in gigabytes. + format: double + readOnly: true + type: number + providerName: + default: FLEX + description: Human-readable label that identifies the provider type. + readOnly: true + type: string + regionName: + description: Human-readable label that identifies the geographic location of your MongoDB flex cluster. The region you choose can affect network latency for clients accessing your databases. For a complete list of region names, see [AWS](https://docs.atlas.mongodb.com/reference/amazon-aws/#std-label-amazon-aws), [GCP](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/). + readOnly: true + type: string + readOnly: true + title: Cloud Service Provider Settings for a Flex Cluster + type: object + FlexProviderSettingsCreate20241113: + description: Group of cloud provider settings that configure the provisioned MongoDB flex cluster. + properties: + backingProviderName: + description: Cloud service provider on which MongoDB Cloud provisioned the flex cluster. + type: string + writeOnly: true + diskSizeGB: + description: Storage capacity available to the flex cluster expressed in gigabytes. + format: double + readOnly: true + type: number + providerName: + default: FLEX + description: Human-readable label that identifies the provider type. + readOnly: true + type: string + regionName: + description: Human-readable label that identifies the geographic location of your MongoDB flex cluster. The region you choose can affect network latency for clients accessing your databases. For a complete list of region names, see [AWS](https://docs.atlas.mongodb.com/reference/amazon-aws/#std-label-amazon-aws), [GCP](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/). + type: string + writeOnly: true + required: + - backingProviderName + - regionName + title: Cloud Service Provider Settings for a Flex Cluster + type: object + writeOnly: true + FreeComputeAutoScalingRules: + description: Collection of settings that configures how a cluster might scale its cluster tier and whether the cluster can scale down. + properties: + maxInstanceSize: + description: Maximum instance size to which your cluster can automatically scale. + title: Tenant Instance Sizes + type: string + minInstanceSize: + description: Minimum instance size to which your cluster can automatically scale. + title: Tenant Instance Sizes + type: string + title: Tenant + type: object + GCPConsumerForwardingRule: + properties: + endpointName: + description: Human-readable label that identifies the Google Cloud consumer forwarding rule that you created. + externalDocs: + description: Google Cloud Forwarding Rule Concepts + url: https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts + readOnly: true + type: string + ipAddress: + description: One Private Internet Protocol version 4 (IPv4) address to which this Google Cloud consumer forwarding rule resolves. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + readOnly: true + type: string + status: + description: State of the MongoDB Cloud endpoint group when MongoDB Cloud received this request. + readOnly: true + type: string + type: object + GeoSharding20240805: + properties: + customZoneMapping: + additionalProperties: + description: |- + List that contains comma-separated key value pairs to map zones to geographic regions. These pairs map an ISO 3166-1a2 location code, with an ISO 3166-2 subdivision code when possible, to a unique 24-hexadecimal string that identifies the custom zone. + + The 24-hexadecimal string corresponds to a `Replication Specifications` `zoneId` property. + + This parameter returns an empty object if no custom zones exist. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + description: |- + List that contains comma-separated key value pairs to map zones to geographic regions. These pairs map an ISO 3166-1a2 location code, with an ISO 3166-2 subdivision code when possible, to a unique 24-hexadecimal string that identifies the custom zone. + + The 24-hexadecimal string corresponds to a `Replication Specifications` `zoneId` property. + + This parameter returns an empty object if no custom zones exist. + readOnly: true + type: object + managedNamespaces: + description: List that contains a namespace for a Global Cluster. MongoDB Cloud manages this cluster. + items: + $ref: "#/components/schemas/ManagedNamespaces" + readOnly: true + type: array + selfManagedSharding: + description: Boolean that controls which management mode the Global Cluster is operating under. If this parameter is true Self-Managed Sharding is enabled and users are in control of the zone sharding within the Global Cluster. If this parameter is false Atlas-Managed Sharding is enabled and Atlas is control of zone sharding within the Global Cluster. + readOnly: true + type: boolean + type: object + GoogleCloudKMS: + description: Details that define the configuration of Encryption at Rest using Google Cloud Key Management Service (KMS). + externalDocs: + description: Google Cloud Key Management Service + url: https://www.mongodb.com/docs/atlas/security-gcp-kms/ + properties: + enabled: + description: Flag that indicates whether someone enabled encryption at rest for the specified project. To disable encryption at rest using customer key management and remove the configuration details, pass only this parameter with a value of `false`. + type: boolean + keyVersionResourceID: + description: Resource path that displays the key version resource ID for your Google Cloud KMS. + example: projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1 + type: string + roleId: + description: Unique 24-hexadecimal digit string that identifies the Google Cloud Provider Access Role that MongoDB Cloud uses to access the Google Cloud KMS. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + serviceAccountKey: + description: JavaScript Object Notation (JSON) object that contains the Google Cloud Key Management Service (KMS). Format the JSON as a string and not as an object. + externalDocs: + description: Google Cloud Authentication + url: https://cloud.google.com/docs/authentication/getting-started + type: string + writeOnly: true + valid: + description: Flag that indicates whether the Google Cloud Key Management Service (KMS) encryption key can encrypt and decrypt data. + readOnly: true + type: boolean + type: object + Group: + properties: + clusterCount: + description: Quantity of MongoDB Cloud clusters deployed in this project. + format: int64 + readOnly: true + type: integer + created: + description: Date and time when MongoDB Cloud created this project. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the project included in the MongoDB Cloud organization. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + type: string + orgId: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud organization to which the project belongs. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + regionUsageRestrictions: + default: COMMERCIAL_FEDRAMP_REGIONS_ONLY + description: |- + Applies to Atlas for Government only. + + In Commercial Atlas, this field will be rejected in requests and missing in responses. + + This field sets restrictions on available regions in the project. + + `COMMERCIAL_FEDRAMP_REGIONS_ONLY`: Only allows deployments in FedRAMP Moderate regions. + + `GOV_REGIONS_ONLY`: Only allows deployments in GovCloud regions. + externalDocs: + url: https://www.mongodb.com/docs/atlas/government/overview/supported-regions/#supported-cloud-providers-and-regions + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the project. + externalDocs: + description: Resource Tags + url: https://www.mongodb.com/docs/atlas/tags + items: + $ref: "#/components/schemas/ResourceTag" + type: array + withDefaultAlertsSettings: + default: true + description: Flag that indicates whether to create the project with default alert settings. + type: boolean + writeOnly: true + required: + - clusterCount + - created + - name + - orgId + type: object + GroupAlertsConfig: + type: object + properties: + created: + description: Date and time when MongoDB Cloud created the alert configuration. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + readOnly: true + type: string + enabled: + default: false + description: Flag that indicates whether someone enabled this alert configuration for the specified project. + type: boolean + eventTypeName: + $ref: "#/components/schemas/StreamProcessorEventTypeViewAlertableWithThreshold" + description: Incident that triggered this alert. + groupId: + description: Unique 24-hexadecimal digit string that identifies the project that owns this alert configuration. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies this alert configuration. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + matchers: + description: List of rules that determine whether MongoDB Cloud checks an object for the alert configuration. + items: + $ref: "#/components/schemas/StreamsMatcher" + type: array + notifications: + description: List that contains the targets that MongoDB Cloud sends notifications. + items: + $ref: "#/components/schemas/AlertsNotificationRootForGroup" + type: array + severityOverride: + $ref: "#/components/schemas/EventSeverity" + updated: + description: Date and time when someone last updated this alert configuration. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + readOnly: true + type: string + metricThreshold: + $ref: "#/components/schemas/FlexClusterMetricThreshold" + threshold: + $ref: "#/components/schemas/StreamProcessorMetricThreshold" + GroupIPAddresses: + description: List of IP addresses in a project. + properties: + groupId: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + services: + $ref: "#/components/schemas/GroupService" + title: Group IP Address + type: object + GroupInvitation: + properties: + createdAt: + description: Date and time when MongoDB Cloud sent the invitation. This parameter expresses its value in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + expiresAt: + description: Date and time when MongoDB Cloud expires the invitation. This parameter expresses its value in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + groupName: + description: Human-readable label that identifies the project to which you invited the MongoDB Cloud user. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal character string that identifies the invitation. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + inviterUsername: + description: Email address of the MongoDB Cloud user who sent the invitation. + format: email + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + roles: + description: One or more organization or project level roles to assign to the MongoDB Cloud user. + items: + type: string + type: array + uniqueItems: true + username: + description: Email address of the MongoDB Cloud user invited to join the project. + format: email + readOnly: true + type: string + type: object + GroupInvitationRequest: + properties: + roles: + description: One or more project level roles to assign to the MongoDB Cloud user. + items: + type: string + type: array + uniqueItems: true + username: + description: Email address of the MongoDB Cloud user invited to the specified project. + format: email + type: string + type: object + GroupInvitationUpdateRequest: + properties: + roles: + description: One or more project-level roles to assign to the MongoDB Cloud user. + items: + type: string + type: array + uniqueItems: true + type: object + GroupMaintenanceWindow: + properties: + autoDeferOnceEnabled: + description: Flag that indicates whether MongoDB Cloud should defer all maintenance windows for one week after you enable them. + type: boolean + dayOfWeek: + description: |- + One-based integer that represents the day of the week that the maintenance window starts. + + - `1`: Sunday. + - `2`: Monday. + - `3`: Tuesday. + - `4`: Wednesday. + - `5`: Thursday. + - `6`: Friday. + - `7`: Saturday. + format: int32 + maximum: 7 + minimum: 1 + type: integer + hourOfDay: + description: Zero-based integer that represents the hour of the of the day that the maintenance window starts according to a 24-hour clock. Use `0` for midnight and `12` for noon. + format: int32 + maximum: 23 + minimum: 0 + type: integer + numberOfDeferrals: + description: Number of times the current maintenance event for this project has been deferred. + format: int32 + readOnly: true + type: integer + protectedHours: + $ref: "#/components/schemas/ProtectedHours" + startASAP: + description: Flag that indicates whether MongoDB Cloud starts the maintenance window immediately upon receiving this request. To start the maintenance window immediately for your project, MongoDB Cloud must have maintenance scheduled and you must set a maintenance window. This flag resets to `false` after MongoDB Cloud completes maintenance. + type: boolean + timeZoneId: + description: Identifier for the current time zone of the maintenance window. This can only be updated via the Project Settings UI. + readOnly: true + type: string + required: + - dayOfWeek + type: object + GroupMigrationRequest: + properties: + destinationOrgId: + description: Unique 24-hexadecimal digit string that identifies the organization to move the specified project to. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + destinationOrgPrivateApiKey: + description: Unique string that identifies the private part of the API Key used to verify access to the destination organization. This parameter is required only when you authenticate with Programmatic API Keys. + example: 55c3bbb6-b4bb-0be1-e66d20841f3e + externalDocs: + description: Grant Programmatic Access to Atlas + url: https://dochub.mongodb.org/core/atlas-create-prog-api-key + type: string + destinationOrgPublicApiKey: + description: Unique string that identifies the public part of the API Key used to verify access to the destination organization. This parameter is required only when you authenticate with Programmatic API Keys. + example: zmmrboas + externalDocs: + description: Grant Programmatic Access to Atlas + url: https://dochub.mongodb.org/core/atlas-create-prog-api-key + maxLength: 8 + minLength: 8 + type: string + type: object + GroupRole: + properties: + groupId: + description: Unique 24-hexadecimal digit string that identifies the project to which this role belongs. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + groupRole: + description: Human-readable label that identifies the collection of privileges that MongoDB Cloud grants a specific API key, MongoDB Cloud user, or MongoDB Cloud team. These roles include project-level roles. + type: string + type: object + GroupRoleAssignment: + properties: + groupId: + description: Unique 24-hexadecimal digit string that identifies the project to which these roles belong. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + groupRoles: + description: One or more project-level roles assigned to the MongoDB Cloud user. + items: + description: Project-level role. + type: string + type: array + uniqueItems: true + type: object + GroupService: + description: List of IP addresses in a project categorized by services. + properties: + clusters: + description: IP addresses of clusters. + items: + $ref: "#/components/schemas/ClusterIPAddresses" + readOnly: true + type: array + readOnly: true + title: Group Service IP Addresses + type: object + GroupServiceAccount: + properties: + clientId: + description: The Client ID of the Service Account. + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + createdAt: + description: The date that the Service Account was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + description: + description: Human readable description for the Service Account. + type: string + name: + description: Human-readable name for the Service Account. + type: string + roles: + description: A list of Project roles associated with the Service Account. + items: + description: Project roles available for Service Accounts. + type: string + type: array + uniqueItems: true + secrets: + description: A list of secrets associated with the specified Service Account. + items: + $ref: "#/components/schemas/ServiceAccountSecret" + type: array + uniqueItems: true + type: object + GroupServiceAccountRequest: + properties: + description: + description: Human readable description for the Service Account. + maxLength: 250 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + type: string + name: + description: Human-readable name for the Service Account. The name is modifiable and does not have to be unique. + maxLength: 64 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + type: string + roles: + description: A list of project-level roles for the Service Account. + items: + description: Project roles available for Service Accounts. + type: string + type: array + secretExpiresAfterHours: + description: The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. + example: 8 + format: int32 + type: integer + required: + - description + - name + - roles + - secretExpiresAfterHours + type: object + GroupServiceAccountRoleAssignment: + properties: + roles: + description: The Project permissions for the Service Account in the specified Project. + items: + description: Project roles available for Service Accounts. + type: string + type: array + uniqueItems: true + required: + - roles + type: object + GroupServiceAccountUpdateRequest: + properties: + description: + description: Human readable description for the Service Account. + maxLength: 250 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + type: string + name: + description: Human-readable name for the Service Account. The name is modifiable and does not have to be unique. + maxLength: 64 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + type: string + roles: + description: A list of Project roles associated with the Service Account. + items: + description: Project roles available for Service Accounts. + type: string + type: array + type: object + GroupSettings: + description: Collection of settings that configures the project. + properties: + isCollectDatabaseSpecificsStatisticsEnabled: + description: Flag that indicates whether to collect database-specific metrics for the specified project. + type: boolean + isDataExplorerEnabled: + description: Flag that indicates whether to enable the Data Explorer for the specified project. + type: boolean + isDataExplorerGenAIFeaturesEnabled: + description: Flag that indicates whether to enable the use of generative AI features which make requests to 3rd party services in Data Explorer for the specified project. + type: boolean + isDataExplorerGenAISampleDocumentPassingEnabled: + default: false + description: Flag that indicates whether to enable the passing of sample field values with the use of generative AI features in the Data Explorer for the specified project. + type: boolean + isExtendedStorageSizesEnabled: + description: Flag that indicates whether to enable extended storage sizes for the specified project. + type: boolean + isPerformanceAdvisorEnabled: + description: Flag that indicates whether to enable the Performance Advisor and Profiler for the specified project. + type: boolean + isRealtimePerformancePanelEnabled: + description: Flag that indicates whether to enable the Real Time Performance Panel for the specified project. + type: boolean + isSchemaAdvisorEnabled: + description: Flag that indicates whether to enable the Schema Advisor for the specified project. + type: boolean + type: object + GroupUpdate: + description: Request view to update the group. + properties: + name: + description: Human-readable label that identifies the project included in the MongoDB Cloud organization. + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the project. + externalDocs: + description: Resource Tags + url: https://www.mongodb.com/docs/atlas/tags + items: + $ref: "#/components/schemas/ResourceTag" + type: array + type: object + GroupUserRequest: + properties: + roles: + description: One or more project-level roles to assign the MongoDB Cloud user. + items: + description: Project-level role. + type: string + minItems: 1 + type: array + uniqueItems: true + writeOnly: true + username: + description: Email address that represents the username of the MongoDB Cloud user. + format: email + type: string + writeOnly: true + required: + - roles + - username + type: object + GroupUserResponse: + properties: + id: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + orgMembershipStatus: + description: String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization. + readOnly: true + type: string + roles: + description: One or more project-level roles assigned to the MongoDB Cloud user. + items: + description: Project-level role. + type: string + readOnly: true + type: array + uniqueItems: true + username: + description: Email address that represents the username of the MongoDB Cloud user. + format: email + readOnly: true + type: string + invitationCreatedAt: + description: Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + invitationExpiresAt: + description: Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + inviterUsername: + description: Username of the MongoDB Cloud user who sent the invitation to join the organization. + format: email + readOnly: true + type: string + country: + description: Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format. + example: US + pattern: ^([A-Z]{2})$ + readOnly: true + type: string + createdAt: + description: Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + firstName: + description: First or given name that belongs to the MongoDB Cloud user. + example: John + readOnly: true + type: string + lastAuth: + description: Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + lastName: + description: Last name, family name, or surname that belongs to the MongoDB Cloud user. + example: Doe + readOnly: true + type: string + mobileNumber: + description: Mobile phone number that belongs to the MongoDB Cloud user. + pattern: (?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})$ + readOnly: true + type: string + required: + - id + - orgMembershipStatus + - roles + - username + type: object + HardwareSpec20240805: + description: Hardware specifications for all electable nodes deployed in the region. Electable nodes can become the primary and can enable local reads. If you don't specify this option, MongoDB Cloud deploys no electable nodes to the region. + properties: + diskSizeGB: + description: |- + Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity. + + This value must be equal for all shards and node types. + + This value is not configurable on M0/M2/M5 clusters. + + MongoDB Cloud requires this parameter if you set **replicationSpecs**. + + If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. + + Storage charge calculations depend on whether you choose the default value or a custom value. + + The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier. + externalDocs: + description: Customize Storage + url: https://dochub.mongodb.org/core/customize-storage + format: double + type: number + diskIOPS: + description: |- + Target throughput desired for storage attached to your Azure-provisioned cluster. Change this parameter if you: + + - set `"replicationSpecs[n].regionConfigs[m].providerName" : "Azure"`. + - set `"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize" : "M40"` or greater not including `Mxx_NVME` tiers. + + The maximum input/output operations per second (IOPS) depend on the selected **.instanceSize** and **.diskSizeGB**. + This parameter defaults to the cluster tier's standard IOPS value. + Changing this value impacts cluster cost. + externalDocs: + description: Programmatic API Keys + url: https://www.mongodb.com/docs/atlas/customize-storage/#extend-iops-on-azure + format: int32 + type: integer + ebsVolumeType: + default: STANDARD + description: |- + Type of storage you want to attach to your AWS-provisioned cluster. + + - `STANDARD` volume types can't exceed the default input/output operations per second (IOPS) rate for the selected volume size. + + - `PROVISIONED` volume types must fall within the allowable IOPS range for the selected volume size. You must set this value to (`PROVISIONED`) for NVMe clusters. + type: string + instanceSize: + description: Hardware specification for the instances in this M0/M2/M5 tier cluster. + title: Tenant Instance Sizes + type: string + nodeCount: + description: Number of nodes of the given type for MongoDB Cloud to deploy to the region. + format: int32 + type: integer + effectiveInstanceSize: + description: The true tenant instance size. This is present to support backwards compatibility for deprecated provider types and/or instance sizes. + readOnly: true + type: string + type: object + InboundControlPlaneCloudProviderIPAddresses: + description: List of inbound IP addresses to the Atlas control plane, categorized by cloud provider. If your application allows outbound HTTP requests only to specific IP addresses, you must allow access to the following IP addresses so that your API requests can reach the Atlas control plane. + properties: + aws: + additionalProperties: + description: Control plane IP addresses in AWS. Each key identifies an Amazon Web Services (AWS) region. Each value identifies control plane IP addresses in the AWS region. + items: + description: Control plane IP addresses in AWS. Each key identifies an Amazon Web Services (AWS) region. Each value identifies control plane IP addresses in the AWS region. + readOnly: true + type: string + readOnly: true + type: array + description: Control plane IP addresses in AWS. Each key identifies an Amazon Web Services (AWS) region. Each value identifies control plane IP addresses in the AWS region. + readOnly: true + type: object + azure: + additionalProperties: + description: Control plane IP addresses in Azure. Each key identifies an Azure region. Each value identifies control plane IP addresses in the Azure region. + items: + description: Control plane IP addresses in Azure. Each key identifies an Azure region. Each value identifies control plane IP addresses in the Azure region. + readOnly: true + type: string + readOnly: true + type: array + description: Control plane IP addresses in Azure. Each key identifies an Azure region. Each value identifies control plane IP addresses in the Azure region. + readOnly: true + type: object + gcp: + additionalProperties: + description: Control plane IP addresses in GCP. Each key identifies a Google Cloud (GCP) region. Each value identifies control plane IP addresses in the GCP region. + items: + description: Control plane IP addresses in GCP. Each key identifies a Google Cloud (GCP) region. Each value identifies control plane IP addresses in the GCP region. + readOnly: true + type: string + readOnly: true + type: array + description: Control plane IP addresses in GCP. Each key identifies a Google Cloud (GCP) region. Each value identifies control plane IP addresses in the GCP region. + readOnly: true + type: object + readOnly: true + title: Inbound Control Plane IP Addresses By Cloud Provider + type: object + IndexOptions: + description: One or more settings that determine how the MongoDB Cloud creates this MongoDB index. + externalDocs: + description: Index Options + url: https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#options + properties: + 2dsphereIndexVersion: + default: 3 + description: Index version number applied to the 2dsphere index. MongoDB 3.2 and later use version 3. Use this option to override the default version number. This option applies to the **2dsphere** index type only. + format: int32 + type: integer + background: + default: false + description: Flag that indicates whether MongoDB should build the index in the background. This applies to MongoDB databases running feature compatibility version 4.0 or earlier. MongoDB databases running FCV 4.2 or later build indexes using an optimized build process. This process holds the exclusive lock only at the beginning and end of the build process. The rest of the build process yields to interleaving read and write operations. MongoDB databases running FCV 4.2 or later ignore this option. This option applies to all index types. + type: boolean + bits: + default: 26 + description: Number of precision applied to the stored geohash value of the location data. This option applies to the **2d** index type only. + format: int32 + type: integer + bucketSize: + description: |- + Number of units within which to group the location values. You could group in the same bucket those location values within the specified number of units to each other. This option applies to the geoHaystack index type only. + + MongoDB 5.0 removed geoHaystack Indexes and the `geoSearch` command. + format: int32 + type: integer + columnstoreProjection: + additionalProperties: + description: |- + The columnstoreProjection document allows to include or exclude subschemas schema. One cannot combine inclusion and exclusion statements. Accordingly, the can be either of the following: + 1 or true to include the field and recursively all fields it is a prefix of in the index + 0 or false to exclude the field and recursively all fields it is a prefix of from the index. + format: int32 + type: integer + description: |- + The columnstoreProjection document allows to include or exclude subschemas schema. One cannot combine inclusion and exclusion statements. Accordingly, the can be either of the following: + 1 or true to include the field and recursively all fields it is a prefix of in the index + 0 or false to exclude the field and recursively all fields it is a prefix of from the index. + type: object + default_language: + default: english + description: Human language that determines the list of stop words and the rules for the stemmer and tokenizer. This option accepts the supported languages using its name in lowercase english or the ISO 639-2 code. If you set this parameter to `"none"`, then the text search uses simple tokenization with no list of stop words and no stemming. This option applies to the **text** index type only. + type: string + expireAfterSeconds: + description: Number of seconds that MongoDB retains documents in a Time To Live (TTL) index. + format: int32 + type: integer + hidden: + default: false + description: Flag that determines whether the index is hidden from the query planner. A hidden index is not evaluated as part of the query plan selection. + type: boolean + language_override: + default: language + description: Human-readable label that identifies the document parameter that contains the override language for the document. This option applies to the **text** index type only. + type: string + max: + default: 180 + description: Upper inclusive boundary to limit the longitude and latitude values. This option applies to the 2d index type only. + format: int32 + type: integer + min: + default: -180 + description: Lower inclusive boundary to limit the longitude and latitude values. This option applies to the 2d index type only. + format: int32 + type: integer + name: + description: Human-readable label that identifies this index. This option applies to all index types. + type: string + partialFilterExpression: + description: |- + Rules that limit the documents that the index references to a filter expression. All MongoDB index types accept a **partialFilterExpression** option. **partialFilterExpression** can include following expressions: + + - equality (`"parameter" : "value"` or using the `$eq` operator) + - `"$exists": true` + , maximum: `$gt`, `$gte`, `$lt`, `$lte` comparisons + - `$type` + - `$and` (top-level only) + This option applies to all index types. + type: object + sparse: + default: false + description: |- + Flag that indicates whether the index references documents that only have the specified parameter. These indexes use less space but behave differently in some situations like when sorting. The following index types default to sparse and ignore this option: `2dsphere`, `2d`, `geoHaystack`, `text`. + + Compound indexes that includes one or more indexes with `2dsphere` keys alongside other key types, only the `2dsphere` index parameters determine which documents the index references. If you run MongoDB 3.2 or later, use partial indexes. This option applies to all index types. + type: boolean + storageEngine: + description: 'Storage engine set for the specific index. This value can be set only at creation. This option uses the following format: `"storageEngine" : { "" : "" }` MongoDB validates storage engine configuration options when creating indexes. To support replica sets with members with different storage engines, MongoDB logs these options to the oplog during replication. This option applies to all index types.' + externalDocs: + description: MongoDB Server Storage Engines + url: https://docs.mongodb.com/manual/core/storage-engines/ + type: object + textIndexVersion: + default: 3 + description: Version applied to this text index. MongoDB 3.2 and later use version `3`. Use this option to override the default version number. This option applies to the **text** index type only. + format: int32 + type: integer + weights: + description: Relative importance to place upon provided index parameters. This object expresses this as key/value pairs of index parameter and weight to apply to that parameter. You can specify weights for some or all the indexed parameters. The weight must be an integer between 1 and 99,999. MongoDB 5.0 and later can apply **weights** to **text** indexes only. + type: object + type: object + writeOnly: true + IngestionPipelineRun: + description: Run details of a Data Lake Pipeline. + properties: + _id: + description: Unique 24-hexadecimal character string that identifies a Data Lake Pipeline run. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + backupFrequencyType: + description: Backup schedule interval of the Data Lake Pipeline. + readOnly: true + type: string + createdDate: + description: Timestamp that indicates when the pipeline run was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + datasetName: + description: Human-readable label that identifies the dataset that Atlas generates during this pipeline run. You can use this dataset as a `dataSource` in a Federated Database collection. + example: v1$atlas$snapshot$Cluster0$myDatabase$myCollection$19700101T000000Z + readOnly: true + type: string + datasetRetentionPolicy: + $ref: "#/components/schemas/DatasetRetentionPolicy" + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lastUpdatedDate: + description: Timestamp that indicates the last time that the pipeline run was updated. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + phase: + description: Processing phase of the Data Lake Pipeline. + readOnly: true + type: string + pipelineId: + description: Unique 24-hexadecimal character string that identifies a Data Lake Pipeline. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + scheduledDeletionDate: + description: Timestamp that indicates when the pipeline run will expire and its dataset will be deleted. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + snapshotId: + description: Unique 24-hexadecimal character string that identifies the snapshot of a cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + state: + description: State of the pipeline run. + readOnly: true + type: string + stats: + $ref: "#/components/schemas/PipelineRunStats" + title: Data Lake Pipeline Run + type: object + IngestionSink: + description: Ingestion destination of a Data Lake Pipeline. + properties: + type: + description: Type of ingestion destination of this Data Lake Pipeline. + readOnly: true + type: string + metadataProvider: + description: Target cloud provider for this Data Lake Pipeline. + type: string + metadataRegion: + description: Target cloud provider region for this Data Lake Pipeline. + externalDocs: + description: Supported cloud provider regions + url: https://www.mongodb.com/docs/datalake/limitations + type: string + partitionFields: + description: Ordered fields used to physically organize data in the destination. + items: + $ref: "#/components/schemas/DataLakePipelinesPartitionField" + type: array + title: Ingestion Destination + type: object + IngestionSource: + description: Ingestion Source of a Data Lake Pipeline. + properties: + type: + description: Type of ingestion source of this Data Lake Pipeline. + type: string + clusterName: + description: Human-readable name that identifies the cluster. + type: string + collectionName: + description: Human-readable name that identifies the collection. + type: string + databaseName: + description: Human-readable name that identifies the database. + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + policyItemId: + description: Unique 24-hexadecimal character string that identifies a policy item. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + title: Ingestion Source + type: object + InvoiceLineItem: + description: One service included in this invoice. + properties: + clusterName: + description: Human-readable label that identifies the cluster that incurred the charge. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + created: + description: Date and time when MongoDB Cloud created this line item. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + discountCents: + description: Sum by which MongoDB discounted this line item. MongoDB Cloud expresses this value in cents (100ths of one US Dollar). The resource returns this parameter when a discount applies. + format: int64 + readOnly: true + type: integer + endDate: + description: Date and time when when MongoDB Cloud finished charging for this line item. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project associated to this line item. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + groupName: + description: Human-readable label that identifies the project. + type: string + note: + description: Comment that applies to this line item. + readOnly: true + type: string + percentDiscount: + description: Percentage by which MongoDB discounted this line item. The resource returns this parameter when a discount applies. + format: float + readOnly: true + type: number + quantity: + description: Number of units included for the line item. These can be expressions of storage (GB), time (hours), or other units. + format: double + readOnly: true + type: number + sku: + description: Human-readable description of the service that this line item provided. This Stock Keeping Unit (SKU) could be the instance type, a support charge, advanced security, or another service. + readOnly: true + type: string + startDate: + description: Date and time when MongoDB Cloud began charging for this line item. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + stitchAppName: + description: Human-readable label that identifies the Atlas App Services application associated with this line item. + externalDocs: + description: Create a new Atlas App Service + url: https://www.mongodb.com/docs/atlas/app-services/manage-apps/create/create-with-ui/ + readOnly: true + type: string + tags: + additionalProperties: + description: A map of key-value pairs corresponding to the tags associated with the line item resource. + items: + description: A map of key-value pairs corresponding to the tags associated with the line item resource. + readOnly: true + type: string + readOnly: true + type: array + description: A map of key-value pairs corresponding to the tags associated with the line item resource. + readOnly: true + type: object + tierLowerBound: + description: |- + Lower bound for usage amount range in current SKU tier. + + **NOTE**: **lineItems[n].tierLowerBound** appears only if your **lineItems[n].sku** is tiered. + format: double + readOnly: true + type: number + tierUpperBound: + description: |- + Upper bound for usage amount range in current SKU tier. + + **NOTE**: **lineItems[n].tierUpperBound** appears only if your **lineItems[n].sku** is tiered. + format: double + readOnly: true + type: number + totalPriceCents: + description: Sum of the cost set for this line item. MongoDB Cloud expresses this value in cents (100ths of one US Dollar) and calculates this value as **unitPriceDollars** × **quantity** × 100. + format: int64 + readOnly: true + type: integer + unit: + description: Element used to express what **quantity** this line item measures. This value can be elements of time, storage capacity, and the like. + readOnly: true + type: string + unitPriceDollars: + description: Value per **unit** for this line item expressed in US Dollars. + format: double + readOnly: true + type: number + title: Line Item + type: object + LDAPSecuritySettings: + description: Lightweight Directory Access Protocol (LDAP) over Transport Layer Security (TLS) configuration details that apply to the specified project. + properties: + authenticationEnabled: + description: Flag that indicates whether users can authenticate using an Lightweight Directory Access Protocol (LDAP) host. + type: boolean + authorizationEnabled: + description: Flag that indicates whether users can authorize access to MongoDB Cloud resources using an Lightweight Directory Access Protocol (LDAP) host. + type: boolean + authzQueryTemplate: + default: "{USER}?memberOf?base" + description: Lightweight Directory Access Protocol (LDAP) query template that MongoDB Cloud runs to obtain the LDAP groups associated with the authenticated user. MongoDB Cloud uses this parameter only for user authorization. Use the `{USER}` placeholder in the Uniform Resource Locator (URL) to substitute the authenticated username. The query relates to the host specified with the hostname. Format this query according to [RFC 4515](https://datatracker.ietf.org/doc/html/rfc4515) and [RFC 4516](https://datatracker.ietf.org/doc/html/rfc4516). + example: "{USER}?memberOf?base" + type: string + bindPassword: + description: Password that MongoDB Cloud uses to authenticate the **bindUsername**. + type: string + writeOnly: true + bindUsername: + description: Full Distinguished Name (DN) of the Lightweight Directory Access Protocol (LDAP) user that MongoDB Cloud uses to connect to the LDAP host. LDAP distinguished names must be formatted according to RFC 2253. + example: CN=BindUser,CN=Users,DC=myldapserver,DC=mycompany,DC=com + externalDocs: + description: RFC 2253 + url: https://tools.ietf.org/html/2253 + pattern: ^(?:(?CN=(?[^,]*)),)?(?:(?(?:(?:CN|OU)=[^,]+,?)+),)?(?(?:DC=[^,]+,?)+)$ + type: string + caCertificate: + description: 'Certificate Authority (CA) certificate that MongoDB Cloud uses to verify the identity of the Lightweight Directory Access Protocol (LDAP) host. MongoDB Cloud allows self-signed certificates. To delete an assigned value, pass an empty string: `"caCertificate": ""`.' + type: string + hostname: + description: Human-readable label that identifies the hostname or Internet Protocol (IP) address of the Lightweight Directory Access Protocol (LDAP) host. This host must have access to the internet or have a Virtual Private Cloud (VPC) peering connection to your cluster. + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?$ + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + port: + default: 636 + description: Port to which the Lightweight Directory Access Protocol (LDAP) host listens for client connections. + format: int32 + type: integer + userToDNMapping: + description: User-to-Distinguished Name (DN) map that MongoDB Cloud uses to transform a Lightweight Directory Access Protocol (LDAP) username into an LDAP DN. + items: + $ref: "#/components/schemas/UserToDNMapping" + type: array + title: LDAP Security Settings + type: object + LDAPVerifyConnectivityJobRequest: + properties: + groupId: + description: Unique 24-hexadecimal digit string that identifies the project associated with this Lightweight Directory Access Protocol (LDAP) over Transport Layer Security (TLS) configuration. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + request: + $ref: "#/components/schemas/LDAPVerifyConnectivityJobRequestParams" + requestId: + description: Unique 24-hexadecimal digit string that identifies this request to verify an Lightweight Directory Access Protocol (LDAP) configuration. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + status: + description: Human-readable string that indicates the status of the Lightweight Directory Access Protocol (LDAP) over Transport Layer Security (TLS) configuration. + readOnly: true + type: string + validations: + description: List that contains the validation messages related to the verification of the provided Lightweight Directory Access Protocol (LDAP) over Transport Layer Security (TLS) configuration details. The list contains a document for each test that MongoDB Cloud runs. MongoDB Cloud stops running tests after the first failure. + items: + $ref: "#/components/schemas/LDAPVerifyConnectivityJobRequestValidation" + readOnly: true + type: array + type: object + LDAPVerifyConnectivityJobRequestParams: + description: Request information needed to verify an Lightweight Directory Access Protocol (LDAP) over Transport Layer Security (TLS) configuration. The response does not return the **bindPassword**. + properties: + authzQueryTemplate: + default: "{USER}?memberOf?base" + description: |- + Lightweight Directory Access Protocol (LDAP) query template that MongoDB Cloud applies to create an LDAP query to return the LDAP groups associated with the authenticated MongoDB user. MongoDB Cloud uses this parameter only for user authorization. + + Use the `{USER}` placeholder in the Uniform Resource Locator (URL) to substitute the authenticated username. The query relates to the host specified with the hostname. Format this query per [RFC 4515](https://datatracker.ietf.org/doc/html/rfc4515) and [RFC 4516](https://datatracker.ietf.org/doc/html/rfc4516). + example: "{USER}?memberOf?base" + type: string + writeOnly: true + bindPassword: + description: Password that MongoDB Cloud uses to authenticate the **bindUsername**. + type: string + writeOnly: true + bindUsername: + description: Full Distinguished Name (DN) of the Lightweight Directory Access Protocol (LDAP) user that MongoDB Cloud uses to connect to the LDAP host. LDAP distinguished names must be formatted according to RFC 2253. + example: CN=BindUser,CN=Users,DC=myldapserver,DC=mycompany,DC=com + externalDocs: + description: RFC 2253 + url: https://tools.ietf.org/html/2253 + pattern: ^(?:(?CN=(?[^,]*)),)?(?:(?(?:(?:CN|OU)=[^,]+,?)+),)?(?(?:DC=[^,]+,?)+)$ + type: string + caCertificate: + description: 'Certificate Authority (CA) certificate that MongoDB Cloud uses to verify the identity of the Lightweight Directory Access Protocol (LDAP) host. MongoDB Cloud allows self-signed certificates. To delete an assigned value, pass an empty string: `"caCertificate": ""`.' + type: string + hostname: + description: Human-readable label that identifies the hostname or Internet Protocol (IP) address of the Lightweight Directory Access Protocol (LDAP) host. This host must have access to the internet or have a Virtual Private Cloud (VPC) peering connection to your cluster. + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?$ + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + port: + default: 636 + description: IANA port to which the Lightweight Directory Access Protocol (LDAP) host listens for client connections. + format: int32 + type: integer + required: + - bindPassword + - bindUsername + - hostname + - port + type: object + LDAPVerifyConnectivityJobRequestValidation: + description: One test that MongoDB Cloud runs to test verification of the provided Lightweight Directory Access Protocol (LDAP) over Transport Layer Security (TLS) configuration details. + properties: + status: + description: Human-readable string that indicates the result of this verification test. + readOnly: true + type: string + validationType: + description: Human-readable label that identifies this verification test that MongoDB Cloud runs. + readOnly: true + type: string + readOnly: true + type: object + LegacyAtlasCluster: + description: Group of settings that configure a MongoDB cluster. + properties: + acceptDataRisksAndForceReplicaSetReconfig: + description: If reconfiguration is necessary to regain a primary due to a regional outage, submit this field alongside your topology reconfiguration to request a new regional outage resistant topology. Forced reconfigurations during an outage of the majority of electable nodes carry a risk of data loss if replicated writes (even majority committed writes) have not been replicated to the new primary node. MongoDB Atlas docs contain more information. To proceed with an operation which carries that risk, set **acceptDataRisksAndForceReplicaSetReconfig** to the current date. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: Reconfiguring a Replica Set during a regional outage + url: https://dochub.mongodb.org/core/regional-outage-reconfigure-replica-set + format: date-time + type: string + advancedConfiguration: + $ref: "#/components/schemas/ApiAtlasClusterAdvancedConfiguration" + autoScaling: + $ref: "#/components/schemas/ClusterAutoScalingSettings" + backupEnabled: + description: Flag that indicates whether the cluster can perform backups. If set to `true`, the cluster can perform backups. You must set this value to `true` for NVMe clusters. Backup uses Cloud Backups for dedicated clusters and Shared Cluster Backups for tenant clusters. If set to `false`, the cluster doesn't use MongoDB Cloud backups. + type: boolean + biConnector: + $ref: "#/components/schemas/BiConnector" + clusterType: + description: Configuration of nodes that comprise the cluster. + type: string + configServerManagementMode: + default: ATLAS_MANAGED + description: |- + Config Server Management Mode for creating or updating a sharded cluster. + + When configured as ATLAS_MANAGED, atlas may automatically switch the cluster's config server type for optimal performance and savings. + + When configured as FIXED_TO_DEDICATED, the cluster will always use a dedicated config server. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + type: string + configServerType: + description: Describes a sharded cluster's config server type. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + readOnly: true + type: string + connectionStrings: + $ref: "#/components/schemas/ClusterConnectionStrings" + createDate: + description: Date and time when MongoDB Cloud created this serverless instance. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + diskSizeGB: + description: |- + Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity. + + This value is not configurable on M0/M2/M5 clusters. + + MongoDB Cloud requires this parameter if you set **replicationSpecs**. + + If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. + + Storage charge calculations depend on whether you choose the default value or a custom value. + + The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier. + format: double + maximum: 4096 + minimum: 10 + type: number + diskWarmingMode: + default: FULLY_WARMED + description: Disk warming mode selection. + externalDocs: + description: Reduce Secondary Disk Warming Impact + url: https://docs.atlas.mongodb.com/reference/replica-set-tags/#reduce-secondary-disk-warming-impact + type: string + encryptionAtRestProvider: + description: 'Cloud service provider that manages your customer keys to provide an additional layer of encryption at rest for the cluster. To enable customer key management for encryption at rest, the cluster **replicationSpecs[n].regionConfigs[m].{type}Specs.instanceSize** setting must be `M10` or higher and `"backupEnabled" : false` or omitted entirely.' + externalDocs: + description: Encryption at Rest using Customer Key Management + url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ + type: string + featureCompatibilityVersion: + description: Feature compatibility version of the cluster. + readOnly: true + type: string + featureCompatibilityVersionExpirationDate: + description: Feature compatibility version expiration date. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + globalClusterSelfManagedSharding: + description: |- + Set this field to configure the Sharding Management Mode when creating a new Global Cluster. + + When set to false, the management mode is set to Atlas-Managed Sharding. This mode fully manages the sharding of your Global Cluster and is built to provide a seamless deployment experience. + + When set to true, the management mode is set to Self-Managed Sharding. This mode leaves the management of shards in your hands and is built to provide an advanced and flexible deployment experience. + + This setting cannot be changed once the cluster is deployed. + externalDocs: + description: Creating a Global Cluster + url: https://dochub.mongodb.org/core/global-cluster-management + type: boolean + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + labels: + deprecated: true + description: |- + Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels. + + Cluster labels are deprecated and will be removed in a future release. We strongly recommend that you use Resource Tags instead. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ComponentLabel" + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongoDBEmployeeAccessGrant: + $ref: "#/components/schemas/EmployeeAccessGrant" + mongoDBMajorVersion: + description: |- + MongoDB major version of the cluster. + + On creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLTSVersions). + + On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version. + example: "5.0" + externalDocs: + description: Available MongoDB Versions in Atlas + url: https://www.mongodb.com/docs/atlas/reference/faq/database/#which-versions-of-mongodb-do-service-clusters-use- + type: string + mongoDBVersion: + description: Version of MongoDB that the cluster runs. + example: 5.0.25 + pattern: ([\d]+\.[\d]+\.[\d]+) + type: string + mongoURI: + description: Base connection string that you can use to connect to the cluster. MongoDB Cloud displays the string only after the cluster starts, not while it builds the cluster. + externalDocs: + description: Connection string URI format. + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + mongoURIUpdated: + description: Date and time when someone last updated the connection string. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + mongoURIWithOptions: + description: Connection string that you can use to connect to the cluster including the `replicaSet`, `ssl`, and `authSource` query parameters with values appropriate for the cluster. You may need to add MongoDB database users. The response returns this parameter once the cluster can receive requests, not while it builds the cluster. + externalDocs: + description: Connection string URI format. + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + name: + description: Human-readable label that identifies the cluster. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + numShards: + default: 1 + description: Number of shards up to 50 to deploy for a sharded cluster. The resource returns `1` to indicate a replica set and values of `2` and higher to indicate a sharded cluster. The returned value equals the number of shards in the cluster. + externalDocs: + description: Sharding + url: https://docs.mongodb.com/manual/sharding/ + format: int32 + maximum: 50 + minimum: 1 + type: integer + paused: + description: Flag that indicates whether the cluster is paused. + type: boolean + pitEnabled: + description: Flag that indicates whether the cluster uses continuous cloud backups. + externalDocs: + description: Continuous Cloud Backups + url: https://docs.atlas.mongodb.com/backup/cloud-backup/overview/ + type: boolean + providerBackupEnabled: + description: Flag that indicates whether the M10 or higher cluster can perform Cloud Backups. If set to `true`, the cluster can perform backups. If this and **backupEnabled** are set to `false`, the cluster doesn't use MongoDB Cloud backups. + type: boolean + providerSettings: + $ref: "#/components/schemas/ClusterProviderSettings" + replicaSetScalingStrategy: + default: WORKLOAD_TYPE + description: |- + Set this field to configure the replica set scaling mode for your cluster. + + By default, Atlas scales under WORKLOAD_TYPE. This mode allows Atlas to scale your analytics nodes in parallel to your operational nodes. + + When configured as SEQUENTIAL, Atlas scales all nodes sequentially. This mode is intended for steady-state workloads and applications performing latency-sensitive secondary reads. + + When configured as NODE_TYPE, Atlas scales your electable nodes in parallel with your read-only and analytics nodes. This mode is intended for large, dynamic workloads requiring frequent and timely cluster tier scaling. This is the fastest scaling strategy, but it might impact latency of workloads when performing extensive secondary reads. + externalDocs: + description: Modify the Replica Set Scaling Mode + url: https://dochub.mongodb.org/core/scale-nodes + type: string + replicationFactor: + default: 3 + deprecated: true + description: Number of members that belong to the replica set. Each member retains a copy of your databases, providing high availability and data redundancy. Use **replicationSpecs** instead. + format: int32 + type: integer + replicationSpec: + additionalProperties: + $ref: "#/components/schemas/RegionSpec" + description: Physical location where MongoDB Cloud provisions cluster nodes. + title: Region Configuration + type: object + replicationSpecs: + description: |- + List of settings that configure your cluster regions. + + - For Global Clusters, each object in the array represents one zone where MongoDB Cloud deploys your clusters nodes. + - For non-Global sharded clusters and replica sets, the single object represents where MongoDB Cloud deploys your clusters nodes. + items: + $ref: "#/components/schemas/LegacyReplicationSpec" + type: array + rootCertType: + default: ISRGROOTX1 + description: Root Certificate Authority that MongoDB Atlas cluster uses. MongoDB Cloud supports Internet Security Research Group. + type: string + srvAddress: + description: Connection string that you can use to connect to the cluster. The `+srv` modifier forces the connection to use Transport Layer Security (TLS). The `mongoURI` parameter lists additional options. + externalDocs: + description: Connection string URI format. + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + stateName: + description: Human-readable label that indicates the current operating condition of the cluster. + readOnly: true + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. + type: boolean + versionReleaseSystem: + default: LTS + description: Method by which the cluster maintains the MongoDB versions. If value is `CONTINUOUS`, you must not specify **mongoDBMajorVersion**. + type: string + title: Cluster Description + type: object + LegacyAtlasTenantClusterUpgradeRequest: + description: Request containing target state of tenant cluster to be upgraded + properties: + acceptDataRisksAndForceReplicaSetReconfig: + description: If reconfiguration is necessary to regain a primary due to a regional outage, submit this field alongside your topology reconfiguration to request a new regional outage resistant topology. Forced reconfigurations during an outage of the majority of electable nodes carry a risk of data loss if replicated writes (even majority committed writes) have not been replicated to the new primary node. MongoDB Atlas docs contain more information. To proceed with an operation which carries that risk, set **acceptDataRisksAndForceReplicaSetReconfig** to the current date. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: Reconfiguring a Replica Set during a regional outage + url: https://dochub.mongodb.org/core/regional-outage-reconfigure-replica-set + format: date-time + type: string + advancedConfiguration: + $ref: "#/components/schemas/ApiAtlasClusterAdvancedConfiguration" + autoScaling: + $ref: "#/components/schemas/ClusterAutoScalingSettings" + backupEnabled: + description: Flag that indicates whether the cluster can perform backups. If set to `true`, the cluster can perform backups. You must set this value to `true` for NVMe clusters. Backup uses Cloud Backups for dedicated clusters and Shared Cluster Backups for tenant clusters. If set to `false`, the cluster doesn't use MongoDB Cloud backups. + type: boolean + biConnector: + $ref: "#/components/schemas/BiConnector" + clusterType: + description: Configuration of nodes that comprise the cluster. + type: string + configServerManagementMode: + default: ATLAS_MANAGED + description: |- + Config Server Management Mode for creating or updating a sharded cluster. + + When configured as ATLAS_MANAGED, atlas may automatically switch the cluster's config server type for optimal performance and savings. + + When configured as FIXED_TO_DEDICATED, the cluster will always use a dedicated config server. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + type: string + configServerType: + description: Describes a sharded cluster's config server type. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + readOnly: true + type: string + connectionStrings: + $ref: "#/components/schemas/ClusterConnectionStrings" + createDate: + description: Date and time when MongoDB Cloud created this serverless instance. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + diskSizeGB: + description: |- + Storage capacity of instance data volumes expressed in gigabytes. Increase this number to add capacity. + + This value is not configurable on M0/M2/M5 clusters. + + MongoDB Cloud requires this parameter if you set **replicationSpecs**. + + If you specify a disk size below the minimum (10 GB), this parameter defaults to the minimum disk size value. + + Storage charge calculations depend on whether you choose the default value or a custom value. + + The maximum value for disk storage cannot exceed 50 times the maximum RAM for the selected cluster. If you require more storage space, consider upgrading your cluster to a higher tier. + format: double + maximum: 4096 + minimum: 10 + type: number + diskWarmingMode: + default: FULLY_WARMED + description: Disk warming mode selection. + externalDocs: + description: Reduce Secondary Disk Warming Impact + url: https://docs.atlas.mongodb.com/reference/replica-set-tags/#reduce-secondary-disk-warming-impact + type: string + encryptionAtRestProvider: + description: 'Cloud service provider that manages your customer keys to provide an additional layer of encryption at rest for the cluster. To enable customer key management for encryption at rest, the cluster **replicationSpecs[n].regionConfigs[m].{type}Specs.instanceSize** setting must be `M10` or higher and `"backupEnabled" : false` or omitted entirely.' + externalDocs: + description: Encryption at Rest using Customer Key Management + url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ + type: string + featureCompatibilityVersion: + description: Feature compatibility version of the cluster. + readOnly: true + type: string + featureCompatibilityVersionExpirationDate: + description: Feature compatibility version expiration date. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + globalClusterSelfManagedSharding: + description: |- + Set this field to configure the Sharding Management Mode when creating a new Global Cluster. + + When set to false, the management mode is set to Atlas-Managed Sharding. This mode fully manages the sharding of your Global Cluster and is built to provide a seamless deployment experience. + + When set to true, the management mode is set to Self-Managed Sharding. This mode leaves the management of shards in your hands and is built to provide an advanced and flexible deployment experience. + + This setting cannot be changed once the cluster is deployed. + externalDocs: + description: Creating a Global Cluster + url: https://dochub.mongodb.org/core/global-cluster-management + type: boolean + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + labels: + deprecated: true + description: |- + Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels. + + Cluster labels are deprecated and will be removed in a future release. We strongly recommend that you use Resource Tags instead. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ComponentLabel" + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongoDBEmployeeAccessGrant: + $ref: "#/components/schemas/EmployeeAccessGrant" + mongoDBMajorVersion: + description: |- + MongoDB major version of the cluster. + + On creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLTSVersions). + + On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version. + example: "5.0" + externalDocs: + description: Available MongoDB Versions in Atlas + url: https://www.mongodb.com/docs/atlas/reference/faq/database/#which-versions-of-mongodb-do-service-clusters-use- + type: string + mongoDBVersion: + description: Version of MongoDB that the cluster runs. + example: 5.0.25 + pattern: ([\d]+\.[\d]+\.[\d]+) + type: string + mongoURI: + description: Base connection string that you can use to connect to the cluster. MongoDB Cloud displays the string only after the cluster starts, not while it builds the cluster. + externalDocs: + description: Connection string URI format. + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + mongoURIUpdated: + description: Date and time when someone last updated the connection string. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + mongoURIWithOptions: + description: Connection string that you can use to connect to the cluster including the `replicaSet`, `ssl`, and `authSource` query parameters with values appropriate for the cluster. You may need to add MongoDB database users. The response returns this parameter once the cluster can receive requests, not while it builds the cluster. + externalDocs: + description: Connection string URI format. + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + name: + description: Human-readable label that identifies the cluster. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + numShards: + default: 1 + description: Number of shards up to 50 to deploy for a sharded cluster. The resource returns `1` to indicate a replica set and values of `2` and higher to indicate a sharded cluster. The returned value equals the number of shards in the cluster. + externalDocs: + description: Sharding + url: https://docs.mongodb.com/manual/sharding/ + format: int32 + maximum: 50 + minimum: 1 + type: integer + paused: + description: Flag that indicates whether the cluster is paused. + type: boolean + pitEnabled: + description: Flag that indicates whether the cluster uses continuous cloud backups. + externalDocs: + description: Continuous Cloud Backups + url: https://docs.atlas.mongodb.com/backup/cloud-backup/overview/ + type: boolean + providerBackupEnabled: + description: Flag that indicates whether the M10 or higher cluster can perform Cloud Backups. If set to `true`, the cluster can perform backups. If this and **backupEnabled** are set to `false`, the cluster doesn't use MongoDB Cloud backups. + type: boolean + providerSettings: + $ref: "#/components/schemas/ClusterProviderSettings" + replicaSetScalingStrategy: + default: WORKLOAD_TYPE + description: |- + Set this field to configure the replica set scaling mode for your cluster. + + By default, Atlas scales under WORKLOAD_TYPE. This mode allows Atlas to scale your analytics nodes in parallel to your operational nodes. + + When configured as SEQUENTIAL, Atlas scales all nodes sequentially. This mode is intended for steady-state workloads and applications performing latency-sensitive secondary reads. + + When configured as NODE_TYPE, Atlas scales your electable nodes in parallel with your read-only and analytics nodes. This mode is intended for large, dynamic workloads requiring frequent and timely cluster tier scaling. This is the fastest scaling strategy, but it might impact latency of workloads when performing extensive secondary reads. + externalDocs: + description: Modify the Replica Set Scaling Mode + url: https://dochub.mongodb.org/core/scale-nodes + type: string + replicationFactor: + default: 3 + deprecated: true + description: Number of members that belong to the replica set. Each member retains a copy of your databases, providing high availability and data redundancy. Use **replicationSpecs** instead. + format: int32 + type: integer + replicationSpec: + additionalProperties: + $ref: "#/components/schemas/RegionSpec" + description: Physical location where MongoDB Cloud provisions cluster nodes. + title: Region Configuration + type: object + replicationSpecs: + description: |- + List of settings that configure your cluster regions. + + - For Global Clusters, each object in the array represents one zone where MongoDB Cloud deploys your clusters nodes. + - For non-Global sharded clusters and replica sets, the single object represents where MongoDB Cloud deploys your clusters nodes. + items: + $ref: "#/components/schemas/LegacyReplicationSpec" + type: array + rootCertType: + default: ISRGROOTX1 + description: Root Certificate Authority that MongoDB Atlas cluster uses. MongoDB Cloud supports Internet Security Research Group. + type: string + srvAddress: + description: Connection string that you can use to connect to the cluster. The `+srv` modifier forces the connection to use Transport Layer Security (TLS). The `mongoURI` parameter lists additional options. + externalDocs: + description: Connection string URI format. + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + stateName: + description: Human-readable label that indicates the current operating condition of the cluster. + readOnly: true + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. + type: boolean + versionReleaseSystem: + default: LTS + description: Method by which the cluster maintains the MongoDB versions. If value is `CONTINUOUS`, you must not specify **mongoDBMajorVersion**. + type: string + required: + - name + title: Tenant Cluster Upgrade Request + type: object + LegacyReplicationSpec: + properties: + id: + description: |- + Unique 24-hexadecimal digit string that identifies the replication object for a zone in a Global Cluster. + + - If you include existing zones in the request, you must specify this parameter. + + - If you add a new zone to an existing Global Cluster, you may specify this parameter. The request deletes any existing zones in a Global Cluster that you exclude from the request. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + numShards: + default: 1 + description: |- + Positive integer that specifies the number of shards to deploy in each specified zone If you set this value to `1` and **clusterType** is `SHARDED`, MongoDB Cloud deploys a single-shard sharded cluster. Don't create a sharded cluster with a single shard for production environments. Single-shard sharded clusters don't provide the same benefits as multi-shard configurations. + + If you are upgrading a replica set to a sharded cluster, you cannot increase the number of shards in the same update request. You should wait until after the cluster has completed upgrading to sharded and you have reconnected all application clients to the MongoDB router before adding additional shards. Otherwise, your data might become inconsistent once MongoDB Cloud begins distributing data across shards. + format: int32 + type: integer + regionsConfig: + additionalProperties: + $ref: "#/components/schemas/RegionSpec" + description: Physical location where MongoDB Cloud provisions cluster nodes. + title: Region Configuration + type: object + zoneName: + description: Human-readable label that identifies the zone in a Global Cluster. Provide this value only if **clusterType** is `GEOSHARDED`. + type: string + type: object + Link: + properties: + href: + description: Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with `https://cloud.mongodb.com/api/atlas`. + example: https://cloud.mongodb.com/api/atlas + type: string + rel: + description: Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with `https://cloud.mongodb.com/api/atlas`. + example: self + type: string + type: object + Link_Atlas: + properties: + href: + description: Uniform Resource Locator (URL) that points another API resource to which this response has some relationship. This URL often begins with `https://cloud.mongodb.com/api/atlas`. + example: https://cloud.mongodb.com/api/atlas + type: string + rel: + description: Uniform Resource Locator (URL) that defines the semantic relationship between this resource and another API resource. This URL often begins with `https://cloud.mongodb.com/api/atlas`. + example: self + type: string + type: object + LiveImportAvailableProject: + properties: + deployments: + description: List of clusters that can be migrated to MongoDB Cloud. + items: + $ref: "#/components/schemas/AvailableClustersDeployment" + type: array + migrationHosts: + description: Hostname of MongoDB Agent list that you configured to perform a migration. + items: + description: Hostname of MongoDB Agent that you configured to perform a migration. + type: string + type: array + name: + description: Human-readable label that identifies this project. + maxLength: 64 + minLength: 1 + readOnly: true + type: string + projectId: + description: Unique 24-hexadecimal digit string that identifies the project to be migrated. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + required: + - name + - projectId + type: object + LiveImportValidation: + properties: + _id: + description: Unique 24-hexadecimal digit string that identifies the validation. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + errorMessage: + description: Reason why the validation job failed. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project to validate. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + sourceGroupId: + description: Unique 24-hexadecimal digit string that identifies the source project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + status: + description: State of the specified validation job returned at the time of the request. + readOnly: true + type: string + type: object + LiveMigrationRequest20240530: + properties: + _id: + description: Unique 24-hexadecimal digit string that identifies the migration request. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + destination: + $ref: "#/components/schemas/Destination" + dropDestinationData: + default: false + description: Flag that indicates whether the migration process drops all collections from the destination cluster before the migration starts. + type: boolean + writeOnly: true + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + migrationHosts: + description: List of migration hosts used for this migration. + items: + example: vm001.example.com + type: string + maxItems: 1 + minItems: 1 + type: array + sharding: + $ref: "#/components/schemas/ShardingRequest" + source: + $ref: "#/components/schemas/Source" + required: + - destination + - source + type: object + LiveMigrationResponse: + properties: + _id: + description: Unique 24-hexadecimal digit string that identifies the migration job. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lagTimeSeconds: + description: Replication lag between the source and destination clusters. Atlas returns this setting only during an active migration, before the cutover phase. + format: int64 + readOnly: true + type: integer + migrationHosts: + description: List of hosts running MongoDB Agents. These Agents can transfer your MongoDB data between one source and one destination cluster. + items: + description: One host running a MongoDB Agent. This Agent can transfer your MongoDB data between one source and one destination cluster. + example: vm001.example.com + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?$ + type: string + readOnly: true + type: array + readyForCutover: + description: Flag that indicates the migrated cluster can be cut over to MongoDB Atlas. + readOnly: true + type: boolean + status: + description: |- + Progress made in migrating one cluster to MongoDB Atlas. + + `NEW`: Someone scheduled a local cluster migration to MongoDB Atlas. + + `FAILED`: The cluster migration to MongoDB Atlas failed. + + `COMPLETE`: The cluster migration to MongoDB Atlas succeeded. + + `EXPIRED`: MongoDB Atlas prepares to begin the cut over of the migrating cluster when source and destination clusters have almost synchronized. If `"readyForCutover" : true`, this synchronization starts a timer of 120 hours. You can extend this timer. If the timer expires, MongoDB Atlas returns this status. + + `WORKING`: The cluster migration to MongoDB Atlas is performing one of the following tasks: + + - Preparing connections to source and destination clusters. + - Replicating data from source to destination. + - Verifying MongoDB Atlas connection settings. + - Stopping replication after the cut over. + readOnly: true + type: string + type: object + ManagedNamespaces: + properties: + collection: + description: Human-readable label of the collection to manage for this Global Cluster. + type: string + customShardKey: + description: Database parameter used to divide the *collection* into shards. Global clusters require a compound shard key. This compound shard key combines the location parameter and the user-selected custom key. + type: string + db: + description: Human-readable label of the database to manage for this Global Cluster. + type: string + isCustomShardKeyHashed: + default: false + description: Flag that indicates whether someone hashed the custom shard key for the specified collection. If you set this value to `false`, MongoDB Cloud uses ranged sharding. + externalDocs: + description: Hashed Shard Keys + url: https://www.mongodb.com/docs/manual/reference/method/sh.shardCollection/#hashed-shard-keys + type: boolean + isShardKeyUnique: + default: false + description: Flag that indicates whether someone [hashed](https://www.mongodb.com/docs/manual/reference/method/sh.shardCollection/#hashed-shard-keys) the custom shard key. If this parameter returns `false`, this cluster uses [ranged sharding](https://www.mongodb.com/docs/manual/core/ranged-sharding/). + type: boolean + numInitialChunks: + description: Minimum number of chunks to create initially when sharding an empty collection with a [hashed shard key](https://www.mongodb.com/docs/manual/core/hashed-sharding/). + externalDocs: + description: Global Cluster Sharding + url: https://www.mongodb.com/docs/atlas/shard-global-collection/ + format: int64 + maximum: 8192 + type: integer + presplitHashedZones: + default: false + description: Flag that indicates whether MongoDB Cloud should create and distribute initial chunks for an empty or non-existing collection. MongoDB Cloud distributes data based on the defined zones and zone ranges for the collection. + externalDocs: + description: Hashed Shard Key + url: https://www.mongodb.com/docs/manual/core/hashed-sharding/ + type: boolean + required: + - collection + - customShardKey + - db + type: object + MdbAvailableVersion: + properties: + cloudProvider: + description: Cloud service provider on which MongoDB Cloud provisions the hosts. Set dedicated clusters to `AWS`, `GCP`, `AZURE` or `TENANT`. + type: string + defaultStatus: + description: Whether the version is the current default for the Instance Size and Cloud Provider. + type: string + instanceSize: + $ref: "#/components/schemas/BaseCloudProviderInstanceSize" + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + version: + description: The MongoDB Major Version in question. + externalDocs: + description: MongoDB Versioning + url: https://www.mongodb.com/docs/manual/reference/versioning/ + type: string + type: object + MeasurementDiskPartition: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + partitionName: + description: Human-readable label of the disk or partition to which the measurements apply. + readOnly: true + type: string + type: object + MeasurementsCollStatsLatencyCluster: + properties: + clusterId: + description: Unique identifier for Clusters. + readOnly: true + type: string + clusterView: + description: Cluster topology view. + readOnly: true + type: string + collectionName: + description: Human-readable label that identifies the collection. + readOnly: true + type: string + databaseName: + description: Human-readable label that identifies the database that the specified MongoDB process serves. + readOnly: true + type: string + end: + description: Date and time that specifies when to stop retrieving measurements. If you set **end**, you must set **start**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + granularity: + description: Duration that specifies the interval between measurement data points. The parameter expresses its value in ISO 8601 timestamp format in UTC. If you set this parameter, you must set either **period** or **start** and **end**. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. The project contains MongoDB processes that you want to return. The MongoDB process can be either the `mongod` or `mongos`. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + measurements: + description: List that contains measurements and their data points. + items: + $ref: "#/components/schemas/MetricsMeasurement" + readOnly: true + type: array + processId: + description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + readOnly: true + type: string + start: + description: Date and time that specifies when to start retrieving measurements. If you set **start**, you must set **end**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + type: object + MeasurementsCollStatsLatencyHost: + properties: + collectionName: + description: Human-readable label that identifies the collection. + readOnly: true + type: string + databaseName: + description: Human-readable label that identifies the database that the specified MongoDB process serves. + readOnly: true + type: string + end: + description: Date and time that specifies when to stop retrieving measurements. If you set **end**, you must set **start**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + granularity: + description: Duration that specifies the interval between measurement data points. The parameter expresses its value in ISO 8601 timestamp format in UTC. If you set this parameter, you must set either **period** or **start** and **end**. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. The project contains MongoDB processes that you want to return. The MongoDB process can be either the `mongod` or `mongos`. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + measurements: + description: List that contains measurements and their data points. + items: + $ref: "#/components/schemas/MetricsMeasurement" + readOnly: true + type: array + processId: + description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + readOnly: true + type: string + start: + description: Date and time that specifies when to start retrieving measurements. If you set **start**, you must set **end**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + type: object + MeasurementsIndexes: + properties: + collectionName: + description: Human-readable label that identifies the collection. + readOnly: true + type: string + databaseName: + description: Human-readable label that identifies the database that the specified MongoDB process serves. + readOnly: true + type: string + end: + description: Date and time that specifies when to stop retrieving measurements. If you set **end**, you must set **start**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + granularity: + description: Duration that specifies the interval between measurement data points. The parameter expresses its value in ISO 8601 timestamp format in UTC. If you set this parameter, you must set either **period** or **start** and **end**. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. The project contains MongoDB processes that you want to return. The MongoDB process can be either the `mongod` or `mongos`. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + indexIds: + description: List that contains the Atlas Search index identifiers. + items: + description: Unique 24-hexadecimal digit string that identifies the index. + type: string + readOnly: true + type: array + indexStatsMeasurements: + description: List that contains the Atlas Search index stats measurements. + items: + $ref: "#/components/schemas/MetricsMeasurement" + readOnly: true + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + processId: + description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + readOnly: true + type: string + start: + description: Date and time that specifies when to start retrieving measurements. If you set **start**, you must set **end**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + type: object + MeasurementsNonIndex: + properties: + end: + description: Date and time that specifies when to stop retrieving measurements. If you set **end**, you must set **start**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + granularity: + description: Duration that specifies the interval between measurement data points. The parameter expresses its value in ISO 8601 timestamp format in UTC. If you set this parameter, you must set either **period** or **start** and **end**. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. The project contains MongoDB processes that you want to return. The MongoDB process can be either the `mongod` or `mongos`. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + hardwareMeasurements: + description: List that contains the Atlas Search hardware measurements. + items: + $ref: "#/components/schemas/MetricsMeasurement" + readOnly: true + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + processId: + description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + readOnly: true + type: string + start: + description: Date and time that specifies when to start retrieving measurements. If you set **start**, you must set **end**. You can't set this parameter and **period** in the same request. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + statusMeasurements: + description: List that contains the Atlas Search status measurements. + items: + $ref: "#/components/schemas/MetricsMeasurement" + readOnly: true + type: array + type: object + MesurementsDatabase: + properties: + databaseName: + description: Human-readable label that identifies the database that the specified MongoDB process serves. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + MetricDataPoint: + description: value of, and metadata provided for, one data point generated at a particular moment in time. If no data point exists for a particular moment in time, the `value` parameter returns `null`. + properties: + timestamp: + description: Date and time when this data point occurred. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + value: + description: Value that comprises this data point. + readOnly: true + type: number + readOnly: true + type: object + MetricDataPoint_Atlas: + description: value of, and metadata provided for, one data point generated at a particular moment in time. If no data point exists for a particular moment in time, the `value` parameter returns `null`. + properties: + timestamp: + description: Date and time when this data point occurred. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + value: + description: Value that comprises this data point. + readOnly: true + type: number + readOnly: true + type: object + MetricsMeasurement: + properties: + dataPoints: + description: List that contains the value of, and metadata provided for, one data point generated at a particular moment in time. If no data point exists for a particular moment in time, the `value` parameter returns `null`. + items: + $ref: "#/components/schemas/MetricDataPoint" + readOnly: true + type: array + name: + description: Human-readable label of the measurement that this data point covers. + readOnly: true + type: string + units: + description: Element used to quantify the measurement. The resource returns units of throughput, storage, and time. + readOnly: true + type: string + type: object + MetricsMeasurement_Atlas: + properties: + dataPoints: + description: List that contains the value of, and metadata provided for, one data point generated at a particular moment in time. If no data point exists for a particular moment in time, the `value` parameter returns `null`. + items: + $ref: "#/components/schemas/MetricDataPoint_Atlas" + readOnly: true + type: array + name: + description: Human-readable label of the measurement that this data point covers. + readOnly: true + type: string + units: + description: Element used to quantify the measurement. The resource returns units of throughput, storage, and time. + readOnly: true + type: string + type: object + MongoDBAccessLogs: + description: Authentication attempt, one per object, made against the cluster. + properties: + authResult: + description: Flag that indicates whether the response should return successful authentication attempts only. + type: boolean + authSource: + description: Database against which someone attempted to authenticate. + readOnly: true + type: string + failureReason: + description: Reason that the authentication failed. Null if authentication succeeded. + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + readOnly: true + type: string + hostname: + description: Human-readable label that identifies the hostname of the target node that received the authentication attempt. + readOnly: true + type: string + ipAddress: + description: Internet Protocol address that attempted to authenticate with the database. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + readOnly: true + type: string + logLine: + description: Text of the host log concerning the authentication attempt. + readOnly: true + type: string + timestamp: + description: Date and time when someone made this authentication attempt. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + readOnly: true + type: string + username: + description: Username used to authenticate against the database. + readOnly: true + type: string + type: object + MongoDBAccessLogsList: + properties: + accessLogs: + description: Authentication attempt, one per object, made against the cluster. + items: + $ref: "#/components/schemas/MongoDBAccessLogs" + readOnly: true + type: array + type: object + NamespaceObj: + description: Human-readable label that identifies the namespace on the specified host. The resource expresses this parameter value as `.`. + properties: + namespace: + description: Human-readable label that identifies the namespace on the specified host. The resource expresses this parameter value as `.`. + readOnly: true + type: string + type: + default: collection + description: Human-readable label that identifies the type of namespace. + readOnly: true + type: string + readOnly: true + type: object + Namespaces: + properties: + namespaces: + description: List that contains each combination of database, collection, and type on the specified host. + items: + $ref: "#/components/schemas/NamespaceObj" + readOnly: true + type: array + uniqueItems: true + type: object + NamespacesRequest: + properties: + namespaces: + description: List of namespace strings (combination of database and collection) on the specified host or cluster. + items: + description: Human-readable label that identifies the namespace on the specified host or cluster. The resource expresses this parameter value as `.`. + type: string + writeOnly: true + type: array + uniqueItems: true + writeOnly: true + type: object + NetworkPermissionEntry: + properties: + awsSecurityGroup: + description: Unique string of the Amazon Web Services (AWS) security group that you want to add to the project's IP access list. Your IP access list entry can be one **awsSecurityGroup**, one **cidrBlock**, or one **ipAddress**. You must configure Virtual Private Connection (VPC) peering for your project before you can add an AWS security group to an IP access list. You cannot set AWS security groups as temporary access list entries. Don't set this parameter if you set **cidrBlock** or **ipAddress**. + pattern: ^([0-9]*/)?sg-([0-9]*) + type: string + cidrBlock: + description: Range of IP addresses in Classless Inter-Domain Routing (CIDR) notation that you want to add to the project's IP access list. Your IP access list entry can be one **awsSecurityGroup**, one **cidrBlock**, or one **ipAddress**. Don't set this parameter if you set **awsSecurityGroup** or **ipAddress**. + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$ + type: string + comment: + description: Remark that explains the purpose or scope of this IP access list entry. + maxLength: 80 + type: string + deleteAfterDate: + description: Date and time after which MongoDB Cloud deletes the temporary access list entry. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. The date must be later than the current date but no later than one week after you submit this request. The resource returns this parameter if you specified an expiration date when creating this IP access list entry. + format: date-time + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project that contains the IP access list to which you want to add one or more entries. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + ipAddress: + description: IP address that you want to add to the project's IP access list. Your IP access list entry can be one **awsSecurityGroup**, one **cidrBlock**, or one **ipAddress**. Don't set this parameter if you set **awsSecurityGroup** or **cidrBlock**. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + NetworkPermissionEntryStatus: + properties: + STATUS: + description: |- + State of the access list entry when MongoDB Cloud made this request. + + `ACTIVE`: This access list entry applies to all relevant cloud providers. + + `PENDING`: MongoDB Cloud has started to add access list entry. This access list entry may not apply to all cloud providers at the time of this request. + + `FAILED`: MongoDB Cloud didn't succeed in adding this access list entry. + readOnly: true + type: string + required: + - STATUS + type: object + NumberMetricUnits: + description: Element used to express the quantity. This can be an element of time, storage capacity, and the like. + example: COUNT + title: Number Metric Units + type: string + OnlineArchiveSchedule: + description: Regular frequency and duration when archiving process occurs. + properties: + type: + description: Type of schedule. + type: string + endHour: + description: Hour of the day when the scheduled window to run one online archive ends. + format: int32 + maximum: 23 + minimum: 0 + type: integer + endMinute: + description: Minute of the hour when the scheduled window to run one online archive ends. + format: int32 + maximum: 59 + minimum: 0 + type: integer + startHour: + description: Hour of the day when the when the scheduled window to run one online archive starts. + format: int32 + maximum: 23 + minimum: 0 + type: integer + startMinute: + description: Minute of the hour when the scheduled window to run one online archive starts. + format: int32 + maximum: 59 + minimum: 0 + type: integer + dayOfWeek: + description: Day of the week when the scheduled archive starts. The week starts with Monday (`1`) and ends with Sunday (`7`). + format: int32 + maximum: 7 + minimum: 1 + type: integer + dayOfMonth: + description: Day of the month when the scheduled archive starts. + format: int32 + maximum: 31 + minimum: 1 + type: integer + required: + - type + title: Online Archive Schedule + type: object + OrgFederationSettings: + description: Details that define how to connect one MongoDB Cloud organization to one federated authentication service. + properties: + federatedDomains: + description: List of domains associated with the organization's identity provider. + items: + type: string + type: array + uniqueItems: true + hasRoleMappings: + description: Flag that indicates whether this organization has role mappings configured. + type: boolean + id: + description: Unique 24-hexadecimal digit string that identifies this federation. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + identityProviderId: + description: Legacy 20-hexadecimal digit string that identifies the identity provider connected to this organization. + example: c2777a9eca931f29fc2f + pattern: ^([a-f0-9]{20})$ + type: string + identityProviderStatus: + description: String enum that indicates whether the identity provider is active. + type: string + title: Organization Federation Settings + type: object + OrgGroup: + properties: + clusters: + description: Settings that describe the clusters in each project that the API key is authorized to view. + items: + $ref: "#/components/schemas/CloudCluster" + readOnly: true + type: array + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + readOnly: true + type: string + groupName: + description: Human-readable label that identifies the project. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + type: string + orgId: + description: Unique 24-hexadecimal character string that identifies the organization that contains the project. + readOnly: true + type: string + orgName: + description: Human-readable label that identifies the organization that contains the project. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + type: string + planType: + description: Human-readable label that indicates the plan type. + readOnly: true + type: string + tags: + description: List of human-readable labels that categorize the specified project. MongoDB Cloud returns an empty array. + items: + readOnly: true + type: string + readOnly: true + type: array + type: object + OrgServiceAccount: + properties: + clientId: + description: The Client ID of the Service Account. + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + createdAt: + description: The date that the Service Account was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + description: + description: Human readable description for the Service Account. + type: string + name: + description: Human-readable name for the Service Account. + type: string + roles: + description: A list of Organization roles associated with the Service Account. + items: + description: Organization roles available for Service Accounts. + type: string + type: array + uniqueItems: true + secrets: + description: A list of secrets associated with the specified Service Account. + items: + $ref: "#/components/schemas/ServiceAccountSecret" + type: array + uniqueItems: true + type: object + OrgServiceAccountRequest: + properties: + description: + description: Human readable description for the Service Account. + maxLength: 250 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + type: string + name: + description: Human-readable name for the Service Account. The name is modifiable and does not have to be unique. + maxLength: 64 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + type: string + roles: + description: A list of organization-level roles for the Service Account. + items: + description: Organization roles available for Service Accounts. + type: string + type: array + secretExpiresAfterHours: + description: The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. + example: 8 + format: int32 + type: integer + required: + - description + - name + - roles + - secretExpiresAfterHours + type: object + OrgServiceAccountUpdateRequest: + properties: + description: + description: Human readable description for the Service Account. + maxLength: 250 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + type: string + name: + description: Human-readable name for the Service Account. The name is modifiable and does not have to be unique. + maxLength: 64 + minLength: 1 + pattern: ^[\p{L}\p{N}\-_.,' ]*$ + type: string + roles: + description: A list of organization-level roles for the Service Account. + items: + description: Organization roles available for Service Accounts. + type: string + type: array + type: object + OrgUserRequest: + properties: + roles: + $ref: "#/components/schemas/OrgUserRolesRequest" + teamIds: + description: List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs. + items: + type: string + type: array + uniqueItems: true + writeOnly: true + username: + description: Email address that represents the username of the MongoDB Cloud user. + format: email + type: string + writeOnly: true + required: + - roles + - username + type: object + OrgUserResponse: + properties: + id: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + orgMembershipStatus: + description: String enum that indicates whether the MongoDB Cloud user has a pending invitation to join the organization or they are already active in the organization. + readOnly: true + type: string + roles: + $ref: "#/components/schemas/OrgUserRolesResponse" + teamIds: + description: List of unique 24-hexadecimal digit strings that identifies the teams to which this MongoDB Cloud user belongs. + items: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + readOnly: true + type: array + uniqueItems: true + username: + description: Email address that represents the username of the MongoDB Cloud user. + format: email + readOnly: true + type: string + invitationCreatedAt: + description: Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + invitationExpiresAt: + description: Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + inviterUsername: + description: Username of the MongoDB Cloud user who sent the invitation to join the organization. + format: email + readOnly: true + type: string + country: + description: Two-character alphabetical string that identifies the MongoDB Cloud user's geographic location. This parameter uses the ISO 3166-1a2 code format. + example: US + pattern: ^([A-Z]{2})$ + readOnly: true + type: string + createdAt: + description: Date and time when MongoDB Cloud created the current account. This value is in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + firstName: + description: First or given name that belongs to the MongoDB Cloud user. + example: John + readOnly: true + type: string + lastAuth: + description: Date and time when the current account last authenticated. This value is in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + lastName: + description: Last name, family name, or surname that belongs to the MongoDB Cloud user. + example: Doe + readOnly: true + type: string + mobileNumber: + description: Mobile phone number that belongs to the MongoDB Cloud user. + pattern: (?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})$ + readOnly: true + type: string + required: + - id + - orgMembershipStatus + - roles + - username + type: object + OrgUserRolesRequest: + description: Organization and project level roles to assign the MongoDB Cloud user within one organization. + properties: + groupRoleAssignments: + description: List of project level role assignments to assign the MongoDB Cloud user. + items: + $ref: "#/components/schemas/GroupRoleAssignment" + type: array + orgRoles: + description: One or more organization level roles to assign the MongoDB Cloud user. + items: + description: Organization-level role. + type: string + minItems: 1 + type: array + uniqueItems: true + required: + - orgRoles + type: object + writeOnly: true + OrgUserRolesResponse: + description: Organization- and project-level roles assigned to one MongoDB Cloud user within one organization. + properties: + groupRoleAssignments: + description: List of project-level role assignments assigned to the MongoDB Cloud user. + items: + $ref: "#/components/schemas/GroupRoleAssignment" + type: array + orgRoles: + description: One or more organization-level roles assigned to the MongoDB Cloud user. + items: + description: Organization-level role. + type: string + type: array + uniqueItems: true + readOnly: true + type: object + OrgUserUpdateRequest: + properties: + roles: + $ref: "#/components/schemas/OrgUserRolesRequest" + teamIds: + description: List of unique 24-hexadecimal digit strings that identifies the teams to assign the MongoDB Cloud user. + items: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + type: array + uniqueItems: true + writeOnly: true + type: object + OrganizationInvitation: + properties: + createdAt: + description: Date and time when MongoDB Cloud sent the invitation. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + expiresAt: + description: Date and time when the invitation from MongoDB Cloud expires. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + groupRoleAssignments: + description: List of projects that the user will be added to when they accept their invitation to the organization. + items: + $ref: "#/components/schemas/GroupRole" + type: array + uniqueItems: true + id: + description: Unique 24-hexadecimal digit string that identifies this invitation. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + inviterUsername: + description: Email address of the MongoDB Cloud user who sent the invitation to join the organization. + format: email + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + orgId: + description: Unique 24-hexadecimal digit string that identifies the organization. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + orgName: + description: Human-readable label that identifies this organization. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + type: string + roles: + description: One or more organization-level roles to assign to the MongoDB Cloud user. + items: + type: string + type: array + uniqueItems: true + teamIds: + description: List of unique 24-hexadecimal digit strings that identifies each team. + items: + description: Unique 24-hexadecimal digit string that identifies the team. + type: string + readOnly: true + type: array + uniqueItems: true + username: + description: Email address of the MongoDB Cloud user invited to join the organization. + format: email + type: string + required: + - orgName + type: object + OrganizationInvitationGroupRoleAssignmentsRequest: + properties: + groupId: + description: Unique 24-hexadecimal digit string that identifies the project to which these roles belong. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + roles: + description: One or more project level roles to assign to the MongoDB Cloud user. + items: + type: string + type: array + uniqueItems: true + type: object + OrganizationInvitationRequest: + properties: + groupRoleAssignments: + description: List of projects that the user will be added to when they accept their invitation to the organization. + items: + $ref: "#/components/schemas/OrganizationInvitationGroupRoleAssignmentsRequest" + type: array + roles: + description: One or more organization level roles to assign to the MongoDB Cloud user. + items: + type: string + type: array + uniqueItems: true + teamIds: + description: List of teams to which you want to invite the desired MongoDB Cloud user. + items: + description: Unique 24-hexadecimal digit string that identifies the team. + type: string + type: array + uniqueItems: true + username: + description: Email address that belongs to the desired MongoDB Cloud user. + format: email + type: string + type: object + OrganizationInvitationUpdateRequest: + properties: + groupRoleAssignments: + description: List of projects that the user will be added to when they accept their invitation to the organization. + items: + $ref: "#/components/schemas/OrganizationInvitationGroupRoleAssignmentsRequest" + type: array + roles: + description: One or more organization level roles to assign to the MongoDB Cloud user. + items: + type: string + type: array + uniqueItems: true + teamIds: + description: List of teams to which you want to invite the desired MongoDB Cloud user. + items: + description: Unique 24-hexadecimal digit string that identifies the team. + type: string + type: array + uniqueItems: true + type: object + OrganizationSettings: + description: Collection of settings that configures the organization. + properties: + apiAccessListRequired: + description: Flag that indicates whether to require API operations to originate from an IP Address added to the API access list for the specified organization. + type: boolean + genAIFeaturesEnabled: + default: true + description: Flag that indicates whether this organization has access to generative AI features. This setting only applies to Atlas Commercial and is enabled by default. Once this setting is turned on, Project Owners may be able to enable or disable individual AI features at the project level. + externalDocs: + description: Generative AI FAQs + url: https://www.mongodb.com/docs/generative-ai-faq/ + type: boolean + maxServiceAccountSecretValidityInHours: + description: Number that represents the maximum period before expiry in hours for new Atlas Admin API Service Account secrets within the specified organization. + format: int32 + maximum: 8760 + minimum: 8 + type: integer + multiFactorAuthRequired: + description: "Flag that indicates whether to require users to set up Multi-Factor Authentication (MFA) before accessing the specified organization. To learn more, see: https://www.mongodb.com/docs/atlas/security-multi-factor-authentication/." + type: boolean + restrictEmployeeAccess: + description: "Flag that indicates whether to block MongoDB Support from accessing Atlas infrastructure and cluster logs for any deployment in the specified organization without explicit permission. Once this setting is turned on, you can grant MongoDB Support a 24-hour bypass access to the Atlas deployment to resolve support issues. To learn more, see: https://www.mongodb.com/docs/atlas/security-restrict-support-access/." + type: boolean + securityContact: + description: String that specifies a single email address for the specified organization to receive security-related notifications. Specifying a security contact does not grant them authorization or access to Atlas for security decisions or approvals. An empty string is valid and clears the existing security contact (if any). + type: string + streamsCrossGroupEnabled: + description: Flag that indicates whether a group's Atlas Stream Processing instances in this organization can create connections to other group's clusters in the same organization. + type: boolean + type: object + OutboundControlPlaneCloudProviderIPAddresses: + description: List of outbound IP addresses from the Atlas control plane, categorized by cloud provider. If your network allows inbound HTTP requests only from specific IP addresses, you must allow access from the following IP addresses so that Atlas can communicate with your webhooks and KMS. + properties: + aws: + additionalProperties: + description: Control plane IP addresses in AWS. Each key identifies an Amazon Web Services (AWS) region. Each value identifies control plane IP addresses in the AWS region. + items: + description: Control plane IP addresses in AWS. Each key identifies an Amazon Web Services (AWS) region. Each value identifies control plane IP addresses in the AWS region. + readOnly: true + type: string + readOnly: true + type: array + description: Control plane IP addresses in AWS. Each key identifies an Amazon Web Services (AWS) region. Each value identifies control plane IP addresses in the AWS region. + readOnly: true + type: object + azure: + additionalProperties: + description: Control plane IP addresses in Azure. Each key identifies an Azure region. Each value identifies control plane IP addresses in the Azure region. + items: + description: Control plane IP addresses in Azure. Each key identifies an Azure region. Each value identifies control plane IP addresses in the Azure region. + readOnly: true + type: string + readOnly: true + type: array + description: Control plane IP addresses in Azure. Each key identifies an Azure region. Each value identifies control plane IP addresses in the Azure region. + readOnly: true + type: object + gcp: + additionalProperties: + description: Control plane IP addresses in GCP. Each key identifies a Google Cloud (GCP) region. Each value identifies control plane IP addresses in the GCP region. + items: + description: Control plane IP addresses in GCP. Each key identifies a Google Cloud (GCP) region. Each value identifies control plane IP addresses in the GCP region. + readOnly: true + type: string + readOnly: true + type: array + description: Control plane IP addresses in GCP. Each key identifies a Google Cloud (GCP) region. Each value identifies control plane IP addresses in the GCP region. + readOnly: true + type: object + readOnly: true + title: Outbound Control Plane IP Addresses By Cloud Provider + type: object + PaginatedClusterDescription20240805: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ClusterDescription20240805" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedEventTypeDetailsResponse: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/EventTypeDetails" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedFederationIdentityProvider: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/FederationIdentityProvider" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedFlexClusters20241113: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/FlexClusterDescription20241113" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedGroupServiceAccounts: + description: A list of Project Service Accounts. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/GroupServiceAccount" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedHostView_Atlas: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link_Atlas" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ApiHostView_Atlas" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedOrgServiceAccounts: + description: A list of Organization Service Accounts. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/OrgServiceAccount" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedServiceAccountGroup: + description: A list of projects associated with the Service Account. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ServiceAccountGroup" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PemFileInfo: + description: PEM file information for the identity provider's current certificates. + properties: + certificates: + description: List of certificates in the file. + items: + $ref: "#/components/schemas/X509Certificate" + type: array + fileName: + description: Human-readable label given to the file. + type: string + type: object + PemFileInfoUpdate: + description: PEM file information for the identity provider's current certificates. + properties: + certificates: + description: List of certificates in the file. + items: + $ref: "#/components/schemas/X509CertificateUpdate" + type: array + fileName: + description: Human-readable label given to the file. + type: string + type: object + PerformanceAdvisorIndex: + properties: + avgObjSize: + description: The average size of an object in the collection of this index. + format: double + readOnly: true + type: number + id: + description: Unique 24-hexadecimal digit string that identifies this index. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + impact: + description: List that contains unique 24-hexadecimal character string that identifies the query shapes in this response that the Performance Advisor suggests. + items: + description: One unique 24-hexadecimal character string that identifies one query shape. + type: string + readOnly: true + type: array + index: + description: List that contains documents that specify a key in the index and its sort order. + items: + additionalProperties: + description: One index key paired with its sort order. A value of `1` indicates an ascending sort order. A value of `-1` indicates a descending sort order. Keys in indexes with multiple keys appear in the same order that they appear in the index. + format: int32 + type: integer + description: One index key paired with its sort order. A value of `1` indicates an ascending sort order. A value of `-1` indicates a descending sort order. Keys in indexes with multiple keys appear in the same order that they appear in the index. + type: object + readOnly: true + type: array + namespace: + description: Human-readable label that identifies the namespace on the specified host. The resource expresses this parameter value as `.`. + readOnly: true + type: string + weight: + description: Estimated performance improvement that the suggested index provides. This value corresponds to **Impact** in the Performance Advisor user interface. + format: double + readOnly: true + type: number + type: object + PerformanceAdvisorOpStats: + description: Details that this resource returned about the specified query. + properties: + ms: + description: Length of time expressed during which the query finds suggested indexes among the managed namespaces in the cluster. This parameter expresses its value in milliseconds. This parameter relates to the **duration** query parameter. + format: int64 + readOnly: true + type: integer + nReturned: + description: Number of results that the query returns. + format: int64 + readOnly: true + type: integer + nScanned: + description: Number of documents that the query read. + format: int64 + readOnly: true + type: integer + ts: + description: Date and time from which the query retrieves the suggested indexes. This parameter expresses its value in the number of seconds that have elapsed since the UNIX epoch. This parameter relates to the **since** query parameter. + externalDocs: + description: UNIX Epoch + url: https://en.wikipedia.org/wiki/Unix_time + format: int64 + readOnly: true + type: integer + readOnly: true + type: object + PerformanceAdvisorResponse: + properties: + shapes: + description: List of query predicates, sorts, and projections that the Performance Advisor suggests. + items: + $ref: "#/components/schemas/PerformanceAdvisorShape" + readOnly: true + type: array + suggestedIndexes: + description: List that contains the documents with information about the indexes that the Performance Advisor suggests. + items: + $ref: "#/components/schemas/PerformanceAdvisorIndex" + readOnly: true + type: array + type: object + PerformanceAdvisorShape: + properties: + avgMs: + description: Average duration in milliseconds for the queries examined that match this shape. + format: int64 + readOnly: true + type: integer + count: + description: Number of queries examined that match this shape. + format: int64 + readOnly: true + type: integer + id: + description: Unique 24-hexadecimal digit string that identifies this shape. This string exists only for the duration of this API request. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + inefficiencyScore: + description: Average number of documents read for every document that the query returns. + externalDocs: + description: Understanding the Query Inefficiency Score + url: https://www.mongodb.com/docs/atlas/performance-advisor/#std-label-query-inefficiency-score + format: int64 + readOnly: true + type: integer + namespace: + description: Human-readable label that identifies the namespace on the specified host. The resource expresses this parameter value as `.`. + readOnly: true + type: string + operations: + description: List that contains specific about individual queries. + items: + $ref: "#/components/schemas/PerformanceAdvisorOperation" + readOnly: true + type: array + type: object + PerformanceAdvisorSlowQuery: + description: Details of one slow query that the Performance Advisor detected. + properties: + line: + description: Text of the MongoDB log related to this slow query. + readOnly: true + type: string + metrics: + $ref: "#/components/schemas/PerformanceAdvisorSlowQueryMetrics" + namespace: + description: Human-readable label that identifies the namespace on the specified host. The resource expresses this parameter value as `.`. + readOnly: true + type: string + opType: + description: Operation type (read/write/command) associated with this slow query log. + readOnly: true + type: string + replicaState: + description: Replica state associated with this slow query log. + readOnly: true + type: string + readOnly: true + type: object + PerformanceAdvisorSlowQueryList: + properties: + slowQueries: + description: List of operations that the Performance Advisor detected that took longer to execute than a specified threshold. + items: + $ref: "#/components/schemas/PerformanceAdvisorSlowQuery" + readOnly: true + type: array + type: object + PerformanceAdvisorSlowQueryMetrics: + description: Metrics from a slow query log. + properties: + docsExamined: + description: The number of documents in the collection that MongoDB scanned in order to carry out the operation. + format: int64 + readOnly: true + type: integer + docsExaminedReturnedRatio: + description: Ratio of documents examined to documents returned. + format: double + readOnly: true + type: number + docsReturned: + description: The number of documents returned by the operation. + format: int64 + readOnly: true + type: integer + fromUserConnection: + description: This boolean will be true when the server can identfiy the query source as non-server. This field is only available for MDB 8.0+. + readOnly: true + type: boolean + hasIndexCoverage: + description: Indicates if the query has index coverage. + readOnly: true + type: boolean + hasSort: + description: This boolean will be true when a query cannot use the ordering in the index to return the requested sorted results; i.e. MongoDB must sort the documents after it receives the documents from a cursor. + readOnly: true + type: boolean + keysExamined: + description: The number of index keys that MongoDB scanned in order to carry out the operation. + format: int64 + readOnly: true + type: integer + keysExaminedReturnedRatio: + description: Ratio of keys examined to documents returned. + format: double + readOnly: true + type: number + numYields: + description: The number of times the operation yielded to allow other operations to complete. + format: int64 + readOnly: true + type: integer + operationExecutionTime: + description: Total execution time of a query in milliseconds. + format: int64 + readOnly: true + type: integer + responseLength: + description: The length in bytes of the operation's result document. + format: int64 + readOnly: true + type: integer + readOnly: true + type: object + PinnedNamespaces: + description: Pinned namespaces view for cluster + properties: + clusterId: + description: Unique 24-hexadecimal digit string that identifies the request cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the request project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + pinnedNamespaces: + description: List of all pinned namespaces. + items: + description: A single pinned namespace. + readOnly: true + type: string + readOnly: true + type: array + type: object + PipelineRunStats: + description: Runtime statistics for this Data Lake Pipeline run. + properties: + bytesExported: + description: Total data size in bytes exported for this pipeline run. + format: int64 + readOnly: true + type: integer + numDocs: + description: Number of docs ingested for a this pipeline run. + format: int64 + readOnly: true + type: integer + readOnly: true + title: Data Lake Pipeline Run Statistics + type: object + PrivateEndpointHostname: + description: Set of Private endpoint and hostnames. + properties: + hostname: + description: Human-readable label that identifies the hostname. + readOnly: true + type: string + privateEndpoint: + description: Human-readable label that identifies private endpoint. + readOnly: true + type: string + readOnly: true + type: object + PrivateLinkEndpoint: + properties: + cloudProvider: + description: Cloud service provider that serves the requested endpoint. + readOnly: true + type: string + deleteRequested: + description: Flag that indicates whether MongoDB Cloud received a request to remove the specified private endpoint from the private endpoint service. + readOnly: true + type: boolean + errorMessage: + description: Error message returned when requesting private connection resource. The resource returns `null` if the request succeeded. + readOnly: true + type: string + connectionStatus: + description: State of the Amazon Web Service PrivateLink connection when MongoDB Cloud received this request. + readOnly: true + type: string + interfaceEndpointId: + description: Unique 24-hexadecimal digit string that identifies the interface endpoint. + readOnly: true + type: string + privateEndpointConnectionName: + description: Human-readable label that MongoDB Cloud generates that identifies the private endpoint connection. + pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}%2[fF]([-\w._()]+)%2[fF]([-\w._()]+) + readOnly: true + type: string + privateEndpointIPAddress: + description: IPv4 address of the private endpoint in your Azure VNet that someone added to this private endpoint service. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + privateEndpointResourceId: + description: Unique string that identifies the Azure private endpoint's network interface that someone added to this private endpoint service. + example: /subscriptions/cba6d9c6-1d3f-3c11-03cb-c705d895e636/resourcegroups/qrRTqi4TSN)7yB5YLRjVDveH3.yLzpNR7Br0D3-SGrU3j0.0/providers/Microsoft.Network/privateEndpoints/pVP(vb(XeckpxtXzP0NaOsDjeWDbOK)DX8A2j2E_vBYL2.GEYIdln + readOnly: true + type: string + status: + description: State of the Google Cloud network endpoint group when MongoDB Cloud received this request. + readOnly: true + type: string + endpointGroupName: + description: Human-readable label that identifies a set of endpoints. + externalDocs: + description: Google Cloud Forwarding Rule Concepts + url: https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts + readOnly: true + type: string + endpoints: + description: List of individual private endpoints that comprise this endpoint group. + externalDocs: + description: Google Cloud Forwarding Rule Concepts + url: https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts + items: + $ref: "#/components/schemas/GCPConsumerForwardingRule" + readOnly: true + type: array + required: + - cloudProvider + type: object + PrivateNetworkEndpointIdEntry: + properties: + azureLinkId: + description: Link ID that identifies the Azure private endpoint connection. + type: string + comment: + description: Human-readable string to associate with this private endpoint. + type: string + customerEndpointDNSName: + description: Human-readable label to identify customer's VPC endpoint DNS name. If defined, you must also specify a value for **region**. + type: string + customerEndpointIPAddress: + description: IP address used to connect to the Azure private endpoint. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + endpointId: + description: Unique 22-character alphanumeric string that identifies the private endpoint. + example: vpce-3bf78b0ddee411ba1 + externalDocs: + description: Atlas Data Lake supports Amazon Web Services private endpoints using the AWS PrivateLink feature. + url: https://aws.amazon.com/privatelink/?privatelink-blogs.sort-by=item.additionalFields.createdDate&privatelink-blogs.sort-order=desc + pattern: ^vpce-[0-9a-f]{17}$ + type: string + errorMessage: + description: Error message describing a failure approving the private endpoint request. + type: string + provider: + default: AWS + description: Human-readable label that identifies the cloud service provider. Atlas Data Lake supports Amazon Web Services only. + type: string + region: + description: Human-readable label to identify the region of customer's VPC endpoint. If defined, you must also specify a value for **customerEndpointDNSName**. + example: US_EAST_1 + type: string + status: + description: Status of the private endpoint connection request. + type: string + type: + default: DATA_LAKE + description: Human-readable label that identifies the resource type associated with this private endpoint. + type: string + required: + - endpointId + type: object + ProtectedHours: + description: Defines the a window where maintenance will not begin within. + properties: + endHourOfDay: + description: Zero-based integer that represents the end hour of the of the day that the maintenance will not begin in. + format: int32 + maximum: 23 + minimum: 0 + type: integer + startHourOfDay: + description: Zero-based integer that represents the beginning hour of the of the day that the maintenance will not begin in. + format: int32 + maximum: 23 + minimum: 0 + type: integer + type: object + PushBasedLogExportProject: + properties: + bucketName: + description: The name of the bucket to which the agent will send the logs to. + type: string + createDate: + description: Date and time that this feature was enabled on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + iamRoleId: + description: ID of the AWS IAM role that will be used to write to the S3 bucket. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + prefixPath: + description: S3 directory in which vector will write to in order to store the logs. An empty string denotes the root directory. + type: string + state: + description: Describes whether or not the feature is enabled and what status it is in. + readOnly: true + type: string + type: object + RawMetricUnits: + default: RAW + description: Element used to express the quantity. This can be an element of time, storage capacity, and the like. + title: Raw Metric Units + type: string + RegionSpec: + description: Physical location where MongoDB Cloud provisions cluster nodes. + properties: + analyticsNodes: + description: Number of analytics nodes in the region. Analytics nodes handle analytic data such as reporting queries from MongoDB Connector for Business Intelligence on MongoDB Cloud. Analytics nodes are read-only, and can never become the primary. Use **replicationSpecs[n].{region}.analyticsNodes** instead. + format: int32 + type: integer + electableNodes: + description: Number of electable nodes to deploy in the specified region. Electable nodes can become the primary and can facilitate local reads. Use **replicationSpecs[n].{region}.electableNodes** instead. + format: int32 + type: integer + priority: + description: Number that indicates the election priority of the region. To identify the Preferred Region of the cluster, set this parameter to `7`. The primary node runs in the **Preferred Region**. To identify a read-only region, set this parameter to `0`. + format: int32 + maximum: 7 + minimum: 0 + type: integer + readOnlyNodes: + description: Number of read-only nodes in the region. Read-only nodes can never become the primary member, but can facilitate local reads. Use **replicationSpecs[n].{region}.readOnlyNodes** instead. + format: int32 + type: integer + title: Region Configuration + type: object + ReplicationSpec20240805: + description: Details that explain how MongoDB Cloud replicates data on the specified MongoDB database. + properties: + id: + description: Unique 24-hexadecimal digit string that identifies the replication object for a shard in a Cluster. If you include existing shard replication configurations in the request, you must specify this parameter. If you add a new shard to an existing Cluster, you may specify this parameter. The request deletes any existing shards in the Cluster that you exclude from the request. This corresponds to Shard ID displayed in the UI. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + regionConfigs: + description: |- + Hardware specifications for nodes set for a given region. Each **regionConfigs** object describes the region's priority in elections and the number and type of MongoDB nodes that MongoDB Cloud deploys to the region. Each **regionConfigs** object must have either an **analyticsSpecs** object, **electableSpecs** object, or **readOnlySpecs** object. Tenant clusters only require **electableSpecs. Dedicated** clusters can specify any of these specifications, but must have at least one **electableSpecs** object within a **replicationSpec**. + + **Example:** + + If you set `"replicationSpecs[n].regionConfigs[m].analyticsSpecs.instanceSize" : "M30"`, set `"replicationSpecs[n].regionConfigs[m].electableSpecs.instanceSize" : `"M30"` if you have electable nodes and `"replicationSpecs[n].regionConfigs[m].readOnlySpecs.instanceSize" : `"M30"` if you have read-only nodes. + items: + $ref: "#/components/schemas/CloudRegionConfig20240805" + type: array + zoneId: + description: Unique 24-hexadecimal digit string that identifies the zone in a Global Cluster. This value can be used to configure Global Cluster backup policies. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + zoneName: + description: 'Human-readable label that describes the zone this shard belongs to in a Global Cluster. Provide this value only if "clusterType" : "GEOSHARDED" but not "selfManagedSharding" : true.' + type: string + title: Replication Specifications + type: object + RequestAccepted: + description: Accepted + type: object + ResourceTag: + description: "Key-value pair that tags and categorizes a MongoDB Cloud organization, project, or cluster. For example, `environment : production`." + properties: + key: + description: "Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag." + maxLength: 255 + minLength: 1 + type: string + value: + description: "Variable that belongs to the set of the tag. For example, `production` in the `environment : production` tag." + maxLength: 255 + minLength: 1 + type: string + required: + - key + - value + title: Resource Tag + type: object + RestoreJobFileHash: + description: Key and value pair that map one restore file to one hashed checksum. This parameter applies after you download the corresponding **delivery.url**. + properties: + fileName: + description: Human-readable label that identifies the hashed file. + readOnly: true + type: string + hash: + description: Hashed checksum that maps to the restore file. + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + typeName: + description: Human-readable label that identifies the hashing algorithm used to compute the hash value. + readOnly: true + type: string + readOnly: true + type: object + SampleDatasetStatus: + properties: + _id: + description: Unique 24-hexadecimal character string that identifies this sample dataset. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + clusterName: + description: Human-readable label that identifies the cluster into which you loaded the sample dataset. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + completeDate: + description: Date and time when the sample dataset load job completed. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + createDate: + description: Date and time when you started the sample dataset load job. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + errorMessage: + description: Details of the error returned when MongoDB Cloud loads the sample dataset. This endpoint returns null if state has a value other than FAILED. + readOnly: true + type: string + state: + description: Status of the sample dataset load job. + readOnly: true + type: string + type: object + SchemaAdvisorItemRecommendation: + properties: + affectedNamespaces: + description: List that contains the namespaces and information on why those namespaces triggered the recommendation. + items: + $ref: "#/components/schemas/SchemaAdvisorNamespaceTriggers" + readOnly: true + type: array + description: + description: Description of the specified recommendation. + readOnly: true + type: string + recommendation: + description: Type of recommendation. + readOnly: true + type: string + type: object + SchemaAdvisorNamespaceTriggers: + properties: + namespace: + description: Namespace of the affected collection. Will be null for REDUCE_NUMBER_OF_NAMESPACE recommendation. + readOnly: true + type: string + triggers: + description: List of triggers that specify why the collection activated the recommendation. + items: + $ref: "#/components/schemas/SchemaAdvisorTriggerDetails" + readOnly: true + type: array + type: object + SchemaAdvisorResponse: + properties: + recommendations: + description: List that contains the documents with information about the schema advice that Performance Advisor suggests. + items: + $ref: "#/components/schemas/SchemaAdvisorItemRecommendation" + readOnly: true + type: array + type: object + SchemaAdvisorTriggerDetails: + properties: + description: + description: Description of the trigger type. + readOnly: true + type: string + triggerType: + description: Type of trigger. + readOnly: true + type: string + type: object + SearchIndexCreateRequest: + properties: + collectionName: + description: Label that identifies the collection to create an Atlas Search index in. + type: string + database: + description: Label that identifies the database that contains the collection to create an Atlas Search index in. + type: string + name: + description: Label that identifies this index. Within each namespace, names of all indexes in the namespace must be unique. + type: string + type: + description: Type of the index. The default type is search. + type: string + definition: + $ref: "#/components/schemas/BaseSearchIndexCreateRequestDefinition" + required: + - collectionName + - database + - name + type: object + SearchIndexDefinitionVersion: + description: Object which includes the version number of the index definition and the time that the index definition was created. + properties: + createdAt: + description: The time at which this index definition was created. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + version: + description: The version number associated with this index definition when it was created. + format: int64 + type: integer + title: Search Index Definition Version + type: object + SearchIndexResponse: + properties: + collectionName: + description: Label that identifies the collection that contains one or more Atlas Search indexes. + type: string + database: + description: Label that identifies the database that contains the collection with one or more Atlas Search indexes. + type: string + indexID: + description: Unique 24-hexadecimal digit string that identifies this Atlas Search index. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + latestDefinition: + $ref: "#/components/schemas/BaseSearchIndexResponseLatestDefinition" + latestDefinitionVersion: + $ref: "#/components/schemas/SearchIndexDefinitionVersion" + name: + description: Label that identifies this index. Within each namespace, the names of all indexes must be unique. + type: string + queryable: + description: Flag that indicates whether the index is queryable on all hosts. + type: boolean + status: + description: |- + Condition of the search index when you made this request. + + - `DELETING`: The index is being deleted. + - `FAILED` The index build failed. Indexes can enter the FAILED state due to an invalid index definition. + - `STALE`: The index is queryable but has stopped replicating data from the indexed collection. Searches on the index may return out-of-date data. + - `PENDING`: Atlas has not yet started building the index. + - `BUILDING`: Atlas is building or re-building the index after an edit. + - `READY`: The index is ready and can support queries. + type: string + statusDetail: + description: List of documents detailing index status on each host. + items: + $ref: "#/components/schemas/VectorSearchHostStatusDetail" + type: array + type: + description: Type of the index. The default type is search. + type: string + synonymMappingStatus: + description: Status that describes this index's synonym mappings. This status appears only if the index has synonyms defined. + type: string + synonymMappingStatusDetail: + description: A list of documents describing the status of the index's synonym mappings on each search host. Only appears if the index has synonyms defined. + items: + additionalProperties: + $ref: "#/components/schemas/SynonymMappingStatusDetail" + type: object + type: array + title: Search Index Response + type: object + SearchIndexUpdateRequest: + properties: + definition: + description: The index definition to update the search index to. + type: object + properties: + analyzer: + default: lucene.standard + description: |- + Specific pre-defined method chosen to convert database field text into searchable words. This conversion reduces the text of fields into the smallest units of text. These units are called a **term** or **token**. This process, known as tokenization, involves making the following changes to the text in fields: + + - extracting words + - removing punctuation + - removing accents + - changing to lowercase + - removing common words + - reducing words to their root form (stemming) + - changing words to their base form (lemmatization) + MongoDB Cloud uses the process you select to build the Atlas Search index. + externalDocs: + description: Atlas Search Analyzers + url: https://dochub.mongodb.org/core/analyzers--fts + type: string + analyzers: + description: List of user-defined methods to convert database field text into searchable words. + externalDocs: + description: Custom Atlas Search Analyzers + url: https://dochub.mongodb.org/core/custom-fts + items: + $ref: "#/components/schemas/AtlasSearchAnalyzer" + type: array + mappings: + $ref: "#/components/schemas/SearchMappings" + numPartitions: + default: 1 + description: Number of index partitions. Allowed values are [1, 2, 4]. + format: int32 + type: integer + searchAnalyzer: + default: lucene.standard + description: Method applied to identify words when searching this index. + type: string + storedSource: + description: Flag that indicates whether to store all fields (true) on Atlas Search. By default, Atlas doesn't store (false) the fields on Atlas Search. Alternatively, you can specify an object that only contains the list of fields to store (include) or not store (exclude) on Atlas Search. To learn more, see Stored Source Fields. + example: + include | exclude: + - field1 + - field2 + externalDocs: + description: Stored Source Fields + url: https://dochub.mongodb.org/core/atlas-search-stored-source + type: object + synonyms: + description: Rule sets that map words to their synonyms in this index. + externalDocs: + description: Synonym Mapping + url: https://dochub.mongodb.org/core/fts-synonym-mappings + items: + $ref: "#/components/schemas/SearchSynonymMappingDefinition" + type: array + fields: + description: Settings that configure the fields, one per object, to index. You must define at least one "vector" type field. You can optionally define "filter" type fields also. + externalDocs: + description: Vector Search Fields + url: https://dochub.mongodb.org/core/avs-vector-type + items: + $ref: "#/components/schemas/BasicDBObject" + type: array + required: + - definition + title: Search Index Update Request + type: object + SearchMappings: + description: Index specifications for the collection's fields. + properties: + dynamic: + description: Flag that indicates whether the index uses dynamic or static mappings. Required if **mappings.fields** is omitted. + externalDocs: + description: Dynamic or Static Mappings + url: https://dochub.mongodb.org/core/field-mapping-definition-fts#static-and-dynamic-mappings + type: boolean + fields: + additionalProperties: + $ref: "#/components/schemas/Fields" + description: One or more field specifications for the Atlas Search index. Required if **mappings.dynamic** is omitted or set to **false**. + externalDocs: + description: Atlas Search Index + url: https://dochub.mongodb.org/core/index-definitions-fts + type: object + x-additionalPropertiesName: Field Name + title: Mappings + type: object + SearchSynonymMappingDefinition: + description: Synonyms used for this full text index. + properties: + analyzer: + description: Specific pre-defined method chosen to apply to the synonyms to be searched. + type: string + name: + description: Label that identifies the synonym definition. Each **synonym.name** must be unique within the same index definition. + type: string + source: + $ref: "#/components/schemas/SynonymSource" + required: + - analyzer + - name + - source + title: Synonym Mapping Definition + type: object + ServerlessBackupRestoreJob: + properties: + cancelled: + description: Flag that indicates whether someone canceled this restore job. + readOnly: true + type: boolean + deliveryType: + description: Human-readable label that categorizes the restore job to create. + type: string + deliveryUrl: + description: 'One or more Uniform Resource Locators (URLs) that point to the compressed snapshot files for manual download. MongoDB Cloud returns this parameter when `"deliveryType" : "download"`.' + items: + description: One Uniform Resource Locator that points to the compressed snapshot files for manual download. + type: string + readOnly: true + type: array + desiredTimestamp: + $ref: "#/components/schemas/ApiBSONTimestamp" + expired: + description: Flag that indicates whether the restore job expired. + readOnly: true + type: boolean + expiresAt: + description: Date and time when the restore job expires. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + failed: + description: Flag that indicates whether the restore job failed. + readOnly: true + type: boolean + finishedAt: + description: Date and time when the restore job completed. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal character string that identifies the restore job. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + oplogInc: + description: 'Oplog operation number from which you want to restore this snapshot. This number represents the second part of an Oplog timestamp. The resource returns this parameter when `"deliveryType" : "pointInTime"` and **oplogTs** exceeds `0`.' + example: 1 + format: int32 + minimum: 1 + type: integer + oplogTs: + description: 'Date and time from which you want to restore this snapshot. This parameter expresses this timestamp in the number of seconds that have elapsed since the UNIX epoch. This number represents the first part of an Oplog timestamp. The resource returns this parameter when `"deliveryType" : "pointInTime"` and **oplogTs** exceeds `0`.' + format: int32 + minimum: 1199145600 + type: integer + pointInTimeUTCSeconds: + description: 'Date and time from which MongoDB Cloud restored this snapshot. This parameter expresses this timestamp in the number of seconds that have elapsed since the UNIX epoch. The resource returns this parameter when `"deliveryType" : "pointInTime"` and **pointInTimeUTCSeconds** exceeds `0`.' + format: int32 + minimum: 1199145600 + type: integer + snapshotId: + description: Unique 24-hexadecimal character string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + targetClusterName: + description: Human-readable label that identifies the target cluster to which the restore job restores the snapshot. The resource returns this parameter when `"deliveryType":` `"automated"`. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + targetGroupId: + description: Unique 24-hexadecimal digit string that identifies the target project for the specified **targetClusterName**. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + timestamp: + description: Date and time when MongoDB Cloud took the snapshot associated with **snapshotId**. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + required: + - deliveryType + - targetClusterName + - targetGroupId + type: object + ServerlessBackupSnapshot: + properties: + createdAt: + description: Date and time when MongoDB Cloud took the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + expiresAt: + description: Date and time when MongoDB Cloud deletes the snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + frequencyType: + description: Human-readable label that identifies how often this snapshot triggers. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongodVersion: + description: Version of the MongoDB host that this snapshot backs up. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + serverlessInstanceName: + description: Human-readable label given to the serverless instance from which MongoDB Cloud took this snapshot. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + snapshotType: + description: Human-readable label that identifies when this snapshot triggers. + readOnly: true + type: string + status: + description: Human-readable label that indicates the stage of the backup process for this snapshot. + readOnly: true + type: string + storageSizeBytes: + description: Number of bytes taken to store the backup snapshot. + format: int64 + readOnly: true + type: integer + type: object + ServerlessConnectionStringsPrivateEndpointItem: + description: Details of a private endpoint deployed for this serverless instance. + properties: + endpointId: + description: Unique string that the cloud provider uses to identify the private endpoint. + readOnly: true + type: string + providerName: + description: Cloud provider where the private endpoint is deployed. + readOnly: true + type: string + region: + description: Region where the private endpoint is deployed. + readOnly: true + type: string + title: Serverless Instance Private Endpoint Connection Strings Endpoint + type: object + ServerlessConnectionStringsPrivateEndpointList: + description: Private endpoint connection string that you can use to connect to this serverless instance through a private endpoint. + externalDocs: + description: Private Endpoint for Serverless Instance + url: https://docs.atlas.mongodb.com/security-serverless-private-endpoint/ + properties: + endpoints: + description: List that contains the private endpoints through which you connect to MongoDB Cloud when you use **connectionStrings.privateEndpoint[n].srvConnectionString**. + items: + $ref: "#/components/schemas/ServerlessConnectionStringsPrivateEndpointItem" + readOnly: true + type: array + srvConnectionString: + description: Private endpoint-aware connection string that uses the `mongodb+srv://` protocol to connect to MongoDB Cloud through a private endpoint. The `mongodb+srv` protocol tells the driver to look up the seed list of hosts in the Domain Name System (DNS). + readOnly: true + type: string + type: + description: MongoDB process type to which your application connects. + readOnly: true + type: string + title: Serverless Instance Private Endpoint Connection String + type: object + ServerlessInstanceDescription: + description: Group of settings that configure a MongoDB serverless instance. + properties: + connectionStrings: + $ref: "#/components/schemas/ServerlessInstanceDescriptionConnectionStrings" + createDate: + description: Date and time when MongoDB Cloud created this serverless instance. MongoDB Cloud represents this timestamp in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the serverless instance. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongoDBVersion: + description: Version of MongoDB that the serverless instance runs. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + name: + description: Human-readable label that identifies the serverless instance. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + providerSettings: + $ref: "#/components/schemas/ServerlessProviderSettings" + serverlessBackupOptions: + $ref: "#/components/schemas/ClusterServerlessBackupOptions" + stateName: + description: Human-readable label that indicates the current operating condition of the serverless instance. + readOnly: true + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the serverless instance. + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the serverless instance. If set to `true`, MongoDB Cloud won't delete the serverless instance. If set to `false`, MongoDB Cloud will delete the serverless instance. + type: boolean + required: + - providerSettings + title: Serverless Instance Description + type: object + ServerlessInstanceDescriptionConnectionStrings: + description: Collection of Uniform Resource Locators that point to the MongoDB database. + externalDocs: + description: Connection string URI format. + url: https://docs.mongodb.com/manual/reference/connection-string/ + properties: + privateEndpoint: + description: List of private endpoint-aware connection strings that you can use to connect to this serverless instance through a private endpoint. This parameter returns only if you created a private endpoint for this serverless instance and it is AVAILABLE. + items: + $ref: "#/components/schemas/ServerlessConnectionStringsPrivateEndpointList" + readOnly: true + type: array + standardSrv: + description: Public connection string that you can use to connect to this serverless instance. This connection string uses the `mongodb+srv://` protocol. + externalDocs: + description: Connection String URI Format + url: https://docs.mongodb.com/manual/reference/connection-string/ + readOnly: true + type: string + readOnly: true + title: Serverless Instance Connection Strings + type: object + ServerlessInstanceDescriptionCreate: + description: Settings that you can specify when you create a serverless instance. + properties: + name: + description: Human-readable label that identifies the serverless instance. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + writeOnly: true + providerSettings: + $ref: "#/components/schemas/ServerlessProviderSettings" + serverlessBackupOptions: + $ref: "#/components/schemas/ClusterServerlessBackupOptions" + stateName: + description: Human-readable label that indicates the current operating condition of the serverless instance. + readOnly: true + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the serverless instance. + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the serverless instance. If set to `true`, MongoDB Cloud won't delete the serverless instance. If set to `false`, MongoDB Cloud will delete the serverless instance. + type: boolean + required: + - name + - providerSettings + title: Serverless Instance Description Create + type: object + ServerlessInstanceDescriptionUpdate: + description: Settings that you can update when you request a serverless cluster update. + properties: + serverlessBackupOptions: + $ref: "#/components/schemas/ClusterServerlessBackupOptions" + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the serverless instance. + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the serverless instance. If set to `true`, MongoDB Cloud won't delete the serverless instance. If set to `false`, MongoDB Cloud will delete the serverless instance. + type: boolean + title: Serverless Instance Description Update + type: object + ServerlessProviderSettings: + description: Group of cloud provider settings that configure the provisioned MongoDB serverless instance. + properties: + backingProviderName: + description: Cloud service provider on which MongoDB Cloud provisioned the serverless instance. + type: string + effectiveDiskSizeGBLimit: + description: Storage capacity of instance data volumes expressed in gigabytes. This value is not configurable for Serverless or effectively Flex clusters. + format: int32 + readOnly: true + type: integer + effectiveInstanceSizeName: + $ref: "#/components/schemas/BaseCloudProviderInstanceSize" + effectiveProviderName: + description: Cloud service provider on which MongoDB Cloud effectively provisioned the serverless instance. + readOnly: true + type: string + providerName: + default: SERVERLESS + description: Human-readable label that identifies the cloud service provider. + type: string + regionName: + description: Human-readable label that identifies the geographic location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases. For a complete list of region names, see [AWS](https://docs.atlas.mongodb.com/reference/amazon-aws/#std-label-amazon-aws), [GCP](https://docs.atlas.mongodb.com/reference/google-gcp/), and [Azure](https://docs.atlas.mongodb.com/reference/microsoft-azure/). + type: string + required: + - backingProviderName + - regionName + title: Cloud Service Provider Settings for a Serverless Instance + type: object + ServerlessTenantCreateRequest: + properties: + comment: + description: Human-readable comment associated with the private endpoint. + maxLength: 80 + type: string + writeOnly: true + type: object + ServerlessTenantEndpoint: + properties: + _id: + description: Unique 24-hexadecimal digit string that identifies the private endpoint. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + cloudProviderEndpointId: + description: Unique string that identifies the Azure private endpoint's network interface that someone added to this private endpoint service. + pattern: ^/subscriptions/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/resource[gG]roups/private[Ll]ink/providers/Microsoft\.Network/privateEndpoints/[-\w._()]+$ + readOnly: true + type: string + comment: + description: Human-readable comment associated with the private endpoint. + maxLength: 80 + readOnly: true + type: string + endpointServiceName: + description: Unique string that identifies the Azure private endpoint service. MongoDB Cloud returns null while it creates the endpoint service. + pattern: ^pls_[0-9a-f]{24}$ + readOnly: true + type: string + errorMessage: + description: Human-readable error message that indicates error condition associated with establishing the private endpoint connection. + readOnly: true + type: string + status: + description: Human-readable label that indicates the current operating status of the private endpoint. + readOnly: true + type: string + providerName: + description: Human-readable label that identifies the cloud service provider. + readOnly: true + type: string + privateEndpointIpAddress: + description: IPv4 address of the private endpoint in your Azure VNet that someone added to this private endpoint service. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + readOnly: true + type: string + privateLinkServiceResourceId: + description: Root-relative path that identifies the Azure Private Link Service that MongoDB Cloud manages. MongoDB Cloud returns null while it creates the endpoint service. + readOnly: true + type: string + type: object + ServerlessTenantEndpointUpdate: + description: Update view for a serverless tenant endpoint. + properties: + comment: + description: Human-readable comment associated with the private endpoint. + maxLength: 80 + type: string + writeOnly: true + providerName: + description: Human-readable label that identifies the cloud provider of the tenant endpoint. + type: string + writeOnly: true + cloudProviderEndpointId: + description: Unique string that identifies the Azure private endpoint's network interface for this private endpoint service. + pattern: ^/subscriptions/[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}/resource[gG]roups/private[Ll]ink/providers/Microsoft\.Network/privateEndpoints/[-\w._()]+$ + type: string + writeOnly: true + privateEndpointIpAddress: + description: IPv4 address of the private endpoint in your Azure VNet that someone added to this private endpoint service. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + writeOnly: true + required: + - providerName + type: object + ServiceAccountGroup: + properties: + groupId: + description: "Unique 24-hexadecimal digit string that identifies your project. **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups." + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + type: object + ServiceAccountIPAccessListEntry: + properties: + cidrBlock: + description: Range of network addresses in the access list for the Service Account. This parameter requires the range to be expressed in Classless Inter-Domain Routing (CIDR) notation of Internet Protocol version 4 or version 6 addresses. You can set a value for this parameter or **ipAddress**, but not for both in the same request. + example: 203.0.113.0/24 + pattern: ^((([0-9]{1,3}\.){3}[0-9]{1,3})|(:{0,2}([0-9a-f]{1,4}:){0,7}[0-9a-f]{1,4}[:]{0,2}))((%2[fF]|/)[0-9]{1,3})+$ + type: string + createdAt: + description: Date MongoDB Cloud added the entry was added to the Access List. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + ipAddress: + description: Network address in the access list for the Service Account. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. You can set a value for this parameter or **cidrBlock**, but not for both in the same request. + example: 203.0.113.10 + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + lastUsedAddress: + description: Network address that issued the most recent request to the API. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. The resource returns this parameter after this IP address makes at least one request. + example: 203.0.113.10 + readOnly: true + type: string + lastUsedAt: + description: Date when MongoDB Cloud received the most recent request that originated from this Internet Protocol version 4 or version 6 address. The resource returns this parameter when at least one request originates from this IP address. MongoDB Cloud updates this parameter each time a client accesses the permitted resource, with a delay of up to 5 minutes. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + requestCount: + description: The number of requests that has originated from this network address. + format: int32 + readOnly: true + type: integer + type: object + ServiceAccountSecret: + properties: + createdAt: + description: The date that the secret was created on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + expiresAt: + description: The date for the expiration of the secret. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the secret. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lastUsedAt: + description: The last time the secret was used. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + maskedSecretValue: + description: The masked Service Account secret. + example: mdb_sa_sk_... + readOnly: true + type: string + secret: + description: The secret for the Service Account. It will be returned only the first time after creation. + example: mdb_sa_sk_... + readOnly: true + type: string + required: + - createdAt + - expiresAt + - id + type: object + ServiceAccountSecretRequest: + properties: + secretExpiresAfterHours: + description: The expiration time of the new Service Account secret, provided in hours. The minimum and maximum allowed expiration times are subject to change and are controlled by the organization's settings. + example: 8 + format: int32 + type: integer + required: + - secretExpiresAfterHours + type: object + ShardEntry: + description: Sharding configuration for a collection to be sharded on the destination cluster. + properties: + collection: + description: Human-readable label that identifies the collection to be sharded on the destination cluster. + type: string + writeOnly: true + database: + description: Human-readable label that identifies the database that contains the collection to be sharded on the destination cluster. + type: string + writeOnly: true + shardCollection: + $ref: "#/components/schemas/ShardKeys" + required: + - collection + - database + - shardCollection + type: object + ShardKeys: + description: Document that configures the shard key on the destination cluster. + properties: + key: + description: List of fields to use for the shard key. + items: + type: object + type: array + uniqueItems: true + writeOnly: true + type: object + writeOnly: true + ShardingRequest: + description: Document that configures sharding on the destination cluster when migrating from a replica set source to a sharded cluster destination on MongoDB 6.0 or higher. If you don't wish to shard any collections on the destination cluster, leave this empty. + properties: + createSupportingIndexes: + description: Flag that lets the migration create supporting indexes for the shard keys, if none exists, as the destination cluster also needs compatible indexes for the specified shard keys. + type: boolean + writeOnly: true + shardingEntries: + description: List of shard configurations to shard destination collections. Atlas shards only those collections that you include in the sharding entries array. + items: + $ref: "#/components/schemas/ShardEntry" + type: array + uniqueItems: true + writeOnly: true + required: + - createSupportingIndexes + type: object + writeOnly: true + Source: + description: Document that describes the source of the migration. + properties: + caCertificatePath: + description: Path to the CA certificate that signed SSL certificates use to authenticate to the source cluster. + type: string + clusterName: + description: Label that identifies the source cluster name. + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the source project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + managedAuthentication: + description: Flag that indicates whether MongoDB Automation manages authentication to the source cluster. If true, do not provide values for username and password. + type: boolean + password: + description: Password that authenticates the username to the source cluster. + type: string + writeOnly: true + ssl: + description: Flag that indicates whether you have SSL enabled. + type: boolean + username: + description: Label that identifies the SCRAM-SHA user that connects to the source cluster. + type: string + writeOnly: true + required: + - clusterName + - groupId + - managedAuthentication + - ssl + type: object + StateReason: + description: State reason of the Job. This is set when the job state is "Failed". + properties: + errorCode: + description: Error code relating to state. + type: string + message: + description: Message describing error or state. + type: string + readOnly: true + type: object + StreamConfig: + description: Configuration options for an Atlas Stream Processing Instance. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + tier: + description: Selected tier for the Stream Instance. Configures Memory / VCPU allowances. + title: Stream Instance Tier + type: string + type: object + StreamProcessorEventTypeViewAlertableWithThreshold: + description: Event type that triggers an alert. + example: OUTSIDE_STREAM_PROCESSOR_METRIC_THRESHOLD + title: Stream Processor Event Types + type: string + StreamProcessorMetricThreshold: + description: Threshold for the metric that, when exceeded, triggers an alert. The metric threshold pertains to event types which reflects changes of measurements and metrics in stream processors. + properties: + metricName: + description: Human-readable label that identifies the metric against which MongoDB Cloud checks the configured **metricThreshold.threshold**. + type: string + mode: + description: MongoDB Cloud computes the current metric value as an average. + type: string + operator: + description: Comparison operator to apply when checking the current metric value. + type: string + threshold: + description: Value of metric that, when exceeded, triggers an alert. + format: double + type: number + units: + $ref: "#/components/schemas/RawMetricUnits" + description: Element used to express the quantity. This can be an element of time, storage capacity, and the like. + title: Stream Processor Metric Threshold + type: object + StreamsAWSConnectionConfig: + description: AWS configurations for AWS-based connection types. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + roleArn: + description: Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account. + type: string + testBucket: + description: The name of an S3 bucket used to check authorization of the passed-in IAM role ARN. + type: string + type: object + StreamsConnection: + description: Settings that define a connection to an external data store. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source. + type: string + type: + description: Type of the connection. + type: string + clusterGroupId: + description: The id of the group that the cluster belongs to. + type: string + clusterName: + description: Name of the cluster configured for this connection. + type: string + dbRoleToExecute: + $ref: "#/components/schemas/DBRoleToExecute" + authentication: + $ref: "#/components/schemas/StreamsKafkaAuthentication" + bootstrapServers: + description: Comma separated list of server addresses. + type: string + config: + additionalProperties: + description: A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters. + example: '{"group.protocol.type":"consumer","debug":"queue, msg, protocol"}' + type: string + description: A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters. + example: + debug: queue, msg, protocol + group.protocol.type: consumer + type: object + networking: + $ref: "#/components/schemas/StreamsKafkaNetworking" + security: + $ref: "#/components/schemas/StreamsKafkaSecurity" + headers: + additionalProperties: + description: A map of key-value pairs that will be passed as headers for the request. + type: string + description: A map of key-value pairs that will be passed as headers for the request. + type: object + url: + description: The url to be used for the request. + type: string + aws: + $ref: "#/components/schemas/StreamsAWSConnectionConfig" + readOnly: true + type: object + StreamsDLQ: + description: Dead letter queue for the stream processor. + externalDocs: + url: https://www.mongodb.com/docs/atlas/reference/glossary/#std-term-dead-letter-queue + properties: + coll: + description: Name of the collection to use for the DLQ. + type: string + connectionName: + description: Name of the connection to write DLQ messages to. Must be an Atlas connection. + type: string + db: + description: Name of the database to use for the DLQ. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + StreamsDataProcessRegion: + description: Information about the cloud provider region in which MongoDB Cloud processes the stream. + properties: + cloudProvider: + description: Label that identifies the cloud service provider where MongoDB Cloud performs stream processing. Currently, this parameter only supports AWS and AZURE. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + region: + $ref: "#/components/schemas/BaseStreamsRegion" + required: + - cloudProvider + - region + type: object + StreamsKafkaAuthentication: + description: User credentials required to connect to a Kafka Cluster. Includes the authentication type, as well as the parameters for that authentication mode. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mechanism: + description: Style of authentication. Can be one of PLAIN, SCRAM-256, or SCRAM-512. + type: string + password: + description: Password of the account to connect to the Kafka cluster. + format: password + type: string + writeOnly: true + sslCertificate: + description: SSL certificate for client authentication to Kafka. + type: string + sslKey: + description: SSL key for client authentication to Kafka. + type: string + writeOnly: true + sslKeyPassword: + description: Password for the SSL key, if it is password protected. + type: string + writeOnly: true + username: + description: Username of the account to connect to the Kafka cluster. + type: string + type: object + StreamsKafkaNetworking: + description: Networking configuration for Streams connections. + properties: + access: + $ref: "#/components/schemas/StreamsKafkaNetworkingAccess" + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + StreamsKafkaNetworkingAccess: + description: Information about networking access. + properties: + connectionId: + description: Reserved. Will be used by PRIVATE_LINK connection type. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Reserved. Will be used by PRIVATE_LINK connection type. + type: string + tgwId: + description: Reserved. Will be used by TRANSIT_GATEWAY connection type. + pattern: ^(tgw-)[0-9a-zA-Z]+$ + type: string + tgwRouteId: + description: Reserved. Will be used by TRANSIT_GATEWAY connection type. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + type: + description: Selected networking type. Either PUBLIC, VPC, PRIVATE_LINK, or TRANSIT_GATEWAY. Defaults to PUBLIC. For VPC, ensure that VPC peering exists and connectivity has been established between Atlas VPC and the VPC where Kafka cluster is hosted for the connection to function properly. TRANSIT_GATEWAY support is coming soon. + title: Networking Access Type + type: string + vpcCIDR: + description: Reserved. Will be used by TRANSIT_GATEWAY connection type. + type: string + type: object + StreamsKafkaSecurity: + description: Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. + properties: + brokerPublicCertificate: + description: A trusted, public x509 certificate for connecting to Kafka over SSL. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + protocol: + description: Describes the transport type. Can be either SASL_PLAINTEXT, SASL_SSL, or SSL. + type: string + type: object + StreamsMatcher: + description: Rules to apply when comparing a stream processing instance or stream processor against this alert configuration. + properties: + fieldName: + $ref: "#/components/schemas/StreamsMatcherField" + operator: + description: Comparison operator to apply when checking the current metric value against **matcher[n].value**. + type: string + value: + description: Value to match or exceed using the specified **matchers.operator**. + example: event-replica-set + type: string + required: + - fieldName + - operator + - value + title: Matchers + type: object + StreamsMatcherField: + description: Name of the parameter in the target object that MongoDB Cloud checks. The parameter must match all rules for MongoDB Cloud to check for alert configurations. + example: INSTANCE_NAME + title: Streams Matcher Fields + type: string + StreamsModifyStreamProcessor: + description: A request to modify an existing stream processor + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: New name for the stream processor. + type: string + options: + $ref: "#/components/schemas/StreamsModifyStreamProcessorOptions" + pipeline: + description: New pipeline for the stream processor. + externalDocs: + description: Supported Aggregation Pipeline Stages + url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/stream-aggregation/#std-label-stream-aggregation + items: + $ref: "#/components/schemas/Document" + type: array + type: object + StreamsModifyStreamProcessorOptions: + description: Additional options for modifying a stream processor. + properties: + dlq: + $ref: "#/components/schemas/StreamsDLQ" + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + resumeFromCheckpoint: + description: When true, the modified stream processor resumes from its last checkpoint. + type: boolean + type: object + StreamsOptions: + description: Optional configuration for the stream processor. + properties: + dlq: + $ref: "#/components/schemas/StreamsDLQ" + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + StreamsPrivateLinkConnection: + description: Container for metadata needed to create a Private Link connection. + properties: + _id: + description: The ID of the Private Link connection. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + arn: + description: Amazon Resource Name (ARN). Required for AWS Provider and MSK vendor. + pattern: ^arn:aws:kafka + type: string + azureResourceIds: + description: Azure Resource IDs of each availability zone for the Azure Confluent cluster. + items: + type: string + type: array + dnsDomain: + description: |- + The domain hostname. Required for the following provider and vendor combinations: + - AWS provider with CONFLUENT vendor. + - AZURE provider with EVENTHUB or CONFLUENT vendor. + type: string + dnsSubDomain: + description: Sub-Domain name of Confluent cluster. These are typically your availability zones. Required for AWS Provider and CONFLUENT vendor, if your AWS CONFLUENT cluster doesn't use subdomains, you must set this to the empty array []. + items: + type: string + type: array + errorMessage: + description: Error message if the state is FAILED. + readOnly: true + type: string + interfaceEndpointId: + description: Interface endpoint ID that is created from the service endpoint ID provided. + readOnly: true + type: string + interfaceEndpointName: + description: Interface endpoint name that is created from the service endpoint ID provided. + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + provider: + description: Provider where the Kafka cluster is deployed. Valid values are AWS and AZURE. + type: string + providerAccountId: + description: Account ID from the cloud provider. + readOnly: true + type: string + region: + description: The region of the Provider’s cluster. See [AZURE](https://www.mongodb.com/docs/atlas/reference/microsoft-azure/#stream-processing-instances) and [AWS](https://www.mongodb.com/docs/atlas/reference/amazon-aws/#stream-processing-instances) supported regions. + type: string + serviceEndpointId: + description: For AZURE EVENTHUB, this is the [namespace endpoint ID](https://learn.microsoft.com/en-us/rest/api/eventhub/namespaces/get). For AWS CONFLUENT cluster, this is the [VPC Endpoint service name](https://docs.confluent.io/cloud/current/networking/private-links/aws-privatelink.html). + type: string + state: + description: State the connection is in. + readOnly: true + type: string + vendor: + description: |- + Vendor that manages the cloud service. The following are the vendor values per provider: + - AWS + -- MSK for AWS MSK Kafka clusters + -- CONFLUENT for Confluent Kafka clusters on AWS + -- KINESIS for AWS Kinesis Data Streams (coming soon). + + - Azure + -- EVENTHUB for Azure EventHub. + -- CONFLUENT for the Confluent Kafka clusters on Azure + + **NOTE** Omitting the vendor field will default to using the GENERIC vendor. + type: string + required: + - provider + type: object + StreamsProcessor: + description: An atlas stream processor. + properties: + _id: + description: Unique 24-hexadecimal character string that identifies the stream processor. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable name of the stream processor. + type: string + options: + $ref: "#/components/schemas/StreamsOptions" + pipeline: + description: Stream aggregation pipeline you want to apply to your streaming data. + externalDocs: + description: Supported Aggregation Pipeline Stages + url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/stream-aggregation/#std-label-stream-aggregation + items: + $ref: "#/components/schemas/Document" + type: array + type: object + StreamsProcessorWithStats: + description: An atlas stream processor with optional stats. + properties: + _id: + description: Unique 24-hexadecimal character string that identifies the stream processor. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable name of the stream processor. + readOnly: true + type: string + options: + $ref: "#/components/schemas/StreamsOptions" + pipeline: + description: Stream aggregation pipeline you want to apply to your streaming data. + items: + readOnly: true + type: object + readOnly: true + type: array + state: + description: The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. + readOnly: true + type: string + stats: + description: The stats associated with the stream processor. + externalDocs: + url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/manage-stream-processor/#view-statistics-of-a-stream-processor + readOnly: true + type: object + required: + - _id + - name + - pipeline + - state + type: object + StreamsSampleConnections: + description: Sample connections to add to SPI. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + solar: + default: false + description: Flag that indicates whether to add a 'sample_stream_solar' connection. + type: boolean + type: object + StreamsStartStreamProcessorWith: + description: A request to start a stream processor + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + startAtOperationTime: + description: The operation time after which the change stream source should begin reporting. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + type: string + type: object + StreamsTenant: + properties: + _id: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + connections: + description: List of connections configured in the stream instance. + items: + $ref: "#/components/schemas/StreamsConnection" + readOnly: true + type: array + dataProcessRegion: + $ref: "#/components/schemas/StreamsDataProcessRegion" + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + hostnames: + description: List that contains the hostnames assigned to the stream instance. + items: + description: Unique hostname assigned to the stream instance. + readOnly: true + type: string + readOnly: true + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the stream instance. + type: string + sampleConnections: + $ref: "#/components/schemas/StreamsSampleConnections" + streamConfig: + $ref: "#/components/schemas/StreamConfig" + type: object + SynonymMappingStatusDetail: + description: Contains the status of the index's synonym mappings on each search host. This field (and its subfields) only appear if the index has synonyms defined. + properties: + message: + description: Optional message describing an error. + type: string + queryable: + description: Flag that indicates whether the synonym mapping is queryable on a host. + type: boolean + status: + description: Status that describes this index's synonym mappings. This status appears only if the index has synonyms defined. + type: string + title: Synonym Mapping Status Detail + type: object + SynonymSource: + description: Data set that stores words and their applicable synonyms. + properties: + collection: + description: Label that identifies the MongoDB collection that stores words and their applicable synonyms. + type: string + required: + - collection + type: object + SystemStatus: + properties: + apiKey: + $ref: "#/components/schemas/ApiKey" + appName: + description: Human-readable label that identifies the service from which you requested this response. + readOnly: true + type: string + build: + description: Unique 40-hexadecimal digit hash that identifies the latest git commit merged for this application. + example: 83be55e140f493c88e7f578aae96548dd881587b + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + throttling: + description: Flag that indicates whether someone enabled throttling on this service. + readOnly: true + type: boolean + required: + - apiKey + - appName + - build + - throttling + type: object + TargetOrg: + properties: + linkToken: + description: Link token that contains all the information required to complete the link. + type: string + required: + - linkToken + type: object + TargetOrgRequest: + properties: + accessListIps: + description: IP address access list entries associated with the API key. + items: + description: One IP address access list entry associated with the API key. + type: string + type: array + type: object + Team: + properties: + id: + description: Unique 24-hexadecimal digit string that identifies this team. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the team. + type: string + usernames: + description: List that contains the MongoDB Cloud users in this team. + items: + format: email + type: string + type: array + uniqueItems: true + required: + - name + - usernames + type: object + TeamResponse: + properties: + id: + description: Unique 24-hexadecimal digit string that identifies this team. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the team. + type: string + type: object + TeamRole: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + roleNames: + description: One or more project-level roles to assign to the team. + items: + type: string + type: array + uniqueItems: true + teamId: + description: Unique 24-hexadecimal character string that identifies the team. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + type: object + TeamUpdate: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the team. + type: string + writeOnly: true + required: + - name + type: object + TenantRestore: + properties: + clusterName: + description: Human-readable label that identifies the source cluster. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + readOnly: true + type: string + deliveryType: + description: Means by which this resource returns the snapshot to the requesting MongoDB Cloud user. + readOnly: true + type: string + expirationDate: + description: Date and time when the download link no longer works. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the restore job. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + projectId: + description: Unique 24-hexadecimal digit string that identifies the project from which the restore job originated. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + restoreFinishedDate: + description: Date and time when MongoDB Cloud completed writing this snapshot. MongoDB Cloud changes the status of the restore job to `CLOSED`. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + restoreScheduledDate: + description: Date and time when MongoDB Cloud will restore this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + snapshotFinishedDate: + description: Date and time when MongoDB Cloud completed writing this snapshot. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + snapshotId: + description: Unique 24-hexadecimal digit string that identifies the snapshot to restore. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + snapshotUrl: + description: 'Internet address from which you can download the compressed snapshot files. The resource returns this parameter when `"deliveryType" : "DOWNLOAD"`.' + readOnly: true + type: string + status: + description: Phase of the restore workflow for this job at the time this resource made this request. + readOnly: true + type: string + targetDeploymentItemName: + description: Human-readable label that identifies the cluster on the target project to which you want to restore the snapshot. You can restore the snapshot to a cluster tier *M2* or greater. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + type: string + targetProjectId: + description: Unique 24-hexadecimal digit string that identifies the project that contains the cluster to which you want to restore the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + required: + - snapshotId + - targetDeploymentItemName + type: object + TenantWithSampleConnections: + type: object + ThirdPartyIntegration: + description: Collection of settings that describe third-party integrations. + properties: + id: + description: Integration id. + type: string + type: + description: Human-readable label that identifies the service to which you want to integrate with MongoDB Cloud. The value must match the third-party service integration type. + type: string + apiKey: + description: |- + Key that allows MongoDB Cloud to access your VictorOps account. + + **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: + + * View or edit the alert through the Atlas UI. + + * Query the alert for the notification through the Atlas Administration API. + example: "********************************9abc" + type: string + region: + description: PagerDuty region that indicates the API Uniform Resource Locator (URL) to use. + type: string + sendCollectionLatencyMetrics: + default: false + description: Toggle sending collection latency metrics that includes database names and collection namesand latency metrics on reads, writes, commands, and transactions. + type: boolean + sendDatabaseMetrics: + default: false + description: Toggle sending database metrics that includes database names and metrics on the number of collections, storage size, and index size. + type: boolean + sendUserProvidedResourceTags: + default: false + description: Toggle sending user provided group and cluster resource tags with the datadog metrics. + type: boolean + microsoftTeamsWebhookUrl: + description: |- + Endpoint web address of the Microsoft Teams webhook to which MongoDB Cloud sends notifications. + + **NOTE**: When you view or edit the alert for a Microsoft Teams notification, the URL appears partially redacted. + example: https://webhook.com/**** + type: string + accountId: + description: Unique 40-hexadecimal digit string that identifies your New Relic account. + example: bcc3c81b344a6030a3935c2527e2216535af7718 + pattern: ^([0-9a-f]){40}$ + type: string + licenseKey: + description: |- + Unique 40-hexadecimal digit string that identifies your New Relic license. + + **IMPORTANT**: Effective Wednesday, June 16th, 2021, New Relic no longer supports the plugin-based integration with MongoDB. We do not recommend that you sign up for the plugin-based integration. + Consider configuring an alternative monitoring integration before June 16th to maintain visibility into your MongoDB deployments. + example: bc3768f44193c282b2688ab39e00f8e4fc8d75ea + externalDocs: + description: New Relic Plugin EOL Statement + url: https://discuss.newrelic.com/t/new-relic-plugin-eol-wednesday-june-16th-2021/127267 + pattern: ^([0-9a-f]){40}$ + type: string + readToken: + description: Query key used to access your New Relic account. + example: 193c96aee4a3ac640b98634562e2631f17ae0a69 + type: string + writeToken: + description: Insert key associated with your New Relic account. + example: a67b10e5cd7f8fb6a34b501136c409f373edc218 + type: string + serviceKey: + description: |- + Service key associated with your PagerDuty account. + + **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: + + * View or edit the alert through the Atlas UI. + + * Query the alert for the notification through the Atlas Administration API. + example: "****************************7890" + type: string + enabled: + description: Flag that indicates whether someone has activated the Prometheus integration. + type: boolean + password: + description: Password needed to allow MongoDB Cloud to access your Prometheus account. + type: string + writeOnly: true + serviceDiscovery: + description: Desired method to discover the Prometheus service. + type: string + username: + description: Human-readable label that identifies your Prometheus incoming webhook. + example: prom_user_618d48e05277a606ed2496fe + type: string + apiToken: + description: |- + Key that allows MongoDB Cloud to access your Slack account. + + **NOTE**: After you create a notification which requires an API or integration key, the key appears partially redacted when you: + + * View or edit the alert through the Atlas UI. + + * Query the alert for the notification through the Atlas Administration API. + + **IMPORTANT**: Slack integrations now use the OAuth2 verification method and must be initially configured, or updated from a legacy integration, through the Atlas third-party service integrations page. Legacy tokens will soon no longer be supported. + example: "**********************************************************************abcd" + type: string + channelName: + description: Name of the Slack channel to which MongoDB Cloud sends alert notifications. + example: alerts + maxLength: 80 + minLength: 1 + type: string + teamName: + description: Human-readable label that identifies your Slack team. Set this parameter when you configure a legacy Slack integration. + example: MongoDB + type: string + routingKey: + description: Routing key associated with your Splunk On-Call account. + example: test routing + type: string + secret: + description: |- + An optional field returned if your webhook is configured with a secret. + + **NOTE**: When you view or edit the alert for a webhook notification, the secret appears completely redacted. + format: password + type: string + url: + description: |- + Endpoint web address to which MongoDB Cloud sends notifications. + + **NOTE**: When you view or edit the alert for a webhook notification, the URL appears partially redacted. + example: https://webhook.com/**** + type: string + title: Third-Party Integration + type: object + TriggerIngestionPipelineRequest: + properties: + datasetRetentionPolicy: + $ref: "#/components/schemas/DatasetRetentionPolicy" + snapshotId: + description: Unique 24-hexadecimal character string that identifies the snapshot. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + writeOnly: true + required: + - snapshotId + type: object + UpdateAtlasOrganizationApiKey: + properties: + desc: + description: Purpose or explanation provided when someone creates this organization API key. + maxLength: 250 + minLength: 1 + type: string + roles: + description: List of roles to grant this API key. If you provide this list, provide a minimum of one role and ensure each role applies to this organization. + items: + type: string + type: array + type: object + UpdateAtlasProjectApiKey: + properties: + desc: + description: Purpose or explanation provided when someone creates this project API key. + maxLength: 250 + minLength: 1 + type: string + roles: + description: List of roles to grant this API key. If you provide this list, provide a minimum of one role and ensure each role applies to this project. + items: + type: string + type: array + type: object + UpdateCustomDBRole: + properties: + actions: + description: List of the individual privilege actions that the role grants. + items: + $ref: "#/components/schemas/DatabasePrivilegeAction" + type: array + inheritedRoles: + description: List of the built-in roles that this custom role inherits. + items: + $ref: "#/components/schemas/DatabaseInheritedRole" + type: array + uniqueItems: true + type: object + UpdateGroupRolesForUser: + properties: + groupRoles: + description: One or more project level roles to assign to the MongoDB Cloud user. + items: + type: string + type: array + uniqueItems: true + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + UpdateOrgRolesForUser: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + orgRoles: + description: One or more organization level roles to assign to the MongoDB Cloud user. + items: + type: string + type: array + uniqueItems: true + type: object + UsageDetailsFilterRequest: + description: Request body which contains various fields to filter line items as part of certain Invoice Usage Details queries. + properties: + billEndDate: + description: The inclusive billing start date for usage details filter. + format: date + type: string + billStartDate: + description: The inclusive billing start date for usage details filter. + format: date + type: string + clusterIds: + description: The list of unique cluster ids to be included in the Usage Details filter. + items: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + type: array + uniqueItems: true + groupIds: + description: The list of groups to be included in the Usage Details filter. + items: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + type: array + uniqueItems: true + includeZeroCentLineItems: + description: Whether zero cent line items should be included. + type: boolean + skuServices: + description: The list of projects to be included in the Cost Explorer Query. + items: + type: string + type: array + uniqueItems: true + usageEndDate: + description: The inclusive billing start date for usage details filter. + format: date + type: string + usageStartDate: + description: The inclusive usage start date for usage details filter. + format: date + type: string + type: object + UserAccessListRequest: + properties: + cidrBlock: + description: Range of network addresses that you want to add to the access list for the API key. This parameter requires the range to be expressed in classless inter-domain routing (CIDR) notation of Internet Protocol version 4 or version 6 addresses. You can set a value for this parameter or **ipAddress** but not both in the same request. + example: 203.0.113.0/24 + pattern: ^((([0-9]{1,3}\.){3}[0-9]{1,3})|(:{0,2}([0-9a-f]{1,4}:){0,7}[0-9a-f]{1,4}[:]{0,2}))((%2[fF]|/)[0-9]{1,3})+$ + type: string + ipAddress: + description: Network address that you want to add to the access list for the API key. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. You can set a value for this parameter or **cidrBlock** but not both in the same request. + example: 203.0.113.10 + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + type: object + UserAccessListResponse: + properties: + cidrBlock: + description: Range of IP addresses in Classless Inter-Domain Routing (CIDR) notation in the access list for the API key. + example: 203.0.113.0/24 + pattern: ^((([0-9]{1,3}\.){3}[0-9]{1,3})|(:{0,2}([0-9a-f]{1,4}:){0,7}[0-9a-f]{1,4}[:]{0,2}))((%2[fF]|/)[0-9]{1,3})+$ + type: string + count: + description: Total number of requests that have originated from the Internet Protocol (IP) address given as the value of the *lastUsedAddress* parameter. + format: int32 + minimum: 1 + readOnly: true + type: integer + created: + description: Date and time when someone added the network addresses to the specified API access list. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + ipAddress: + description: Network address in the access list for the API key. + example: 203.0.113.10 + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + lastUsed: + description: Date and time when MongoDB Cloud received the most recent request that originated from this Internet Protocol version 4 or version 6 address. The resource returns this parameter when at least one request has originated from this IP address. MongoDB Cloud updates this parameter each time a client accesses the permitted resource. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + lastUsedAddress: + description: Network address that issued the most recent request to the API. This parameter requires the address to be expressed as one Internet Protocol version 4 or version 6 address. The resource returns this parameter after this IP address made at least one request. + example: 203.0.113.10 + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + UserAccessRoleAssignment: + properties: + roles: + description: List of roles to grant this API key. If you provide this list, provide a minimum of one role and ensure each role applies to this project. + items: + type: string + type: array + userId: + description: Unique 24-hexadecimal digit string that identifies the organization API key. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + type: object + UserCert: + properties: + _id: + description: Unique 24-hexadecimal character string that identifies this certificate. + format: int64 + readOnly: true + type: integer + createdAt: + description: Date and time when MongoDB Cloud created this certificate. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + monthsUntilExpiration: + default: 3 + description: Number of months that the certificate remains valid until it expires. + format: int32 + maximum: 24 + type: integer + writeOnly: true + notAfter: + description: Date and time when this certificate expires. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + subject: + description: Subject Alternative Name associated with this certificate. This parameter expresses its value as a distinguished name as defined in RFC 2253. + example: CN=BindUser,CN=Users,DC=myldapserver,DC=mycompany,DC=com + externalDocs: + description: RFC 2253 + url: https://tools.ietf.org/html/2253 + pattern: ^(?:(?CN=(?[^,]*)),)?(?:(?(?:(?:CN|OU)=[^,]+,?)+),)?(?(?:DC=[^,]+,?)+)$ + readOnly: true + type: string + type: object + UserCustomDBRole: + properties: + actions: + description: List of the individual privilege actions that the role grants. + items: + $ref: "#/components/schemas/DatabasePrivilegeAction" + type: array + inheritedRoles: + description: List of the built-in roles that this custom role inherits. + items: + $ref: "#/components/schemas/DatabaseInheritedRole" + type: array + uniqueItems: true + roleName: + description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. + type: string + required: + - roleName + type: object + UserScope: + description: Range of resources available to this database user. + properties: + name: + description: Human-readable label that identifies the cluster or MongoDB Atlas Data Lake that this database user can access. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + type: + description: Category of resource that this database user can access. + type: string + required: + - name + - type + title: Database User Scope + type: object + UserSecurity: + properties: + customerX509: + $ref: "#/components/schemas/DBUserTLSX509Settings" + ldap: + $ref: "#/components/schemas/LDAPSecuritySettings" + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + UserToDNMapping: + description: User-to-Distinguished Name (DN) map that MongoDB Cloud uses to transform a Lightweight Directory Access Protocol (LDAP) username into an LDAP DN. + properties: + ldapQuery: + description: Lightweight Directory Access Protocol (LDAP) query template that inserts the LDAP name that the regular expression matches into an LDAP query Uniform Resource Identifier (URI). The formatting for the query must conform to [RFC 4515](https://datatracker.ietf.org/doc/html/rfc4515) and [RFC 4516](https://datatracker.ietf.org/doc/html/rfc4516). + type: string + match: + description: Regular expression that MongoDB Cloud uses to match against the provided Lightweight Directory Access Protocol (LDAP) username. Each parenthesis-enclosed section represents a regular expression capture group that the substitution or `ldapQuery` template uses. + example: (.*) + type: string + substitution: + description: Lightweight Directory Access Protocol (LDAP) Distinguished Name (DN) template that converts the LDAP username that matches regular expression in the *match* parameter into an LDAP Distinguished Name (DN). + example: CN={0},CN=Users,DC=my-atlas-ldap-server,DC=example,DC=com + type: string + required: + - match + title: User to Distinguished Name Mapping + type: object + VPCPeeringActionChallenge: + description: Container for elements used to challenge the user before taking certain actions on VPC Peering connections. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + requesterAccountId: + description: The AWS requester account ID. + type: string + requesterVpcId: + description: The AWS requester VPC ID. + type: string + type: object + VectorSearchHostStatusDetail: + properties: + hostname: + description: Hostname that corresponds to the status detail. + type: string + mainIndex: + $ref: "#/components/schemas/VectorSearchIndexStatusDetail" + queryable: + description: Flag that indicates whether the index is queryable on the host. + type: boolean + stagedIndex: + $ref: "#/components/schemas/VectorSearchIndexStatusDetail" + status: + description: |- + Condition of the search index when you made this request. + + - `DELETING`: The index is being deleted. + - `FAILED` The index build failed. Indexes can enter the FAILED state due to an invalid index definition. + - `STALE`: The index is queryable but has stopped replicating data from the indexed collection. Searches on the index may return out-of-date data. + - `PENDING`: Atlas has not yet started building the index. + - `BUILDING`: Atlas is building or re-building the index after an edit. + - `READY`: The index is ready and can support queries. + type: string + title: Vector Search Host Status Detail + type: object + VectorSearchIndexDefinition: + description: The vector search index definition set by the user. + properties: + fields: + description: Settings that configure the fields, one per object, to index. You must define at least one "vector" type field. You can optionally define "filter" type fields also. + externalDocs: + description: Vector Search Fields + url: https://dochub.mongodb.org/core/avs-vector-type + items: + $ref: "#/components/schemas/BasicDBObject" + type: array + numPartitions: + default: 1 + description: Number of index partitions. Allowed values are [1, 2, 4]. + format: int32 + type: integer + title: Vector Search Index Definition + type: object + VectorSearchIndexStatusDetail: + description: Contains status information about a vector search index. + properties: + definition: + $ref: "#/components/schemas/VectorSearchIndexDefinition" + definitionVersion: + $ref: "#/components/schemas/SearchIndexDefinitionVersion" + message: + description: Optional message describing an error. + type: string + queryable: + description: Flag that indicates whether the index generation is queryable on the host. + type: boolean + status: + description: |- + Condition of the search index when you made this request. + + - `DELETING`: The index is being deleted. + - `FAILED` The index build failed. Indexes can enter the FAILED state due to an invalid index definition. + - `STALE`: The index is queryable but has stopped replicating data from the indexed collection. Searches on the index may return out-of-date data. + - `PENDING`: Atlas has not yet started building the index. + - `BUILDING`: Atlas is building or re-building the index after an edit. + - `READY`: The index is ready and can support queries. + type: string + title: Vector Search Index Status Detail + type: object + X509Certificate: + properties: + notAfter: + description: Latest date that the certificate is valid. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + notBefore: + description: Earliest date that the certificate is valid. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + type: object + X509CertificateUpdate: + properties: + content: + description: Certificate content. + type: string + notAfter: + description: Latest date that the certificate is valid. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + notBefore: + description: Earliest date that the certificate is valid. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + type: object + ZoneMapping: + description: Human-readable label that identifies the subset of a global cluster. + properties: + location: + description: Code that represents a location that maps to a zone in your global cluster. MongoDB Cloud represents this location with a ISO 3166-2 location and subdivision codes when possible. + type: string + zone: + description: Human-readable label that identifies the zone in your global cluster. This zone maps to a location code. + type: string + required: + - location + - zone + title: Global Cluster Zone + type: object + raw: + description: Additional meta information captured about this event. The response returns this parameter as a JSON object when the query parameter `includeRaw=true`. The list of fields in the raw document may change. Don't rely on raw values for formal monitoring. + properties: + _t: + description: Unique identifier of event type. + example: ALERT_AUDIT + type: string + alertConfigId: + description: Unique 24-hexadecimal digit string that identifies the alert configuration related to the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + cid: + description: Unique 24-hexadecimal digit string that identifies the project in which the event occurred. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + cre: + description: Date and time when this event occurred. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + readOnly: true + type: string + description: + description: Description of the event. + example: Alert Acknowledged + type: string + gn: + description: Human-readable label that identifies the project. + example: Test Project + maxLength: 64 + minLength: 1 + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the event. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + orgId: + description: Unique 24-hexadecimal digit string that identifies the organization to which these events apply. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + orgName: + description: Human-readable label that identifies the organization that contains the project. + example: Test Organization + maxLength: 64 + minLength: 1 + type: string + severity: + description: Severity of the event. + type: string + readOnly: true + type: object + BaseSearchIndexResponseLatestDefinition: + properties: + analyzer: + default: lucene.standard + description: |- + Specific pre-defined method chosen to convert database field text into searchable words. This conversion reduces the text of fields into the smallest units of text. These units are called a **term** or **token**. This process, known as tokenization, involves making the following changes to the text in fields: + + - extracting words + - removing punctuation + - removing accents + - changing to lowercase + - removing common words + - reducing words to their root form (stemming) + - changing words to their base form (lemmatization) + MongoDB Cloud uses the process you select to build the Atlas Search index. + externalDocs: + description: Atlas Search Analyzers + url: https://dochub.mongodb.org/core/analyzers--fts + type: string + analyzers: + description: List of user-defined methods to convert database field text into searchable words. + externalDocs: + description: Custom Atlas Search Analyzers + url: https://dochub.mongodb.org/core/custom-fts + items: + $ref: "#/components/schemas/AtlasSearchAnalyzer" + type: array + mappings: + $ref: "#/components/schemas/SearchMappings" + numPartitions: + default: 1 + description: Number of index partitions. Allowed values are [1, 2, 4]. + format: int32 + type: integer + searchAnalyzer: + default: lucene.standard + description: Method applied to identify words when searching this index. + type: string + storedSource: + description: Flag that indicates whether to store all fields (true) on Atlas Search. By default, Atlas doesn't store (false) the fields on Atlas Search. Alternatively, you can specify an object that only contains the list of fields to store (include) or not store (exclude) on Atlas Search. To learn more, see Stored Source Fields. + example: + include | exclude: + - field1 + - field2 + externalDocs: + description: Stored Source Fields + url: https://dochub.mongodb.org/core/atlas-search-stored-source + type: object + synonyms: + description: Rule sets that map words to their synonyms in this index. + externalDocs: + description: Synonym Mapping + url: https://dochub.mongodb.org/core/fts-synonym-mappings + items: + $ref: "#/components/schemas/SearchSynonymMappingDefinition" + type: array + fields: + description: Settings that configure the fields, one per object, to index. You must define at least one "vector" type field. You can optionally define "filter" type fields also. + externalDocs: + description: Vector Search Fields + url: https://dochub.mongodb.org/core/avs-vector-type + items: + $ref: "#/components/schemas/BasicDBObject" + type: array + BaseSearchIndexCreateRequestDefinition: + properties: + analyzer: + default: lucene.standard + description: |- + Specific pre-defined method chosen to convert database field text into searchable words. This conversion reduces the text of fields into the smallest units of text. These units are called a **term** or **token**. This process, known as tokenization, involves making the following changes to the text in fields: + + - extracting words + - removing punctuation + - removing accents + - changing to lowercase + - removing common words + - reducing words to their root form (stemming) + - changing words to their base form (lemmatization) + MongoDB Cloud uses the process you select to build the Atlas Search index. + externalDocs: + description: Atlas Search Analyzers + url: https://dochub.mongodb.org/core/analyzers--fts + type: string + analyzers: + description: List of user-defined methods to convert database field text into searchable words. + externalDocs: + description: Custom Atlas Search Analyzers + url: https://dochub.mongodb.org/core/custom-fts + items: + $ref: "#/components/schemas/AtlasSearchAnalyzer" + type: array + mappings: + $ref: "#/components/schemas/SearchMappings" + numPartitions: + default: 1 + description: Number of index partitions. Allowed values are [1, 2, 4]. + format: int32 + type: integer + searchAnalyzer: + default: lucene.standard + description: Method applied to identify words when searching this index. + type: string + storedSource: + description: Flag that indicates whether to store all fields (true) on Atlas Search. By default, Atlas doesn't store (false) the fields on Atlas Search. Alternatively, you can specify an object that only contains the list of fields to store (include) or not store (exclude) on Atlas Search. To learn more, see Stored Source Fields. + example: + include | exclude: + - field1 + - field2 + externalDocs: + description: Stored Source Fields + url: https://dochub.mongodb.org/core/atlas-search-stored-source + type: object + synonyms: + description: Rule sets that map words to their synonyms in this index. + externalDocs: + description: Synonym Mapping + url: https://dochub.mongodb.org/core/fts-synonym-mappings + items: + $ref: "#/components/schemas/SearchSynonymMappingDefinition" + type: array + fields: + description: Settings that configure the fields, one per object, to index. You must define at least one "vector" type field. You can optionally define "filter" type fields also. + externalDocs: + description: Vector Search Fields + url: https://dochub.mongodb.org/core/avs-vector-type + items: + $ref: "#/components/schemas/BasicDBObject" + type: array + AWSCustomDNSEnabled: + properties: + enabled: + description: |- + Flag that indicates whether the project's clusters deployed to Amazon Web Services (AWS) use a custom Domain Name System (DNS). + When `"enabled": true`, connect to your cluster using Private IP for Peering connection strings. + externalDocs: + description: "To learn more, see FAQ: Connection String Options in the MongoDB Atlas documentation." + url: https://www.mongodb.com/docs/atlas/reference/faq/connection-changes/#how-does-this-affect-aws-vpc-peering-when-i-use-custom-dns- + type: boolean + required: + - enabled + type: object + AccessListItem: + properties: + cidrBlock: + description: Range of IP addresses in Classless Inter-Domain Routing (CIDR) notation that found in this project's access list. + pattern: ^((([0-9]{1,3}\.){3}[0-9]{1,3})|(:{0,2}([0-9a-f]{1,4}:){0,7}[0-9a-f]{1,4}[:]{0,2}))((%2[fF]|/)[0-9]{1,3})+$ + readOnly: true + type: string + ipAddress: + description: IP address included in the API access list. + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + readOnly: true + type: string + required: + - ipAddress + type: object + ApiAtlasCheckpoint: + properties: + clusterId: + description: Unique 24-hexadecimal digit string that identifies the cluster that contains the checkpoint. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + completed: + description: Date and time when the checkpoint completed and the balancer restarted. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project that owns the checkpoints. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies checkpoint. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + parts: + description: |- + Metadata that describes the complete snapshot. + + - For a replica set, this array contains a single document. + - For a sharded cluster, this array contains one document for each shard plus one document for the config host. + items: + $ref: "#/components/schemas/ApiCheckpointPart" + readOnly: true + type: array + restorable: + description: Flag that indicates whether MongoDB Cloud can use the checkpoint for a restore. + readOnly: true + type: boolean + started: + description: Date and time when the balancer stopped and began the checkpoint. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + timestamp: + description: Date and time to which the checkpoint restores. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + type: object + ApiAtlasClusterAdvancedConfiguration: + description: Group of settings that configures a subset of the advanced configuration details. + properties: + customOpensslCipherConfigTls12: + description: The custom OpenSSL cipher suite list for TLS 1.2. This field is only valid when `tlsCipherConfigMode` is set to `CUSTOM`. + externalDocs: + description: This option corresponds to the `opensslCipherConfig` `mongod` configuration file option. + url: https://www.mongodb.com/docs/manual/reference/parameters/#mongodb-parameter-param.opensslCipherConfig + items: + type: string + type: array + minimumEnabledTlsProtocol: + description: Minimum Transport Layer Security (TLS) version that the cluster accepts for incoming connections. Clusters using TLS 1.0 or 1.1 should consider setting TLS 1.2 as the minimum TLS protocol version. + externalDocs: + description: This option corresponds to the `net.ssl.disabledProtocols` `mongod` configuration file option. + url: https://docs.mongodb.com/upcoming/reference/configuration-options/#mongodb-setting-net.ssl.disabledProtocols + type: string + tlsCipherConfigMode: + description: The TLS cipher suite configuration mode. The default mode uses the default cipher suites. The custom mode allows you to specify custom cipher suites for both TLS 1.2 and TLS 1.3. + type: string + type: object + ApiAtlasInvalidPolicyErrorDetail: + properties: + detail: + description: A string that provides a detailed description of a validation error. + readOnly: true + type: string + type: object + ApiAtlasInvalidPolicy: + properties: + body: + description: A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. + example: |2 + forbid ( + principal, + action == cloud::Action::"cluster.createEdit", + resource + ) when { + context.cluster.regions.contains(cloud::region::"aws:us-east-1") + }; + readOnly: true + type: string + errors: + description: List of validation errors. + items: + $ref: "#/components/schemas/ApiAtlasInvalidPolicyErrorDetail" + readOnly: true + type: array + type: object + ApiAtlasInvalidResourcePolicyCreateError: + properties: + errorType: + description: Human-readable label that displays the type of an error. + type: string + invalidPolicies: + description: List of invalid policies containing details of their validation errors. + items: + $ref: "#/components/schemas/ApiAtlasInvalidPolicy" + readOnly: true + type: array + type: object + ApiAtlasNonCompliantResource: + properties: + orgId: + description: Unique 24-hexadecimal character string that identifies the organization the resource belongs to. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + resourceId: + description: Unique 24-hexadecimal character string that identifies the non-compliant resource. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + resourceName: + description: Unique human readable string that identifies the non-compliant resource. + readOnly: true + type: string + resourcePoliciesCausingNonCompliance: + description: List of resource policies causing the resource to be considered non-compliant. + items: + $ref: "#/components/schemas/ApiAtlasResourcePolicyMetadata" + readOnly: true + type: array + resourceType: + description: Human-readable label that displays the type of a resource. + readOnly: true + type: string + type: object + ApiAtlasPolicyCreate: + properties: + body: + description: A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. + example: |2 + forbid ( + principal, + action == cloud::Action::"cluster.createEdit", + resource + ) when { + context.cluster.regions.contains(cloud::region::"aws:us-east-1") + }; + type: string + required: + - body + type: object + ApiAtlasPolicyMetadata: + properties: + policyId: + description: Unique 24-hexadecimal character string that identifies the policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + type: object + ApiAtlasPolicy: + properties: + body: + description: A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. + example: |2 + forbid ( + principal, + action == cloud::Action::"cluster.createEdit", + resource + ) when { + context.cluster.regions.contains(cloud::region::"aws:us-east-1") + }; + readOnly: true + type: string + id: + description: Unique 24-hexadecimal character string that identifies the policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + type: object + ApiAtlasResourcePolicyCreate: + properties: + description: + description: Description of the atlas resource policy. + type: string + name: + description: Human-readable label that describes the atlas resource policy. + type: string + policies: + description: List of policies that make up the atlas resource policy. + items: + $ref: "#/components/schemas/ApiAtlasPolicyCreate" + type: array + required: + - name + - policies + type: object + ApiAtlasResourcePolicyEdit: + properties: + description: + description: Description of the atlas resource policy. + type: string + name: + description: Human-readable label that describes the atlas resource policy. + type: string + policies: + description: List of policies that make up the atlas resource policy. + items: + $ref: "#/components/schemas/ApiAtlasPolicyCreate" + type: array + type: object + ApiAtlasResourcePolicyMetadata: + properties: + policiesCausingNonCompliance: + description: List of policies that are in conflict with the current state of the resource. + items: + $ref: "#/components/schemas/ApiAtlasPolicyMetadata" + readOnly: true + type: array + resourcePolicyId: + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + resourcePolicyName: + description: Human-readable label that describes the atlas resource policy. + readOnly: true + type: string + type: object + ApiAtlasResourcePolicy: + properties: + createdByUser: + $ref: "#/components/schemas/ApiAtlasUserMetadata" + createdDate: + description: Date and time in UTC when the atlas resource policy was created. + format: date-time + readOnly: true + type: string + description: + description: Description of the atlas resource policy. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lastUpdatedByUser: + $ref: "#/components/schemas/ApiAtlasUserMetadata" + lastUpdatedDate: + description: Date and time in UTC when the atlas resource policy was last updated. + format: date-time + readOnly: true + type: string + name: + description: Human-readable label that describes the atlas resource policy. + readOnly: true + type: string + orgId: + description: Unique 24-hexadecimal character string that identifies the organization the atlas resource policy belongs to. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + policies: + description: List of policies that make up the atlas resource policy. + items: + $ref: "#/components/schemas/ApiAtlasPolicy" + readOnly: true + type: array + version: + description: A string that identifies the version of the atlas resource policy. + example: v1 + readOnly: true + type: string + type: object + ApiAtlasSnapshotSchedule: + properties: + clusterCheckpointIntervalMin: + description: Quantity of time expressed in minutes between successive cluster checkpoints. This parameter applies only to sharded clusters. This number determines the granularity of continuous cloud backups for sharded clusters. + format: int32 + type: integer + clusterId: + description: Unique 24-hexadecimal digit string that identifies the cluster with the snapshot you want to return. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + dailySnapshotRetentionDays: + description: Quantity of time to keep daily snapshots. MongoDB Cloud expresses this value in days. Set this value to `0` to disable daily snapshot retention. + format: int32 + type: integer + groupId: + description: Unique 24-hexadecimal digit string that identifies the project that contains the cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + monthlySnapshotRetentionMonths: + description: Number of months that MongoDB Cloud must keep monthly snapshots. Set this value to `0` to disable monthly snapshot retention. + format: int32 + type: integer + pointInTimeWindowHours: + description: Number of hours before the current time from which MongoDB Cloud can create a Continuous Cloud Backup snapshot. + format: int32 + type: integer + snapshotIntervalHours: + description: Number of hours that must elapse before taking another snapshot. + format: int32 + type: integer + snapshotRetentionDays: + description: Number of days that MongoDB Cloud must keep recent snapshots. + format: int32 + type: integer + weeklySnapshotRetentionWeeks: + description: Number of weeks that MongoDB Cloud must keep weekly snapshots. Set this value to `0` to disable weekly snapshot retention. + format: int32 + type: integer + required: + - clusterCheckpointIntervalMin + - clusterId + - dailySnapshotRetentionDays + - groupId + - monthlySnapshotRetentionMonths + - pointInTimeWindowHours + - snapshotIntervalHours + - snapshotRetentionDays + - weeklySnapshotRetentionWeeks + type: object + ApiAtlasUserMetadata: + description: The user that last updated the atlas resource policy. + properties: + id: + description: Unique 24-hexadecimal character string that identifies a user. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + name: + description: Human-readable label that describes a user. + readOnly: true + type: string + readOnly: true + type: object + ApiBSONTimestamp: + description: BSON timestamp that indicates when the checkpoint token entry in the oplog occurred. + properties: + date: + description: Date and time when the oplog recorded this database operation. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + increment: + description: Order of the database operation that the oplog recorded at specific date and time. + example: 1199145600 + format: int32 + minimum: 1199145600 + readOnly: true + type: integer + readOnly: true + title: BSON Timestamp + type: object + ApiCheckpointPart: + description: Metadata contained in one document that describes the complete snapshot taken for this node. + properties: + replicaSetName: + description: Human-readable label that identifies the replica set to which this checkpoint applies. + readOnly: true + type: string + shardName: + description: Human-readable label that identifies the shard to which this checkpoint applies. + readOnly: true + type: string + tokenDiscovered: + description: Flag that indicates whether the token exists. + readOnly: true + type: boolean + tokenTimestamp: + $ref: "#/components/schemas/ApiBSONTimestamp" + typeName: + description: Human-readable label that identifies the type of host that the part represents. + readOnly: true + type: string + readOnly: true + type: object + ApiSearchDeploymentRequest: + properties: + specs: + description: |- + List of settings that configure the Search Nodes for your cluster. + + **NOTE**: We accept a single configuration for all nodes currently. + items: + $ref: "#/components/schemas/ApiSearchDeploymentSpec" + maxItems: 1 + minItems: 1 + type: array + required: + - specs + type: object + ApiSearchDeploymentResponse: + properties: + encryptionAtRestProvider: + description: Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster. + externalDocs: + description: Encryption at Rest using Customer Key Management + url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the search deployment. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + specs: + description: List of settings that configure the Search Nodes for your cluster. The configuration will be returned for each region and shard. + items: + $ref: "#/components/schemas/ApiSearchDeploymentSpec" + readOnly: true + type: array + stateName: + description: Human-readable label that indicates the current operating condition of this search deployment. + readOnly: true + type: string + type: object + ApiSearchDeploymentSpec: + properties: + instanceSize: + description: Hardware specification for the Search Node instance sizes. + type: string + nodeCount: + description: Number of Search Nodes in the cluster. + example: 2 + format: int32 + maximum: 32 + minimum: 2 + type: integer + required: + - instanceSize + - nodeCount + type: object + AutoExportPolicy: + description: Policy for automatically exporting Cloud Backup Snapshots. + properties: + exportBucketId: + description: Unique 24-hexadecimal character string that identifies the Export Bucket. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + frequencyType: + description: Human-readable label that indicates the rate at which the export policy item occurs. + type: string + title: export + type: object + CollStatsRankedNamespaces: + properties: + groupId: + description: Unique 24-hexadecimal digit string that identifies the request project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + identifierId: + description: Unique 24-hexadecimal digit string that identifies the request process. + readOnly: true + type: string + rankedNamespaces: + description: Ordered list of the hottest namespaces, highest value first. + items: + description: A single namespace. + readOnly: true + type: string + readOnly: true + type: array + type: object + CostExplorerFilterResponse: + description: Response object to give information about created query. + properties: + token: + description: The token used to identify the created Cost Explorer query. + example: d9ab638a801efe182f98ae3e18ea4bb47b9fda808a28a8c7de205bb0e94f7d71 + maxLength: 64 + minLength: 64 + type: string + type: object + CreateDataProcessRegion: + description: Settings to configure the region where you wish to store your archived data. + properties: + cloudProvider: + description: Human-readable label that identifies the Cloud service provider where you wish to store your archived data. **AZURE** or **GCP** may be selected only if it is the Cloud service provider for the cluster and no archives for any other cloud provider have been created for the cluster. + type: string + region: + description: Human-readable label that identifies the geographic location of the region where you wish to store your archived data. + type: string + type: object + writeOnly: true + Criteria: + description: |- + Rules by which MongoDB Cloud archives data. + + Use the **criteria.type** field to choose how MongoDB Cloud selects data to archive. Choose data using the age of the data or a MongoDB query. + **"criteria.type": "DATE"** selects documents to archive based on a date. + **"criteria.type": "CUSTOM"** selects documents to archive based on a custom JSON query. MongoDB Cloud doesn't support **"criteria.type": "CUSTOM"** when **"collectionType": "TIMESERIES"**. + properties: + type: + description: |- + Means by which MongoDB Cloud selects data to archive. Data can be chosen using the age of the data or a MongoDB query. + **DATE** selects documents to archive based on a date. + **CUSTOM** selects documents to archive based on a custom JSON query. MongoDB Cloud doesn't support **CUSTOM** when `"collectionType": "TIMESERIES"`. + type: string + query: + description: "MongoDB find query that selects documents to archive. The specified query follows the syntax of the `db.collection.find(query)` command. This query can't use the empty document (`{}`) to return all documents. Set this parameter when **\"criteria.type\" : \"CUSTOM\"**." + type: string + dateField: + description: 'Indexed database parameter that stores the date that determines when data moves to the online archive. MongoDB Cloud archives the data when the current date exceeds the date in this database parameter plus the number of days specified through the **expireAfterDays** parameter. Set this parameter when you set `"criteria.type" : "DATE"`.' + type: string + dateFormat: + default: ISODATE + description: |- + Syntax used to write the date after which data moves to the online archive. Date can be expressed as ISO 8601, Epoch timestamps, or ObjectId. The Epoch timestamp can be expressed as nanoseconds, milliseconds, or seconds. Set this parameter when **"criteria.type" : "DATE"**. + You must set **"criteria.type" : "DATE"** if **"collectionType": "TIMESERIES"**. + type: string + expireAfterDays: + description: 'Number of days after the value in the **criteria.dateField** when MongoDB Cloud archives data in the specified cluster. Set this parameter when you set **"criteria.type" : "DATE"**.' + format: int32 + type: integer + type: object + DataExpirationRule: + description: Rule for specifying when data should be deleted from the archive. + properties: + expireAfterDays: + description: Number of days used in the date criteria for nominating documents for deletion. + format: int32 + maximum: 9215 + minimum: 7 + type: integer + type: object + DataProcessRegion: + description: Settings to configure the region where you wish to store your archived data. + properties: + cloudProvider: + description: Human-readable label that identifies the Cloud service provider where you store your archived data. + readOnly: true + type: string + region: + description: Human-readable label that identifies the geographic location of the region where you store your archived data. + readOnly: true + type: string + readOnly: true + type: object + EmployeeAccessGrant: + description: MongoDB employee granted access level and expiration for a cluster. + properties: + expirationTime: + description: Expiration date for the employee access grant. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + grantType: + description: Level of access to grant to MongoDB Employees. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + required: + - expirationTime + - grantType + type: object + GroupPaginatedEvent: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/EventViewForNdsGroup" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + MatcherField: + type: string + NumberMetricValue: + description: Measurement of the **metricName** recorded at the time of the event. + properties: + number: + description: Amount of the **metricName** recorded at the time of the event. This value triggered the alert. + format: double + readOnly: true + type: number + units: + $ref: "#/components/schemas/NumberMetricUnits" + readOnly: true + title: Number Metric Value + type: object + OrgPaginatedEvent: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/EventViewForOrg" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedAlertConfig: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/GroupAlertsConfig" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedAlert: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/AlertViewForNdsGroup" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiApiUser: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ApiKeyUserDetails" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAppUser: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/CloudAppUser" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAtlasCheckpoint: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ApiAtlasCheckpoint" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAtlasDatabaseUser: + description: List of MongoDB Database users granted access to databases in the specified project. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/CloudDatabaseUser" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAtlasDiskBackupExportJob: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/DiskBackupExportJob" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAtlasEARPrivateEndpoint: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/EARPrivateEndpoint" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAtlasFlexBackupRestoreJob20241113: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/FlexBackupRestoreJob20241113" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAtlasFlexBackupSnapshot20241113: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/FlexBackupSnapshot20241113" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAtlasProviderRegions: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/CloudProviderRegions" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAtlasServerlessBackupRestoreJob: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ServerlessBackupRestoreJob" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiAtlasServerlessBackupSnapshot: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ServerlessBackupSnapshot" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiInvoiceMetadata: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/BillingInvoiceMetadata" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiInvoice: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/BillingInvoice" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiStreamsConnection: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/StreamsConnection" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiStreamsPrivateLink: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/StreamsPrivateLinkConnection" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiStreamsStreamProcessorWithStats: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/StreamsProcessorWithStats" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiStreamsTenant: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/StreamsTenant" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedApiUserAccessListResponse: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/UserAccessListResponse" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedAtlasGroup: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/Group" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedAvailableVersion: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/MdbAvailableVersion" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedBackupSnapshotExportBuckets: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/DiskBackupSnapshotExportBucketResponse" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedBackupSnapshot: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/DiskBackupSnapshot" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedCloudBackupReplicaSet: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/DiskBackupReplicaSet" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedCloudBackupRestoreJob: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/DiskBackupSnapshotRestoreJob" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedCloudBackupShardedClusterSnapshot: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/DiskBackupShardedClusterSnapshot" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedCloudProviderContainer: + description: List of Network Peering Containers that Amazon Web Services serves. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/CloudProviderContainer" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + title: Network Peering + type: object + PaginatedConnectedOrgConfigs: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ConnectedOrgConfig" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedContainerPeer: + description: Group of Network Peering connection settings. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/BaseNetworkPeeringConnectionSettings" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedDatabase: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/MesurementsDatabase" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedDiskPartition: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/MeasurementDiskPartition" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedGroupUser: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/GroupUserResponse" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedIntegration: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ThirdPartyIntegration" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedNetworkAccess: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/NetworkPermissionEntry" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedOnlineArchive: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/BackupOnlineArchive" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedOrgGroup: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/OrgGroup" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedOrgUser: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/OrgUserResponse" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedOrganization: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/AtlasOrganization" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedPipelineRun: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/IngestionPipelineRun" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedPrivateNetworkEndpointIdEntry: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/PrivateNetworkEndpointIdEntry" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedPublicApiUsageDetailsLineItem: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/PublicApiUsageDetailsLineItem" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedRestoreJob: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/BackupRestoreJob" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedRoleMapping: + description: List role mappings from the specified organization in the specified federation. + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/AuthFederationRoleMapping" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedServerlessInstanceDescription: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ServerlessInstanceDescription" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedServiceAccountIPAccessEntry: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/ServiceAccountIPAccessListEntry" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedSnapshot: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/BackupSnapshot" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedTeamRole: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/TeamRole" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedTeam: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/TeamResponse" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedTenantRestore: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/TenantRestore" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedTenantSnapshot: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/BackupTenantSnapshot" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PaginatedUserCert: + properties: + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + results: + description: List of returned documents that MongoDB Cloud provides when completing this request. + items: + $ref: "#/components/schemas/UserCert" + readOnly: true + type: array + totalCount: + description: Total number of documents available. MongoDB Cloud omits this value if `includeCount` is set to `false`. The total number is an estimate and may not be exact. + format: int32 + minimum: 0 + readOnly: true + type: integer + type: object + PartitionField: + description: Metadata to partition this online archive. + properties: + fieldName: + description: Human-readable label that identifies the parameter that MongoDB Cloud uses to partition data. To specify a nested parameter, use the dot notation. + maxLength: 700 + type: string + fieldType: + description: Data type of the parameter that that MongoDB Cloud uses to partition data. Partition parameters of type UUID must be of binary subtype 4. MongoDB Cloud skips partition parameters of type UUID with subtype 3. + externalDocs: + description: UUID + url: http://bsonspec.org/spec.html + readOnly: true + type: string + order: + default: 0 + description: Sequence in which MongoDB Cloud slices the collection data to create partitions. The resource expresses this sequence starting with zero. The value of the **criteria.dateField** parameter defaults as the first item in the partition sequence. + format: int32 + type: integer + required: + - fieldName + - order + title: Online Archive Partition + type: object + PerformanceAdvisorOperation: + properties: + predicates: + description: List that contains the search criteria that the query uses. To use the values in key-value pairs in these predicates requires **Project Data Access Read Only** permissions or greater. Otherwise, MongoDB Cloud redacts these values. + items: + description: List that contains the search criteria that the query uses. To use the values in key-value pairs in these predicates requires **Project Data Access Read Only** permissions or greater. Otherwise, MongoDB Cloud redacts these values. + readOnly: true + type: object + x-xgen-IPA-exception: + xgen-IPA-117-objects-must-be-well-defined: Schema predates IPA validation + xgen-IPA-124-array-max-items: Schema predates IPA validation + readOnly: true + type: array + stats: + $ref: "#/components/schemas/PerformanceAdvisorOpStats" + type: object + PinFCV: + properties: + expirationDate: + description: Expiration date of the fixed FCV. If not specified, the expiration date will default to 4 weeks from the date FCV was originally pinned. Note that this field cannot exceed 4 weeks from the pinned date. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + type: object + PrivateIPMode: + properties: + enabled: + description: Flag that indicates whether someone enabled **Connect via Peering Only** mode for the specified project. + type: boolean + required: + - enabled + type: object + ProjectSettingItem: + properties: + enabled: + description: |- + Flag that indicates whether someone enabled the regionalized private endpoint setting for the specified project. + + - Set this value to `true` to enable regionalized private endpoints. This allows you to create more than one private endpoint in a cloud provider region. You need to enable this setting to connect to multi-region and global MongoDB Cloud sharded clusters. Enabling regionalized private endpoints introduces the following limitations: + - Your applications must use the new connection strings for existing multi-region and global sharded clusters. This might cause downtime. + - Your MongoDB Cloud project can't contain replica sets nor can you create new replica sets in this project. + + - You can't disable this setting if you have: + - more than one private endpoint in more than one region + - more than one private endpoint in one region and one private endpoint in one or more regions. + + - Set this value to `false` to disable regionalized private endpoints. + type: boolean + required: + - enabled + type: object + PublicApiUsageDetailsLineItem: + properties: + billDate: + description: Billing date of the line item. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + clusterName: + description: Cluster associated with the line item. + type: string + description: + description: Description of the line item, which can include SKU name and other identifying information. + type: string + groupId: + description: Group id associated with the line item. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + quantity: + description: Quantity of line item in units associated with SKU. + format: double + readOnly: true + type: number + totalPriceCents: + description: Price * quantity in applicable units, expressed as an integral number of cents. + format: int64 + type: integer + unitPriceDollars: + description: Price in units associated with the SKU for the line item. + format: double + type: number + usageDate: + description: Usage date of the line item. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + type: string + type: object + ApiAtlasFTSAnalyzers: + description: Settings that describe one Atlas Search custom analyzer. + properties: + charFilters: + description: Filters that examine text one character at a time and perform filtering operations. + items: {} + type: array + name: + description: |- + Human-readable name that identifies the custom analyzer. Names must be unique within an index, and must not start with any of the following strings: + - `lucene.` + - `builtin.` + - `mongodb.` + type: string + tokenFilters: + description: |- + Filter that performs operations such as: + + - Stemming, which reduces related words, such as "talking", "talked", and "talks" to their root word "talk". + + - Redaction, the removal of sensitive information from public documents. + items: {} + type: array + tokenizer: + description: Tokenizer that you want to use to create tokens. Tokens determine how Atlas Search splits up text into discrete chunks for indexing. + type: object + properties: + maxGram: + description: Characters to include in the longest token that Atlas Search creates. + type: integer + minGram: + description: Characters to include in the shortest token that Atlas Search creates. + type: integer + type: + description: Human-readable label that identifies this tokenizer type. + type: string + group: + description: Index of the character group within the matching expression to extract into tokens. Use `0` to extract all character groups. + type: integer + pattern: + description: Regular expression to match against. + type: string + maxTokenLength: + default: 255 + description: Maximum number of characters in a single token. Tokens greater than this length are split at this length into multiple tokens. + type: integer + required: + - name + - tokenizer + title: analyzers + type: object + ApiAtlasFTSMappings: + description: Index specifications for the collection's fields. + properties: + dynamic: + default: false + description: Flag that indicates whether the index uses dynamic or static mappings. Required if **mappings.fields** is omitted. + externalDocs: + description: Dynamic or Static Mappings + url: https://dochub.mongodb.org/core/index-definitions-fts#field-mapping-examples + type: boolean + fields: + description: One or more field specifications for the Atlas Search index. Required if **mappings.dynamic** is omitted or set to **false**. + externalDocs: + description: Atlas Search Index + url: https://dochub.mongodb.org/core/index-definitions-fts + type: object + title: mappings + type: object + securitySchemes: + DigestAuth: + scheme: digest + type: http + ServiceAccounts: + description: Learn more about [Service Accounts](https://www.mongodb.com/docs/atlas/api/service-accounts-overview). + flows: + clientCredentials: + scopes: {} + tokenUrl: https://cloud.mongodb.com/api/oauth/token + type: oauth2 +info: + description: |- + The MongoDB Atlas Administration API allows developers to manage all components in MongoDB Atlas. + + The Atlas Administration API uses OAuth2 Service Accounts or HTTP Digest Authentication to authenticate requests. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request. For example, to [return database access history](#tag/Access-Tracking/operation/listAccessLogsByClusterName) with [cURL](https://en.wikipedia.org/wiki/CURL), run the following command in the terminal: + + ``` + curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dbAccessHistory/clusters/{clusterName}?pretty=true" + ``` + + To learn more, see [Get Started with the Atlas Administration API](https://www.mongodb.com/docs/atlas/configure-api-access/). For support, see [MongoDB Support](https://www.mongodb.com/support/get-started). + + You can also explore the various endpoints available through the Atlas Administration API in MongoDB's [Postman workspace](https://www.postman.com/mongodb-devrel/workspace/mongodb-atlas-administration-apis/). + license: + name: CC BY-NC-SA 3.0 US + url: https://creativecommons.org/licenses/by-nc-sa/3.0/us/ + termsOfService: https://www.mongodb.com/mongodb-management-service-terms-and-conditions + title: MongoDB Atlas Administration API + version: "2.0" + x-xgen-sha: 8ff5fb9d270a1863bad8b91f85049e9b133bdffd +openapi: 3.0.1 +paths: + /api/atlas/v2: + get: + description: This resource returns information about the MongoDB application along with API key meta data. + operationId: getSystemStatus + parameters: [] + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/SystemStatus" + x-xgen-version: 2023-01-01 + description: OK + "401": + description: Unauthorized. + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return the status of this MongoDB application + tags: + - Root + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getSystemStatus --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetSystemStatusApiParams{} + sdkResp, httpResp, err := client.RootApi. + GetSystemStatusWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Root/operation/getSystemStatus + /api/atlas/v2/alertConfigs/matchers/fieldNames: + get: + description: Get all field names that the `matchers.fieldName` parameter accepts when you create or update an Alert Configuration. You can successfully call this endpoint with any assigned role. + operationId: listAlertConfigurationMatchersFieldNames + parameters: [] + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/MatcherField" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Alert Configuration Matchers Field Names + tags: + - Alert Configurations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAlertConfigurationMatchersFieldNames --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAlertConfigurationMatchersFieldNamesApiParams{} + sdkResp, httpResp, err := client.AlertConfigurationsApi. + ListAlertConfigurationMatchersFieldNamesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/alertConfigs/matchers/fieldNames?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/alertConfigs/matchers/fieldNames?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/listAlertConfigurationMatchersFieldNames + /api/atlas/v2/clusters: + get: + description: Returns the details for all clusters in all projects to which you have access. Clusters contain a group of hosts that maintain the same data set. The response does not include multi-cloud clusters. To use this resource, the requesting Service Account or API Key can have any cluster-level role. + operationId: listClustersForAllProjects + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedOrgGroup" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Authorized Clusters in All Projects + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listClustersForAllProjects --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListClustersForAllProjectsApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + ListClustersForAllProjectsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/clusters?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/clusters?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/listClustersForAllProjects + /api/atlas/v2/eventTypes: + get: + description: Returns a list of all event types, along with a description and additional metadata about each event. + operationId: listEventTypes + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedEventTypeDetailsResponse" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Event Types + tags: + - Events + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listEventTypes --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListEventTypesApiParams{} + sdkResp, httpResp, err := client.EventsApi. + ListEventTypesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/eventTypes?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/eventTypes?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Events/operation/listEventTypes + /api/atlas/v2/federationSettings/{federationSettingsId}: + delete: + description: "Deletes the federation settings instance and all associated data, including identity providers and domains. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in the last remaining connected organization. **Note**: requests to this resource will fail if there is more than one connected organization in the federation." + operationId: deleteFederationApp + parameters: + - $ref: "#/components/parameters/federationSettingsId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: No Content + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Federation Settings Instance + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteFederationApp --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteFederationAppApiParams{} + httpResp, err := client.FederatedAuthenticationApi. + DeleteFederationAppWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/deleteFederationApp + /api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs: + get: + description: Returns all connected org configs in the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected orgs. + operationId: listConnectedOrgConfigs + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedConnectedOrgConfigs" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Organization Configurations from One Federation + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listConnectedOrgConfigs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListConnectedOrgConfigsApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + ListConnectedOrgConfigsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/listConnectedOrgConfigs + /api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}: + delete: + description: "Removes one connected organization configuration from the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. Note: This request fails if only one connected organization exists in the federation." + operationId: removeConnectedOrgConfig + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique 24-hexadecimal digit string that identifies the connected organization configuration to remove. + in: path + name: orgId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Organization Configuration from One Federation + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api removeConnectedOrgConfig --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RemoveConnectedOrgConfigApiParams{} + httpResp, err := client.FederatedAuthenticationApi. + RemoveConnectedOrgConfigWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/removeConnectedOrgConfig + get: + description: Returns the specified connected org config from the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in the connected org. + operationId: getConnectedOrgConfig + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique 24-hexadecimal digit string that identifies the connected organization configuration to return. + in: path + name: orgId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ConnectedOrgConfig" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Organization Configuration from One Federation + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getConnectedOrgConfig --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetConnectedOrgConfigApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + GetConnectedOrgConfigWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/getConnectedOrgConfig + patch: + description: |- + Updates one connected organization configuration from the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note** If the organization configuration has no associated identity provider, you can't use this resource to update role mappings or post authorization role grants. + + **Note**: The domainRestrictionEnabled field defaults to false if not provided in the request. + + **Note**: If the identityProviderId field is not provided, you will disconnect the organization and the identity provider. + + **Note**: Currently connected data access identity providers missing from the dataAccessIdentityProviderIds field will be disconnected. + operationId: updateConnectedOrgConfig + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique 24-hexadecimal digit string that identifies the connected organization configuration to update. + in: path + name: orgId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ConnectedOrgConfig" + description: The connected organization configuration that you want to update. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ConnectedOrgConfig" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Organization Configuration in One Federation + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateConnectedOrgConfig --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateConnectedOrgConfigApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + UpdateConnectedOrgConfigWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/updateConnectedOrgConfig + /api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings: + get: + description: Returns all role mappings from the specified organization in the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + operationId: listRoleMappings + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedRoleMapping" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Role Mappings from One Organization + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listRoleMappings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListRoleMappingsApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + ListRoleMappingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/listRoleMappings + post: + description: Adds one role mapping to the specified organization in the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + operationId: createRoleMapping + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AuthFederationRoleMapping" + description: The role mapping that you want to create. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AuthFederationRoleMapping" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Role Mapping in One Organization Configuration + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createRoleMapping --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateRoleMappingApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + CreateRoleMappingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/createRoleMapping + /api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings/{id}: + delete: + description: Removes one role mapping in the specified organization from the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + operationId: deleteRoleMapping + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique 24-hexadecimal digit string that identifies the role mapping that you want to remove. + in: path + name: id + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + - $ref: "#/components/parameters/orgId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: No Content + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Role Mapping from One Organization + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteRoleMapping --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteRoleMappingApiParams{} + httpResp, err := client.FederatedAuthenticationApi. + DeleteRoleMappingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings/{id}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings/{id}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/deleteRoleMapping + get: + description: Returns one role mapping from the specified organization in the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + operationId: getRoleMapping + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique 24-hexadecimal digit string that identifies the role mapping that you want to return. + in: path + name: id + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AuthFederationRoleMapping" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Role Mapping from One Organization + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getRoleMapping --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetRoleMappingApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + GetRoleMappingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings/{id}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings/{id}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/getRoleMapping + put: + description: Updates one role mapping in the specified organization in the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + operationId: updateRoleMapping + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique 24-hexadecimal digit string that identifies the role mapping that you want to update. + in: path + name: id + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AuthFederationRoleMapping" + description: The role mapping that you want to update. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AuthFederationRoleMapping" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Role Mapping in One Organization + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateRoleMapping --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateRoleMappingApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + UpdateRoleMappingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings/{id}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs/{orgId}/roleMappings/{id}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/updateRoleMapping + /api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders: + get: + description: Returns all identity providers with the provided protocol and type in the specified federation. If no protocol is specified, only SAML identity providers will be returned. If no idpType is specified, only WORKFORCE identity providers will be returned. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected organizations. + operationId: listIdentityProviders + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: The protocols of the target identity providers. + in: query + name: protocol + schema: + items: + default: SAML + type: string + type: array + - description: The types of the target identity providers. + in: query + name: idpType + schema: + items: + default: WORKFORCE + type: string + type: array + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedFederationIdentityProvider" + x-xgen-IPA-exception: + xgen-IPA-105-list-method-response-is-get-method-response: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Identity Providers in One Federation + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listIdentityProviders --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListIdentityProvidersApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + ListIdentityProvidersWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/listIdentityProviders + post: + description: |- + Creates one identity provider within the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected organizations. + + **Note**: This resource only supports the creation of OIDC identity providers. + operationId: createIdentityProvider + parameters: + - $ref: "#/components/parameters/federationSettingsId" + requestBody: + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/FederationOidcIdentityProviderUpdate" + description: The identity provider that you want to create. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/FederationOidcIdentityProvider" + x-xgen-version: 2023-11-15 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Identity Provider + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createIdentityProvider --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateIdentityProviderApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + CreateIdentityProviderWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/createIdentityProvider + /api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}: + delete: + description: |- + Deletes one identity provider in the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected organizations. + + **Note**: Requests to this resource will fail if the identity provider has any connected organizations. Before deleting an identity provider, disconnect all organizations and confirm that no organization in your account uses this identity provider. + externalDocs: + description: Manage Organization Mapping for Federated Authentication + url: https://www.mongodb.com/docs/atlas/security/manage-org-mapping/ + operationId: deleteIdentityProvider + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique 24-hexadecimal digit string that identifies the identity provider to connect. + in: path + name: identityProviderId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + type: string + responses: + "204": + content: + application/vnd.atlas.2023-11-15+json: + x-xgen-version: 2023-11-15 + description: No Response + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Identity Provider + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteIdentityProvider --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteIdentityProviderApiParams{} + httpResp, err := client.FederatedAuthenticationApi. + DeleteIdentityProviderWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/deleteIdentityProvider + get: + description: "Returns one identity provider in the specified federation by the identity provider's id. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected organizations. Deprecated versions: v2-{2023-01-01}" + operationId: getIdentityProvider + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique string that identifies the identity provider to connect. If using an API version before 11-15-2023, use the legacy 20-hexadecimal digit id. This id can be found within the Federation Management Console > Identity Providers tab by clicking the info icon in the IdP ID row of a configured identity provider. For all other versions, use the 24-hexadecimal digit id. + in: path + name: identityProviderId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + type: string + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/FederationIdentityProvider" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-11-15 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Identity Provider by ID + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getIdentityProvider --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetIdentityProviderApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + GetIdentityProviderWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/getIdentityProvider + patch: + description: |- + Updates one identity provider in the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected organizations. + + **Note**: Changing authorization types and/or updating authorization claims can prevent current users and/or groups from accessing the database. Deprecated versions: v2-{2023-01-01} + operationId: updateIdentityProvider + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique string that identifies the identity provider to connect. If using an API version before 11-15-2023, use the legacy 20-hexadecimal digit id. This id can be found within the Federation Management Console > Identity Providers tab by clicking the info icon in the IdP ID row of a configured identity provider. For all other versions, use the 24-hexadecimal digit id. + in: path + name: identityProviderId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + type: string + requestBody: + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/FederationIdentityProviderUpdate" + description: The identity provider that you want to update. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/FederationIdentityProvider" + x-xgen-version: 2023-11-15 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Identity Provider + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateIdentityProvider --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateIdentityProviderApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + UpdateIdentityProviderWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/updateIdentityProvider + /api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/jwks: + delete: + description: |- + Revokes the JWKS tokens from the requested OIDC identity provider. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected organizations. + + **Note**: Revoking your JWKS tokens immediately refreshes your IdP public keys from all your Atlas clusters, invalidating previously signed access tokens and logging out all users. You may need to restart your MongoDB clients. All organizations connected to the identity provider will be affected. + externalDocs: + description: Configure OIDC Authorization + url: https://www.mongodb.com/docs/atlas/security-oidc/#revoke-jwks + operationId: revokeJwksFromIdentityProvider + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - description: Unique 24-hexadecimal digit string that identifies the identity provider to connect. + in: path + name: identityProviderId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + type: string + responses: + "204": + content: + application/vnd.atlas.2023-11-15+json: + x-xgen-version: 2023-11-15 + description: No Response + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Revoke JWKS from One OIDC Identity Provider + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api revokeJwksFromIdentityProvider --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RevokeJwksFromIdentityProviderApiParams{} + httpResp, err := client.FederatedAuthenticationApi. + RevokeJwksFromIdentityProviderWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/jwks" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/jwks" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/revokeJwksFromIdentityProvider + /api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/metadata.xml: + get: + description: Returns the metadata of one identity provider in the specified federation. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in one of the connected organizations. + operationId: getIdentityProviderMetadata + parameters: + - $ref: "#/components/parameters/federationSettingsId" + - $ref: "#/components/parameters/identityProviderId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + type: string + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Metadata of One Identity Provider + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getIdentityProviderMetadata --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetIdentityProviderMetadataApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + GetIdentityProviderMetadataWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/metadata.xml?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/federationSettings/{federationSettingsId}/identityProviders/{identityProviderId}/metadata.xml?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/getIdentityProviderMetadata + /api/atlas/v2/groups: + get: + description: Returns details about all projects. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. To use this resource, the requesting Service Account or API Key must have the Organization Read Only role or higher. + operationId: listProjects + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedAtlasGroup" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Projects + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjects --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectsApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + ListProjectsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/listProjects + post: + description: Creates one project. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. To use this resource, the requesting Service Account or API Key must have the Read Write role. + operationId: createProject + parameters: + - description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud user to whom to grant the Project Owner role on the specified project. If you set this parameter, it overrides the default value of the oldest Organization Owner. + in: query + name: projectOwnerId + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/Group" + description: Creates one project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/Group" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createProject --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateProjectApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + CreateProjectWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProject + /api/atlas/v2/groups/{groupId}: + delete: + description: Removes the specified project. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. You can delete a project only if there are no Online Archives for the clusters in the project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deleteProject + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteProject --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteProjectApiParams{} + httpResp, err := client.ProjectsApi. + DeleteProjectWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/deleteProject + get: + description: Returns details about the specified project. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getProject + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/Group" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-response-has-no-input-fields: API predates IPA validation + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProject --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + GetProjectWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/getProject + patch: + description: Updates the human-readable label that identifies the specified project, or the tags associated with the project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: updateProject + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupUpdate" + description: Project to update. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/Group" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateProject --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateProjectApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + UpdateProjectWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/updateProject + /api/atlas/v2/groups/{groupId}/access: + post: + deprecated: true + description: Adds one MongoDB Cloud user to the specified project. If the MongoDB Cloud user is not a member of the project's organization, then the user must accept their invitation to the organization to access information within the specified project. If the MongoDB Cloud User is already a member of the project's organization, then they will be added to the project immediately and an invitation will not be returned by this resource. To use this resource, the requesting Service Account or API Key must have the Group User Admin role. + operationId: addUserToProject + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/GroupInvitationRequest" + description: Adds one MongoDB Cloud user to the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/OrganizationInvitation" + x-xgen-version: 2023-02-01 + description: OK + "204": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: No Content + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One MongoDB Cloud User to One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api addUserToProject --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AddUserToProjectApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + AddUserToProjectWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/access" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/access" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/addUserToProject + /api/atlas/v2/groups/{groupId}/accessList: + get: + description: Returns all access list entries from the specified project's IP access list. Each entry in the project's IP access list contains either one IP address or one CIDR-notated block of IP addresses. MongoDB Cloud only allows client connections to the cluster from entries in the project's IP access list. To use this resource, the requesting Service Account or API Key must have the Project Read Only or Project Charts Admin roles. This resource replaces the whitelist resource. MongoDB Cloud removed whitelists in July 2021. Update your applications to use this new resource. The `/groups/{GROUP-ID}/accessList` endpoint manages the database IP access list. This endpoint is distinct from the `orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist` endpoint, which manages the access list for MongoDB Cloud organizations. + externalDocs: + description: IP access list + url: https://docs.atlas.mongodb.com/security/ip-access-list/#std-label-access-list + operationId: listProjectIpAccessLists + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedNetworkAccess" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Project IP Access List Entries + tags: + - Project IP Access List + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjectIpAccessLists --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectIpAccessListsApiParams{} + sdkResp, httpResp, err := client.ProjectIPAccessListApi. + ListProjectIpAccessListsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList?pretty=true" + x-xgen-changelog: + 2025-05-08: Corrects an issue where the endpoint would include Atlas internal entries. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Project-IP-Access-List/operation/listProjectIpAccessLists + post: + description: Adds one or more access list entries to the specified project. MongoDB Cloud only allows client connections to the cluster from entries in the project's IP access list. Write each entry as either one IP address or one CIDR-notated block of IP addresses. To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Charts Admin roles. This resource replaces the whitelist resource. MongoDB Cloud removed whitelists in July 2021. Update your applications to use this new resource. The `/groups/{GROUP-ID}/accessList` endpoint manages the database IP access list. This endpoint is distinct from the `orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist` endpoint, which manages the access list for MongoDB Cloud organizations. This endpoint doesn't support concurrent `POST` requests. You must submit multiple `POST` requests synchronously. + externalDocs: + description: IP access list + url: https://docs.atlas.mongodb.com/security/ip-access-list/#std-label-access-list + operationId: createProjectIpAccessList + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/NetworkPermissionEntry" + type: array + description: One or more access list entries to add to the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedNetworkAccess" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add Entries to Project IP Access List + tags: + - Project IP Access List + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createProjectIpAccessList --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateProjectIpAccessListApiParams{} + sdkResp, httpResp, err := client.ProjectIPAccessListApi. + CreateProjectIpAccessListWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Project-IP-Access-List/operation/createProjectIpAccessList + /api/atlas/v2/groups/{groupId}/accessList/{entryValue}: + delete: + description: Removes one access list entry from the specified project's IP access list. Each entry in the project's IP access list contains one IP address, one CIDR-notated block of IP addresses, or one AWS Security Group ID. MongoDB Cloud only allows client connections to the cluster from entries in the project's IP access list. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This resource replaces the whitelist resource. MongoDB Cloud removed whitelists in July 2021. Update your applications to use this new resource. The `/groups/{GROUP-ID}/accessList` endpoint manages the database IP access list. This endpoint is distinct from the `orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist` endpoint, which manages the access list for MongoDB Cloud organizations. + externalDocs: + description: IP access list + url: https://docs.atlas.mongodb.com/security/ip-access-list/#std-label-access-list + operationId: deleteProjectIpAccessList + parameters: + - $ref: "#/components/parameters/groupId" + - description: |- + Access list entry that you want to remove from the project's IP access list. This value can use one of the following: one AWS security group ID, one IP address, or one CIDR block of addresses. For CIDR blocks that use a subnet mask, replace the forward slash (`/`) with its URL-encoded value (`%2F`). When you remove an entry from the IP access list, existing connections from the removed address or addresses may remain open for a variable amount of time. The amount of time it takes MongoDB Cloud to close the connection depends upon several factors, including: + + - how your application established the connection, + - how MongoDB Cloud or the driver using the address behaves, and + - which protocol (like TCP or UDP) the connection uses. + in: path + name: entryValue + required: true + schema: + example: "IPv4: 192.0.2.0%2F24 or IPv6: 2001:db8:85a3:8d3:1319:8a2e:370:7348 or IPv4 CIDR: 198.51.100.0%2f24 or IPv6 CIDR: 2001:db8::%2f58 or AWS SG: sg-903004f8" + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})|(sg\-[a-f0-9]{8})?$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Entry from One Project IP Access List + tags: + - Project IP Access List + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteProjectIpAccessList --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteProjectIpAccessListApiParams{} + httpResp, err := client.ProjectIPAccessListApi. + DeleteProjectIpAccessListWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList/{entryValue}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList/{entryValue}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Project-IP-Access-List/operation/deleteProjectIpAccessList + get: + description: Returns one access list entry from the specified project's IP access list. Each entry in the project's IP access list contains either one IP address or one CIDR-notated block of IP addresses. MongoDB Cloud only allows client connections to the cluster from entries in the project's IP access list. To use this resource, the requesting Service Account or API Key must have the Project Read Only or Project Charts Admin roles. This resource replaces the whitelist resource. MongoDB Cloud removed whitelists in July 2021. Update your applications to use this new resource. This endpoint (`/groups/{GROUP-ID}/accessList`) manages the Project IP Access List. It doesn't manage the access list for MongoDB Cloud organizations. TheProgrammatic API Keys endpoint (`/orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist`) manages those access lists. + externalDocs: + description: IP access list + url: https://docs.atlas.mongodb.com/security/ip-access-list/#std-label-access-list + operationId: getProjectIpList + parameters: + - $ref: "#/components/parameters/groupId" + - description: "Access list entry that you want to return from the project's IP access list. This value can use one of the following: one AWS security group ID, one IP address, or one CIDR block of addresses. For CIDR blocks that use a subnet mask, replace the forward slash (`/`) with its URL-encoded value (`%2F`)." + in: path + name: entryValue + required: true + schema: + example: "IPv4: 192.0.2.0%2F24 or IPv6: 2001:db8:85a3:8d3:1319:8a2e:370:7348 or IPv4 CIDR: 198.51.100.0%2f24 or IPv6 CIDR: 2001:db8::%2f58 or AWS SG: sg-903004f8" + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})|(sg\-[a-f0-9]{8})?$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/NetworkPermissionEntry" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Project IP Access List Entry + tags: + - Project IP Access List + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectIpList --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectIpListApiParams{} + sdkResp, httpResp, err := client.ProjectIPAccessListApi. + GetProjectIpListWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList/{entryValue}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList/{entryValue}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Project-IP-Access-List/operation/getProjectIpList + /api/atlas/v2/groups/{groupId}/accessList/{entryValue}/status: + get: + description: Returns the status of one project IP access list entry. This resource checks if the provided project IP access list entry applies to all cloud providers serving clusters from the specified project. + operationId: getProjectIpAccessListStatus + parameters: + - $ref: "#/components/parameters/groupId" + - description: Network address or cloud provider security construct that identifies which project access list entry to be verified. + in: path + name: entryValue + required: true + schema: + example: "IPv4: 192.0.2.0%2F24 or IPv6: 2001:db8:85a3:8d3:1319:8a2e:370:7348 or IPv4 CIDR: 198.51.100.0%2f24 or IPv6 CIDR: 2001:db8::%2f58 or AWS SG: sg-903004f8" + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})|(sg\-[a-f0-9]{8})?$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/NetworkPermissionEntryStatus" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Status of One Project IP Access List Entry + tags: + - Project IP Access List + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectIpAccessListStatus --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectIpAccessListStatusApiParams{} + sdkResp, httpResp, err := client.ProjectIPAccessListApi. + GetProjectIpAccessListStatusWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList/{entryValue}/status?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/accessList/{entryValue}/status?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Project-IP-Access-List/operation/getProjectIpAccessListStatus + /api/atlas/v2/groups/{groupId}/alertConfigs: + get: + description: |- + Returns all alert configurations for one project. These alert configurations apply to any component in the project. Alert configurations define the triggers and notification methods for alerts. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This resource remains under revision and may change. + operationId: listAlertConfigurations + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedAlertConfig" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Alert Configurations in One Project + tags: + - Alert Configurations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAlertConfigurations --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAlertConfigurationsApiParams{} + sdkResp, httpResp, err := client.AlertConfigurationsApi. + ListAlertConfigurationsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/listAlertConfigurations + post: + description: |- + Creates one alert configuration for the specified project. Alert configurations define the triggers and notification methods for alerts. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. + + This resource remains under revision and may change. + operationId: createAlertConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupAlertsConfig" + description: Creates one alert configuration for the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupAlertsConfig" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Alert Configuration in One Project + tags: + - Alert Configurations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createAlertConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateAlertConfigurationApiParams{} + sdkResp, httpResp, err := client.AlertConfigurationsApi. + CreateAlertConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/createAlertConfiguration + /api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}: + delete: + description: |- + Removes one alert configuration from the specified project. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. Use the Return All Alert Configurations for One Project endpoint to retrieve all alert configurations to which the authenticated user has access. + + This resource remains under revision and may change. + externalDocs: + description: Return All Alert Configurations for One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/listAlertConfigurations + operationId: deleteAlertConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the alert configuration. + in: path + name: alertConfigId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: No Content + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Alert Configuration from One Project + tags: + - Alert Configurations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteAlertConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteAlertConfigurationApiParams{} + httpResp, err := client.AlertConfigurationsApi. + DeleteAlertConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/deleteAlertConfiguration + get: + description: |- + Returns the specified alert configuration from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Use the Return All Alert Configurations for One Project endpoint to retrieve all alert configurations to which the authenticated user has access. + + This resource remains under revision and may change. + externalDocs: + description: Return All Alert Configurations for One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/listAlertConfigurations + operationId: getAlertConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the alert configuration. + in: path + name: alertConfigId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupAlertsConfig" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Alert Configuration from One Project + tags: + - Alert Configurations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAlertConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAlertConfigurationApiParams{} + sdkResp, httpResp, err := client.AlertConfigurationsApi. + GetAlertConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/getAlertConfiguration + patch: + description: |- + Enables or disables the specified alert configuration in the specified project. The resource enables the specified alert configuration if currently enabled. The resource disables the specified alert configuration if currently disabled. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. + + **NOTE**: This endpoint updates only the enabled/disabled state for the alert configuration. To update more than just this configuration, see Update One Alert Configuration. + + This resource remains under revision and may change. + externalDocs: + description: Update One Alert Configuration + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/updateAlertConfiguration + operationId: toggleAlertConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the alert configuration that triggered this alert. + in: path + name: alertConfigId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AlertsToggle" + description: Enables or disables the specified alert configuration in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupAlertsConfig" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Toggle State of One Alert Configuration in One Project + tags: + - Alert Configurations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api toggleAlertConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ToggleAlertConfigurationApiParams{} + sdkResp, httpResp, err := client.AlertConfigurationsApi. + ToggleAlertConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/toggleAlertConfiguration + put: + description: |- + Updates one alert configuration in the specified project. Alert configurations define the triggers and notification methods for alerts. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. + + **NOTE**: To enable or disable the alert configuration, see Toggle One State of One Alert Configuration in One Project. + + This resource remains under revision and may change. + externalDocs: + description: Toggle One State of One Alert Configuration in One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/toggleAlertConfiguration + operationId: updateAlertConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the alert configuration. + in: path + name: alertConfigId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupAlertsConfig" + description: Updates one alert configuration in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupAlertsConfig" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Alert Configuration in One Project + tags: + - Alert Configurations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateAlertConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateAlertConfigurationApiParams{} + sdkResp, httpResp, err := client.AlertConfigurationsApi. + UpdateAlertConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/updateAlertConfiguration + /api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}/alerts: + get: + description: |- + Returns all open alerts that the specified alert configuration triggers. These alert configurations apply to the specified project only. Alert configurations define the triggers and notification methods for alerts. Open alerts have been triggered but remain unacknowledged. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Use the Return All Alert Configurations for One Project endpoint to retrieve all alert configurations to which the authenticated user has access. + + This resource remains under revision and may change. + externalDocs: + description: Return All Alert Configurations for One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/listAlertConfigurations + operationId: listAlertsByAlertConfigurationId + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Unique 24-hexadecimal digit string that identifies the alert configuration. + in: path + name: alertConfigId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedAlert" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + xgen-IPA-104-get-method-returns-single-resource: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Open Alerts for One Alert Configuration + tags: + - Alerts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAlertsByAlertConfigurationId --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAlertsByAlertConfigurationIdApiParams{} + sdkResp, httpResp, err := client.AlertsApi. + ListAlertsByAlertConfigurationIdWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}/alerts?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alertConfigs/{alertConfigId}/alerts?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alerts/operation/listAlertsByAlertConfigurationId + /api/atlas/v2/groups/{groupId}/alerts: + get: + description: |- + Returns all alerts. These alerts apply to all components in one project. You receive an alert when a monitored component meets or exceeds a value you set. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This resource remains under revision and may change. + operationId: listAlerts + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Status of the alerts to return. Omit to return all alerts in all statuses. + in: query + name: status + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedAlert" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Alerts from One Project + tags: + - Alerts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAlerts --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAlertsApiParams{} + sdkResp, httpResp, err := client.AlertsApi. + ListAlertsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alerts/operation/listAlerts + /api/atlas/v2/groups/{groupId}/alerts/{alertId}: + get: + description: |- + Returns one alert. This alert applies to any component in one project. You receive an alert when a monitored component meets or exceeds a value you set. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Use the Return All Alerts from One Project endpoint to retrieve all alerts to which the authenticated user has access. + + This resource remains under revision and may change. + externalDocs: + description: Return All Alerts from One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alerts/operation/listAlerts + operationId: getAlert + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the alert. + in: path + name: alertId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AlertViewForNdsGroup" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Alert from One Project + tags: + - Alerts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAlert --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAlertApiParams{} + sdkResp, httpResp, err := client.AlertsApi. + GetAlertWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts/{alertId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts/{alertId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alerts/operation/getAlert + patch: + description: |- + Confirms receipt of one existing alert. This alert applies to any component in one project. Acknowledging an alert prevents successive notifications. You receive an alert when a monitored component meets or exceeds a value you set until you acknowledge the alert. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. Use the Return All Alerts from One Project endpoint to retrieve all alerts to which the authenticated user has access. + + This resource remains under revision and may change. Deprecated versions: v2-{2023-01-01} + externalDocs: + description: Return All Alerts from One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alerts/operation/listAlerts + operationId: acknowledgeAlert + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the alert. + in: path + name: alertId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/AcknowledgeAlert" + description: Acknowledges or unacknowledges one alert. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/AlertViewForNdsGroup" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Acknowledge One Alert from One Project + tags: + - Alerts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api acknowledgeAlert --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AcknowledgeAlertApiParams{} + sdkResp, httpResp, err := client.AlertsApi. + AcknowledgeAlertWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts/{alertId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts/{alertId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alerts/operation/acknowledgeAlert + /api/atlas/v2/groups/{groupId}/alerts/{alertId}/alertConfigs: + get: + description: |- + Returns all alert configurations set for the specified alert. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Use the Return All Alerts from One Project endpoint to retrieve all alerts to which the authenticated user has access. + + This resource remains under revision and may change. + externalDocs: + description: Return All Alerts from One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alerts/operation/listAlerts + operationId: listAlertConfigurationsByAlertId + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Unique 24-hexadecimal digit string that identifies the alert. + in: path + name: alertId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedAlertConfig" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + xgen-IPA-104-get-method-returns-single-resource: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Alert Configurations Set for One Alert + tags: + - Alert Configurations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAlertConfigurationsByAlertId --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAlertConfigurationsByAlertIdApiParams{} + sdkResp, httpResp, err := client.AlertConfigurationsApi. + ListAlertConfigurationsByAlertIdWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts/{alertId}/alertConfigs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/alerts/{alertId}/alertConfigs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/listAlertConfigurationsByAlertId + /api/atlas/v2/groups/{groupId}/apiKeys: + get: + description: Returns all organization API keys that you assigned to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + externalDocs: + description: Programmatic API Keys + url: https://docs.atlas.mongodb.com/configure-api-access/#std-label-atlas-prog-api-key + operationId: listProjectApiKeys + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiApiUser" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Organization API Keys Assigned to One Project + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjectApiKeys --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectApiKeysApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + ListProjectApiKeysWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/listProjectApiKeys + post: + description: Creates and assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can use the organization API key to access the resources. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: createProjectApiKey + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CreateAtlasProjectApiKey" + description: Organization API key to be created and assigned to the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiKeyUserDetails" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create and Assign One Organization API Key to One Project + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createProjectApiKey --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateProjectApiKeyApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + CreateProjectApiKeyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createProjectApiKey + /api/atlas/v2/groups/{groupId}/apiKeys/{apiUserId}: + delete: + description: Removes one organization API key from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + externalDocs: + description: Programmatic API Keys + url: https://docs.atlas.mongodb.com/configure-api-access/#std-label-atlas-prog-api-key + operationId: removeProjectApiKey + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies this organization API key that you want to unassign from one project. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Unassign One Organization API Key from One Project + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api removeProjectApiKey --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RemoveProjectApiKeyApiParams{} + httpResp, err := client.ProgrammaticAPIKeysApi. + RemoveProjectApiKeyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys/{apiUserId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys/{apiUserId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/removeProjectApiKey + patch: + description: Updates the roles of the organization API key that you specify for the project that you specify. You must specify at least one valid role for the project. The application removes any roles that you do not include in this request if they were previously set in the organization API key that you specify for the project. + operationId: updateApiKeyRoles + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/includeCount" + - description: Unique 24-hexadecimal digit string that identifies this organization API key that you want to unassign from one project. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UpdateAtlasProjectApiKey" + description: Organization API Key to be updated. This request requires a minimum of one of the two body parameters. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiKeyUserDetails" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Organization API Key Roles for One Project + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateApiKeyRoles --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateApiKeyRolesApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + UpdateApiKeyRolesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys/{apiUserId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys/{apiUserId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/updateApiKeyRoles + post: + description: Assigns the specified organization API key to the specified project. Users with the Project Owner role in the project associated with the API key can then use the organization API key to access the resources. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: addProjectApiKey + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies this organization API key that you want to assign to one project. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/UserAccessRoleAssignment" + type: array + description: Organization API key to be assigned to the specified project. + required: true + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Assign One Organization API Key to One Project + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api addProjectApiKey --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AddProjectApiKeyApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + AddProjectApiKeyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys/{apiUserId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/apiKeys/{apiUserId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/addProjectApiKey + /api/atlas/v2/groups/{groupId}/auditLog: + get: + description: Returns the auditing configuration for the specified project. The auditing configuration defines the events that MongoDB Cloud records in the audit log. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature isn't available for `M0`, `M2`, `M5`, or serverless clusters. + operationId: getAuditingConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AuditLog" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Auditing Configuration for One Project + tags: + - Auditing + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAuditingConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAuditingConfigurationApiParams{} + sdkResp, httpResp, err := client.AuditingApi. + GetAuditingConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/auditLog?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/auditLog?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Auditing/operation/getAuditingConfiguration + patch: + description: Updates the auditing configuration for the specified project. The auditing configuration defines the events that MongoDB Cloud records in the audit log. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature isn't available for `M0`, `M2`, `M5`, or serverless clusters. + operationId: updateAuditingConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AuditLog" + description: Updated auditing configuration for the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AuditLog" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Auditing Configuration for One Project + tags: + - Auditing + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateAuditingConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateAuditingConfigurationApiParams{} + sdkResp, httpResp, err := client.AuditingApi. + UpdateAuditingConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/auditLog" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/auditLog" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Auditing/operation/updateAuditingConfiguration + /api/atlas/v2/groups/{groupId}/awsCustomDNS: + get: + description: Returns the custom DNS configuration for AWS clusters in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getAwsCustomDns + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AWSCustomDNSEnabled" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Custom DNS Configuration for Atlas Clusters on AWS + tags: + - AWS Clusters DNS + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAwsCustomDns --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAwsCustomDnsApiParams{} + sdkResp, httpResp, err := client.AWSClustersDNSApi. + GetAwsCustomDnsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/awsCustomDNS?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/awsCustomDNS?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/AWS-Clusters-DNS/operation/getAwsCustomDns + patch: + description: Enables or disables the custom DNS configuration for AWS clusters in the specified project. Enable custom DNS if you use AWS VPC peering and use your own DNS servers. To use this resource, the requesting Service Account or API Key must have the Project Atlas Admin role. + operationId: toggleAwsCustomDns + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AWSCustomDNSEnabled" + description: Enables or disables the custom DNS configuration for AWS clusters in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AWSCustomDNSEnabled" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update State of One Custom DNS Configuration for Atlas Clusters on AWS + tags: + - AWS Clusters DNS + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api toggleAwsCustomDns --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ToggleAwsCustomDnsApiParams{} + sdkResp, httpResp, err := client.AWSClustersDNSApi. + ToggleAwsCustomDnsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/awsCustomDNS" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/awsCustomDNS" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/AWS-Clusters-DNS/operation/toggleAwsCustomDns + /api/atlas/v2/groups/{groupId}/backup/exportBuckets: + get: + description: "Returns all Export Buckets associated with the specified Project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Deprecated versions: v2-{2023-01-01}" + operationId: listExportBuckets + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/PaginatedBackupSnapshotExportBuckets" + x-xgen-version: 2024-05-30 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Snapshot Export Buckets + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listExportBuckets --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListExportBucketsApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + ListExportBucketsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backup/exportBuckets?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backup/exportBuckets?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/listExportBuckets + post: + description: "Creates a Snapshot Export Bucket for an AWS S3 Bucket, Azure Blob Storage Container, or Google Cloud Storage Bucket. Once created, an snapshots can be exported to the Export Bucket and its referenced AWS S3 Bucket, Azure Blob Storage Container, or Google Cloud Storage Bucket. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Deprecated versions: v2-{2023-01-01}" + operationId: createExportBucket + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + examples: + AWS: + description: AWS + value: + bucketName: export-bucket + cloudProvider: AWS + iamRoleId: 668c5f0ed436263134491592 + Azure: + description: Azure + value: + bucketName: examplecontainer + cloudProvider: AZURE + roleId: 668c5f0ed436263134491592 + serviceUrl: https://examplestorageaccount.blob.core.windows.net/examplecontainer + GCP: + description: GCP + value: + bucketName: export-bucket + cloudProvider: GCP + roleId: 668c5f0ed436263134491592 + schema: + $ref: "#/components/schemas/DiskBackupSnapshotExportBucketRequest" + x-xgen-version: 2024-05-30 + description: Specifies the role and AWS S3 Bucket, Azure Blob Storage Container, or Google Cloud Storage Bucket that the Export Bucket should reference. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + examples: + AWS: + description: AWS + value: + _id: 32b6e34b3d91647abb20e7b8 + bucketName: export-bucket + cloudProvider: AWS + iamRoleId: 668c5f0ed436263134491592 + links: + - href: https://cloud.mongodb.com/api/atlas + rel: self + Azure: + description: Azure + value: + _id: 32b6e34b3d91647abb20e7b8 + bucketName: examplecontainer + cloudProvider: AZURE + links: + - href: https://cloud.mongodb.com/api/atlas + rel: self + roleId: 668c5f0ed436263134491592 + serviceUrl: https://examplestorageaccount.blob.core.windows.net/examplecontainer + tenantId: 4297fc77-1592-4de8-a6d5-a8c32401df87 + GCP: + description: GCP + value: + _id: 32b6e34b3d91647abb20e7b8 + bucketName: export-bucket + cloudProvider: GCP + links: + - href: https://cloud.mongodb.com/api/atlas + rel: self + roleId: 668c5f0ed436263134491592 + schema: + $ref: "#/components/schemas/DiskBackupSnapshotExportBucketResponse" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Snapshot Export Bucket + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createExportBucket --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateExportBucketApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + CreateExportBucketWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backup/exportBuckets" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backup/exportBuckets" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/createExportBucket + /api/atlas/v2/groups/{groupId}/backup/exportBuckets/{exportBucketId}: + delete: + description: Deletes an Export Bucket. Auto export must be disabled on all clusters in this Project exporting to this Export Bucket before revoking access. To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role. + operationId: deleteExportBucket + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal character string that identifies the Export Bucket. + in: path + name: exportBucketId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Snapshot Export Bucket + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteExportBucket --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteExportBucketApiParams{} + httpResp, err := client.CloudBackupsApi. + DeleteExportBucketWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backup/exportBuckets/{exportBucketId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backup/exportBuckets/{exportBucketId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/deleteExportBucket + get: + description: "Returns one Export Bucket associated with the specified Project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Deprecated versions: v2-{2023-01-01}" + operationId: getExportBucket + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal character string that identifies the Export Bucket. + in: path + name: exportBucketId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + examples: + AWS: + description: AWS + value: + _id: 32b6e34b3d91647abb20e7b8 + bucketName: export-bucket + cloudProvider: AWS + iamRoleId: 668c5f0ed436263134491592 + links: + - href: https://cloud.mongodb.com/api/atlas + rel: self + Azure: + description: Azure + value: + _id: 32b6e34b3d91647abb20e7b8 + bucketName: examplecontainer + cloudProvider: AZURE + links: + - href: https://cloud.mongodb.com/api/atlas + rel: self + roleId: 668c5f0ed436263134491592 + serviceUrl: https://examplestorageaccount.blob.core.windows.net/examplecontainer + tenantId: 4297fc77-1592-4de8-a6d5-a8c32401df87 + GCP: + description: GCP + value: + _id: 32b6e34b3d91647abb20e7b8 + bucketName: export-bucket + cloudProvider: GCP + links: + - href: https://cloud.mongodb.com/api/atlas + rel: self + roleId: 668c5f0ed436263134491592 + schema: + $ref: "#/components/schemas/DiskBackupSnapshotExportBucketResponse" + x-xgen-version: 2024-05-30 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Snapshot Export Bucket + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getExportBucket --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetExportBucketApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + GetExportBucketWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backup/exportBuckets/{exportBucketId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backup/exportBuckets/{exportBucketId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/getExportBucket + /api/atlas/v2/groups/{groupId}/backupCompliancePolicy: + delete: + description: Disables the Backup Compliance Policy settings with the specified project. As a prerequisite, a support ticket needs to be file first, instructions in https://www.mongodb.com/docs/atlas/backup/cloud-backup/backup-compliance-policy/. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: disableDataProtectionSettings + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2024-11-13+json: + x-xgen-version: 2024-11-13 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Disable Backup Compliance Policy Settings + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api disableDataProtectionSettings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DisableDataProtectionSettingsApiParams{} + httpResp, err := client.CloudBackupsApi. + DisableDataProtectionSettingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/disableDataProtectionSettings + get: + description: "Returns the Backup Compliance Policy settings with the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Deprecated versions: v2-{2023-01-01}" + operationId: getDataProtectionSettings + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-10-01+json: + schema: + $ref: "#/components/schemas/DataProtectionSettings20231001" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-10-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Backup Compliance Policy Settings + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getDataProtectionSettings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetDataProtectionSettingsApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + GetDataProtectionSettingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/getDataProtectionSettings + put: + description: "Updates the Backup Compliance Policy settings for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Deprecated versions: v2-{2023-01-01}" + operationId: updateDataProtectionSettings + parameters: + - $ref: "#/components/parameters/groupId" + - description: Flag that indicates whether to overwrite non complying backup policies with the new data protection settings or not. + in: query + name: overwriteBackupPolicies + schema: + default: true + type: boolean + requestBody: + content: + application/vnd.atlas.2023-10-01+json: + schema: + $ref: "#/components/schemas/DataProtectionSettings20231001" + x-xgen-version: 2023-10-01 + description: The new Backup Compliance Policy settings. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-10-01+json: + schema: + $ref: "#/components/schemas/DataProtectionSettings20231001" + x-xgen-version: 2023-10-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Backup Compliance Policy Settings + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateDataProtectionSettings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateDataProtectionSettingsApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + UpdateDataProtectionSettingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/backupCompliancePolicy" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/updateDataProtectionSettings + /api/atlas/v2/groups/{groupId}/cloudProviderAccess: + get: + description: Returns all cloud provider access roles with access to the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: listCloudProviderAccessRoles + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderAccessRoles" + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Cloud Provider Access Roles + tags: + - Cloud Provider Access + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listCloudProviderAccessRoles --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListCloudProviderAccessRolesApiParams{} + sdkResp, httpResp, err := client.CloudProviderAccessApi. + ListCloudProviderAccessRolesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Provider-Access/operation/listCloudProviderAccessRoles + post: + description: Creates one access role for the specified cloud provider. Some MongoDB Cloud features use these cloud provider access roles for authentication. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + externalDocs: + description: Set Up Access to Cloud Providers + url: https://www.mongodb.com/docs/atlas/security/cloud-provider-access/ + operationId: createCloudProviderAccessRole + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderAccessRoleRequest" + description: Creates one role for the specified cloud provider. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderAccessRole" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Cloud Provider Access Role + tags: + - Cloud Provider Access + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createCloudProviderAccessRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateCloudProviderAccessRoleApiParams{} + sdkResp, httpResp, err := client.CloudProviderAccessApi. + CreateCloudProviderAccessRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Provider-Access/operation/createCloudProviderAccessRole + /api/atlas/v2/groups/{groupId}/cloudProviderAccess/{cloudProvider}/{roleId}: + delete: + description: Revokes access to the specified project for the specified access role. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deauthorizeCloudProviderAccessRole + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cloud provider of the role to deauthorize. + in: path + name: cloudProvider + required: true + schema: + type: string + - description: Unique 24-hexadecimal digit string that identifies the role. + in: path + name: roleId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: No Content + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Deauthorize One Cloud Provider Access Role + tags: + - Cloud Provider Access + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deauthorizeCloudProviderAccessRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeauthorizeCloudProviderAccessRoleApiParams{} + httpResp, err := client.CloudProviderAccessApi. + DeauthorizeCloudProviderAccessRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess/{cloudProvider}/{roleId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess/{cloudProvider}/{roleId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Provider-Access/operation/deauthorizeCloudProviderAccessRole + /api/atlas/v2/groups/{groupId}/cloudProviderAccess/{roleId}: + get: + description: Returns the access role with the specified id and with access to the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: getCloudProviderAccessRole + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the role. + in: path + name: roleId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderAccessRole" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Cloud Provider Access Role + tags: + - Cloud Provider Access + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getCloudProviderAccessRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetCloudProviderAccessRoleApiParams{} + sdkResp, httpResp, err := client.CloudProviderAccessApi. + GetCloudProviderAccessRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess/{roleId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess/{roleId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Provider-Access/operation/getCloudProviderAccessRole + patch: + description: Grants access to the specified project for the specified access role. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This API endpoint is one step in a procedure to create unified access for MongoDB Cloud services. This is not required for GCP service account access. + externalDocs: + description: Set Up Access to Cloud Providers + url: https://www.mongodb.com/docs/atlas/security/cloud-provider-access/ + operationId: authorizeCloudProviderAccessRole + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the role. + in: path + name: roleId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderAccessRoleRequestUpdate" + description: Grants access to the specified project for the specified access role. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderAccessRole" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Authorize One Cloud Provider Access Role + tags: + - Cloud Provider Access + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api authorizeCloudProviderAccessRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AuthorizeCloudProviderAccessRoleApiParams{} + sdkResp, httpResp, err := client.CloudProviderAccessApi. + AuthorizeCloudProviderAccessRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess/{roleId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/cloudProviderAccess/{roleId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Provider-Access/operation/authorizeCloudProviderAccessRole + /api/atlas/v2/groups/{groupId}/clusters: + get: + description: |- + Returns the details for all clusters in the specific project to which you have access. Clusters contain a group of hosts that maintain the same data set. The response includes clusters with asymmetrically-sized shards. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. This feature is not available for serverless clusters. + + This endpoint can also be used on Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) endpoint or former M2/M5 clusters that have been migrated to Flex clusters until January 2026. Please use the listFlexClusters endpoint for Flex clusters instead. Deprecated versions: v2-{2023-02-01}, v2-{2023-01-01} + externalDocs: + description: listFlexClusters + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/listFlexClusters + operationId: listClusters + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Flag that indicates whether to return Clusters with retain backups. + in: query + name: includeDeletedWithRetainedBackups + schema: + default: false + type: boolean + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedClusterDescription20240805" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Clusters in One Project + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listClusters --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListClustersApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + ListClustersWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/listClusters + post: + description: |- + Creates one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. This resource can create clusters with asymmetrically-sized shards. Each project supports up to 25 database deployments. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature is not available for serverless clusters. + + Please note that using an instanceSize of M2 or M5 will create a Flex cluster instead. Support for the instanceSize of M2 or M5 will be discontinued in January 2026. We recommend using the createFlexCluster API for such configurations moving forward. Deprecated versions: v2-{2024-08-05}, v2-{2023-02-01}, v2-{2023-01-01} + externalDocs: + description: createFlexCluster + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/createFlexCluster + operationId: createCluster + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-10-23+json: + examples: + Cluster: + description: Cluster + value: + clusterType: SHARDED + name: myCluster + replicationSpecs: + - regionConfigs: + - analyticsAutoScaling: + autoIndexing: + enabled: false + compute: + enabled: true + maxInstanceSize: M40 + minInstanceSize: M30 + scaleDownEnabled: true + diskGB: + enabled: true + analyticsSpecs: + diskSizeGB: 10 + instanceSize: M40 + nodeCount: 0 + autoScaling: + autoIndexing: + enabled: false + compute: + enabled: true + maxInstanceSize: M60 + minInstanceSize: M30 + scaleDownEnabled: true + diskGB: + enabled: true + electableSpecs: + diskSizeGB: 10 + instanceSize: M60 + nodeCount: 3 + priority: 7 + providerName: AWS + readOnlySpecs: + diskSizeGB: 10 + instanceSize: M60 + nodeCount: 0 + regionName: US_EAST_1 + zoneName: Zone 1 + - regionConfigs: + - analyticsAutoScaling: + autoIndexing: + enabled: false + compute: + enabled: true + maxInstanceSize: M40 + minInstanceSize: M30 + scaleDownEnabled: true + diskGB: + enabled: true + analyticsSpecs: + diskSizeGB: 10 + instanceSize: M30 + nodeCount: 0 + autoScaling: + autoIndexing: + enabled: false + compute: + enabled: true + maxInstanceSize: M60 + minInstanceSize: M30 + scaleDownEnabled: true + diskGB: + enabled: true + electableSpecs: + diskSizeGB: 10 + instanceSize: M40 + nodeCount: 3 + priority: 7 + providerName: AWS + readOnlySpecs: + diskSizeGB: 10 + instanceSize: M40 + nodeCount: 0 + regionName: US_EAST_1 + zoneName: Zone 1 + schema: + $ref: "#/components/schemas/ClusterDescription20240805" + x-xgen-version: 2024-10-23 + description: Cluster to create in this project. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-10-23+json: + schema: + $ref: "#/components/schemas/ClusterDescription20240805" + x-xgen-version: 2024-10-23 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Cluster in One Project + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateClusterApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + CreateClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}: + delete: + description: |- + Removes one cluster from the specified project. The cluster must have termination protection disabled in order to be deleted. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature is not available for serverless clusters. + + This endpoint can also be used on Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) endpoint or former M2/M5 clusters that have been migrated to Flex clusters until January 2026. Please use the deleteFlexCluster endpoint for Flex clusters instead. Deprecated versions: v2-{2023-01-01} + externalDocs: + description: deleteFlexCluster + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/deleteFlexCluster + operationId: deleteCluster + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Flag that indicates whether to retain backup snapshots for the deleted dedicated cluster. + in: query + name: retainBackups + schema: + type: boolean + responses: + "202": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: Accepted + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Cluster from One Project + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteClusterApiParams{} + httpResp, err := client.ClustersApi. + DeleteClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/deleteCluster + get: + description: |- + Returns the details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. The response includes clusters with asymmetrically-sized shards. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. This feature is not available for serverless clusters. + + This endpoint can also be used on Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) endpoint or former M2/M5 clusters that have been migrated to Flex clusters until January 2026. Please use the getFlexCluster endpoint for Flex clusters instead. Deprecated versions: v2-{2023-02-01}, v2-{2023-01-01} + externalDocs: + description: getFlexCluster + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/getFlexCluster + operationId: getCluster + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ClusterDescription20240805" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Cluster from One Project + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetClusterApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + GetClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/getCluster + patch: + description: "Updates the details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. This resource can update clusters with asymmetrically-sized shards. To update a cluster's termination protection, the requesting Service Account or API Key must have the Project Owner role. For all other updates, the requesting Service Account or API Key must have the Project Cluster Manager role. You can't modify a paused cluster (`paused : true`). You must call this endpoint to set `paused : false`. After this endpoint responds with `paused : false`, you can call it again with the changes you want to make to the cluster. This feature is not available for serverless clusters. Deprecated versions: v2-{2024-08-05}, v2-{2023-02-01}, v2-{2023-01-01}" + operationId: updateCluster + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-10-23+json: + schema: + $ref: "#/components/schemas/ClusterDescription20240805" + x-xgen-version: 2024-10-23 + description: Cluster to update in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-10-23+json: + schema: + $ref: "#/components/schemas/ClusterDescription20240805" + x-xgen-version: 2024-10-23 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Cluster in One Project + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateClusterApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + UpdateClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/updateCluster + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/{clusterView}/{databaseName}/{collectionName}/collStats/measurements: + get: + description: Get a list of the Coll Stats Latency cluster-level measurements for the given namespace. + operationId: getCollStatsLatencyNamespaceClusterMeasurements + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster to retrieve metrics for. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Human-readable label that identifies the cluster topology to retrieve metrics for. + in: path + name: clusterView + required: true + schema: + type: string + - $ref: "#/components/parameters/databaseName" + - $ref: "#/components/parameters/collectionName" + - description: List that contains the metrics that you want to retrieve for the associated data series. If you don't set this parameter, this resource returns data series for all Coll Stats Latency metrics. + explode: true + in: query + name: metrics + schema: + items: + description: Metric requested for the given cluster + type: string + type: array + uniqueItems: true + style: form + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/period" + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/MeasurementsCollStatsLatencyCluster" + x-xgen-version: 2023-11-15 + description: Succeeded + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Cluster-Level Query Latency + tags: + - Collection Level Metrics + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getCollStatsLatencyNamespaceClusterMeasurements --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetCollStatsLatencyNamespaceClusterMeasurementsApiParams{} + sdkResp, httpResp, err := client.CollectionLevelMetricsApi. + GetCollStatsLatencyNamespaceClusterMeasurementsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/{clusterView}/{databaseName}/{collectionName}/collStats/measurements?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/{clusterView}/{databaseName}/{collectionName}/collStats/measurements?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/getCollStatsLatencyNamespaceClusterMeasurements + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/{clusterView}/collStats/namespaces: + get: + description: Return the subset of namespaces from the given cluster sorted by highest total execution time (descending) within the given time window. + operationId: getCollStatsLatencyNamespacesForCluster + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster to pin namespaces to. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Human-readable label that identifies the cluster topology to retrieve metrics for. + in: path + name: clusterView + required: true + schema: + type: string + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/period" + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/CollStatsRankedNamespaces" + x-xgen-version: 2023-11-15 + description: Succeeded + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Ranked Namespaces from a Cluster + tags: + - Collection Level Metrics + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getCollStatsLatencyNamespacesForCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetCollStatsLatencyNamespacesForClusterApiParams{} + sdkResp, httpResp, err := client.CollectionLevelMetricsApi. + GetCollStatsLatencyNamespacesForClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/{clusterView}/collStats/namespaces?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/{clusterView}/collStats/namespaces?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/getCollStatsLatencyNamespacesForCluster + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/autoScalingConfiguration: + get: + deprecated: true + description: Returns the internal configuration of AutoScaling for sharded clusters. This endpoint can be used for diagnostic purposes to ensure that sharded clusters updated from older APIs have gained support for AutoScaling each shard independently. + operationId: autoScalingConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ClusterDescriptionAutoScalingModeConfiguration" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Auto Scaling Configuration for One Sharded Cluster + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api autoScalingConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AutoScalingConfigurationApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + AutoScalingConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/autoScalingConfiguration?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/autoScalingConfiguration?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/autoScalingConfiguration + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/exports: + get: + description: Returns all Cloud Backup Snapshot Export Jobs associated with the specified Atlas cluster. To use this resource, the requesting Service Account or API Key must have the Project Atlas Admin role. + operationId: listBackupExportJobs + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiAtlasDiskBackupExportJob" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Snapshot Export Jobs + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listBackupExportJobs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListBackupExportJobsApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + ListBackupExportJobsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/exports?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/exports?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/listBackupExportJobs + post: + description: Exports one backup Snapshot for dedicated Atlas cluster using Cloud Backups to an Export Bucket. To use this resource, the requesting Service Account or API Key must have the Project Atlas Admin role. + operationId: createBackupExportJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupExportJobRequest" + description: Information about the Cloud Backup Snapshot Export Job to create. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupExportJob" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Snapshot Export Job + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createBackupExportJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateBackupExportJobApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + CreateBackupExportJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/exports" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/exports" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/createBackupExportJob + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/exports/{exportId}: + get: + description: Returns one Cloud Backup Snapshot Export Job associated with the specified Atlas cluster. To use this resource, the requesting Service Account or API Key must have the Project Atlas Admin role. + operationId: getBackupExportJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal character string that identifies the Export Job. + in: path + name: exportId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupExportJob" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Snapshot Export Job + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getBackupExportJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetBackupExportJobApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + GetBackupExportJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/exports/{exportId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/exports/{exportId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/getBackupExportJob + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs: + get: + description: Returns all cloud backup restore jobs for one cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role. + operationId: listBackupRestoreJobs + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the cluster with the restore jobs you want to return. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedCloudBackupRestoreJob" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Restore Jobs for One Cluster + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listBackupRestoreJobs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListBackupRestoreJobsApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + ListBackupRestoreJobsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/listBackupRestoreJobs + post: + description: |- + Restores one snapshot of one cluster from the specified project. Atlas takes on-demand snapshots immediately and scheduled snapshots at regular intervals. If an on-demand snapshot with a status of **queued** or **inProgress** exists, before taking another snapshot, wait until Atlas completes completes processing the previously taken on-demand snapshot. + + To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role. + operationId: createBackupRestoreJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupSnapshotRestoreJob" + description: Restores one snapshot of one cluster from the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupSnapshotRestoreJob" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Restore One Snapshot of One Cluster + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + CreateBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/createBackupRestoreJob + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs/{restoreJobId}: + delete: + description: Cancels one cloud backup restore job of one cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role. + operationId: cancelBackupRestoreJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the restore job to remove. + in: path + name: restoreJobId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "405": + $ref: "#/components/responses/methodNotAllowed" + "500": + $ref: "#/components/responses/internalServerError" + summary: Cancel One Restore Job for One Cluster + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api cancelBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CancelBackupRestoreJobApiParams{} + httpResp, err := client.CloudBackupsApi. + CancelBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs/{restoreJobId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs/{restoreJobId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/cancelBackupRestoreJob + get: + description: Returns one cloud backup restore job for one cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role. + operationId: getBackupRestoreJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster with the restore jobs you want to return. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the restore job to return. + in: path + name: restoreJobId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupSnapshotRestoreJob" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Restore Job for One Cluster + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + GetBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs/{restoreJobId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/restoreJobs/{restoreJobId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/getBackupRestoreJob + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule: + delete: + description: "Removes all cloud backup schedules for the specified cluster. This schedule defines when MongoDB Cloud takes scheduled snapshots and how long it stores those snapshots. To use this resource, the requesting Service Account or API Key must have the Project Atlas Admin role. Deprecated versions: v2-{2023-01-01}" + operationId: deleteAllBackupSchedules + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/DiskBackupSnapshotSchedule20240805" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove All Cloud Backup Schedules + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteAllBackupSchedules --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteAllBackupSchedulesApiParams{} + httpResp, err := client.CloudBackupsApi. + DeleteAllBackupSchedulesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/deleteAllBackupSchedules + get: + description: "Returns the cloud backup schedule for the specified cluster within the specified project. This schedule defines when MongoDB Cloud takes scheduled snapshots and how long it stores those snapshots. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Deprecated versions: v2-{2023-01-01}" + operationId: getBackupSchedule + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/DiskBackupSnapshotSchedule20240805" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Cloud Backup Schedule + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getBackupSchedule --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetBackupScheduleApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + GetBackupScheduleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/getBackupSchedule + patch: + description: "Updates the cloud backup schedule for one cluster within the specified project. This schedule defines when MongoDB Cloud takes scheduled snapshots and how long it stores those snapshots. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Deprecated versions: v2-{2023-01-01}" + operationId: updateBackupSchedule + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/DiskBackupSnapshotSchedule20240805" + description: |- + Updates the cloud backup schedule for one cluster within the specified project. + + **Note**: In the request body, provide only the fields that you want to update. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/DiskBackupSnapshotSchedule20240805" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Cloud Backup Schedule for One Cluster + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateBackupSchedule --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateBackupScheduleApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + UpdateBackupScheduleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/schedule" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/updateBackupSchedule + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots: + get: + description: Returns all snapshots of one cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role or Project Backup Manager role. + operationId: listReplicaSetBackups + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedCloudBackupReplicaSet" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Replica Set Cloud Backups + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listReplicaSetBackups --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListReplicaSetBackupsApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + ListReplicaSetBackupsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/listReplicaSetBackups + post: + description: |- + Takes one on-demand snapshot for the specified cluster. Atlas takes on-demand snapshots immediately and scheduled snapshots at regular intervals. If an on-demand snapshot with a status of **queued** or **inProgress** exists, before taking another snapshot, wait until Atlas completes completes processing the previously taken on-demand snapshot. + + To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role. + operationId: takeSnapshot + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupOnDemandSnapshotRequest" + description: Takes one on-demand snapshot. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupSnapshot" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Take One On-Demand Snapshot + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api takeSnapshot --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.TakeSnapshotApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + TakeSnapshotWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/takeSnapshot + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/{snapshotId}: + delete: + description: Removes the specified snapshot. To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role. + operationId: deleteReplicaSetBackup + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Replica Set Cloud Backup + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteReplicaSetBackup --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteReplicaSetBackupApiParams{} + httpResp, err := client.CloudBackupsApi. + DeleteReplicaSetBackupWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/{snapshotId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/{snapshotId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/deleteReplicaSetBackup + get: + description: Returns one snapshot from the specified cluster. To use this resource, the requesting Service Account or API Key must have the Project Read Only role or Project Backup Manager role. + operationId: getReplicaSetBackup + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupReplicaSet" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Replica Set Cloud Backup + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getReplicaSetBackup --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetReplicaSetBackupApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + GetReplicaSetBackupWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/{snapshotId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/{snapshotId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/getReplicaSetBackup + patch: + description: Changes the expiration date for one cloud backup snapshot for one cluster in the specified project, the requesting Service Account or API Key must have the Project Backup Manager role. + operationId: updateSnapshotRetention + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupSnapshotRetention" + description: Changes the expiration date for one cloud backup snapshot for one cluster in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupReplicaSet" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Expiration Date for One Cloud Backup + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateSnapshotRetention --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateSnapshotRetentionApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + UpdateSnapshotRetentionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/{snapshotId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/{snapshotId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/updateSnapshotRetention + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedCluster/{snapshotId}: + delete: + description: Removes one snapshot of one sharded cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Backup Manager role. + operationId: deleteShardedClusterBackup + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Sharded Cluster Cloud Backup + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteShardedClusterBackup --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteShardedClusterBackupApiParams{} + httpResp, err := client.CloudBackupsApi. + DeleteShardedClusterBackupWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedCluster/{snapshotId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedCluster/{snapshotId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/deleteShardedClusterBackup + get: + description: Returns one snapshot of one sharded cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role or Project Backup Manager role. + operationId: getShardedClusterBackup + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DiskBackupShardedClusterSnapshot" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Sharded Cluster Cloud Backup + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getShardedClusterBackup --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetShardedClusterBackupApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + GetShardedClusterBackupWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedCluster/{snapshotId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedCluster/{snapshotId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/getShardedClusterBackup + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedClusters: + get: + description: Returns all snapshots of one sharded cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role or Project Backup Manager role. + operationId: listShardedClusterBackups + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedCloudBackupShardedClusterSnapshot" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Sharded Cluster Cloud Backups + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listShardedClusterBackups --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListShardedClusterBackupsApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + ListShardedClusterBackupsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedClusters?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/shardedClusters?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/listShardedClusterBackups + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/download: + post: + deprecated: true + description: |- + Requests one snapshot for the specified shared cluster. This resource returns a `snapshotURL` that you can use to download the snapshot. This `snapshotURL` remains active for four hours after you make the request. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + This endpoint can also be used on Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) endpoint or former M2/M5 clusters that have been migrated to Flex clusters until January 2026, after which this endpoint will be sunset. Please use the downloadFlexBackup endpoint instead. + externalDocs: + description: downloadFlexBackup + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Snapshots/operation/downloadFlexBackup + operationId: downloadSharedClusterBackup + parameters: + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TenantRestore" + description: Snapshot to be downloaded. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TenantRestore" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Download One M2 or M5 Cluster Snapshot + tags: + - Shared-Tier Snapshots + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api downloadSharedClusterBackup --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DownloadSharedClusterBackupApiParams{} + sdkResp, httpResp, err := client.Shared - TierSnapshotsApi. + DownloadSharedClusterBackupWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/download" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/download" \ + -d '{ }' + x-sunset: 2026-01-15 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Shared-Tier-Snapshots/operation/downloadSharedClusterBackup + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restore: + post: + deprecated: true + description: |- + Restores the specified M2 or M5 cluster. MongoDB Cloud limits which clusters can be the target clusters of a restore. The target cluster can't use encryption at rest, run a major release MongoDB version different than the snapshot, or receive client requests during restores. MongoDB Cloud deletes all existing data on the target cluster prior to the restore operation. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + This endpoint can also be used on Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) endpoint or former M2/M5 clusters that have been migrated to Flex clusters until January 2026, after which this endpoint will be sunset. Please use the createFlexBackupRestoreJob endpoint instead. + externalDocs: + description: createFlexBackupRestoreJob + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/createFlexBackupRestoreJob + operationId: createSharedClusterBackupRestoreJob + parameters: + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TenantRestore" + description: The restore job details. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TenantRestore" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Restore Job for One M2 or M5 Cluster + tags: + - Shared-Tier Restore Jobs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createSharedClusterBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateSharedClusterBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.Shared - TierRestoreJobsApi. + CreateSharedClusterBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restore" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restore" \ + -d '{ }' + x-sunset: 2026-01-15 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Shared-Tier-Restore-Jobs/operation/createSharedClusterBackupRestoreJob + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restores: + get: + deprecated: true + description: |- + Returns all restore jobs for the specified M2 or M5 cluster. Restore jobs restore a cluster using a snapshot. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This endpoint can also be used on Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) endpoint or former M2/M5 clusters that have been migrated to Flex clusters until January 2026, after which this endpoint will be sunset. Please use the listFlexBackupRestoreJobs endpoint instead. + externalDocs: + description: listFlexBackupRestoreJobs + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/listFlexBackupRestoreJobs + operationId: listSharedClusterBackupRestoreJobs + parameters: + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedTenantRestore" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Restore Jobs for One M2 or M5 Cluster + tags: + - Shared-Tier Restore Jobs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listSharedClusterBackupRestoreJobs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListSharedClusterBackupRestoreJobsApiParams{} + sdkResp, httpResp, err := client.Shared - TierRestoreJobsApi. + ListSharedClusterBackupRestoreJobsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restores?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restores?pretty=true" + x-sunset: 2026-01-15 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Shared-Tier-Restore-Jobs/operation/listSharedClusterBackupRestoreJobs + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restores/{restoreId}: + get: + deprecated: true + description: |- + Returns the specified restore job for the specified M2 or M5 cluster. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This endpoint can also be used on Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) endpoint or former M2/M5 clusters that have been migrated to Flex clusters until January 2026, after which this endpoint will be sunset. Please use the getFlexBackupRestoreJob endpoint instead. + externalDocs: + description: getFlexBackupRestoreJob + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/getFlexBackupRestoreJob + operationId: getSharedClusterBackupRestoreJob + parameters: + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the restore job to return. + in: path + name: restoreId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TenantRestore" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Restore Job for One M2 or M5 Cluster + tags: + - Shared-Tier Restore Jobs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getSharedClusterBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetSharedClusterBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.Shared - TierRestoreJobsApi. + GetSharedClusterBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restores/{restoreId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/restores/{restoreId}?pretty=true" + x-sunset: 2026-01-15 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Shared-Tier-Restore-Jobs/operation/getSharedClusterBackupRestoreJob + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/snapshots: + get: + deprecated: true + description: |- + Returns details for all snapshots for the specified shared cluster. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This API also works for Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) endpoint or former M2/M5 clusters that have been migrated to Flex clusters, until January 2026, after which this endpoint will be sunset. Please use the listFlexBackups endpoint instead. + externalDocs: + description: listFlexBackups + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Snapshots/operation/listFlexBackups + operationId: listSharedClusterBackups + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedTenantSnapshot" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Snapshots for One M2 or M5 Cluster + tags: + - Shared-Tier Snapshots + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listSharedClusterBackups --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListSharedClusterBackupsApiParams{} + sdkResp, httpResp, err := client.Shared - TierSnapshotsApi. + ListSharedClusterBackupsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/snapshots?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/snapshots?pretty=true" + x-sunset: 2026-01-15 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Shared-Tier-Snapshots/operation/listSharedClusterBackups + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/snapshots/{snapshotId}: + get: + deprecated: true + description: |- + Returns details for one snapshot for the specified shared cluster. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This endpoint can also be used on Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) endpoint or former M2/M5 clusters that have been migrated to Flex clusters until January 2026, after which this endpoint will be sunset. Please use the getFlexBackup endpoint instead. + externalDocs: + description: getFlexBackup + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Snapshots/operation/getFlexBackup + operationId: getSharedClusterBackup + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupTenantSnapshot" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Snapshot of One M2 or M5 Cluster + tags: + - Shared-Tier Snapshots + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getSharedClusterBackup --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetSharedClusterBackupApiParams{} + sdkResp, httpResp, err := client.Shared - TierSnapshotsApi. + GetSharedClusterBackupWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/snapshots/{snapshotId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/tenant/snapshots/{snapshotId}?pretty=true" + x-sunset: 2026-01-15 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Shared-Tier-Snapshots/operation/getSharedClusterBackup + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backupCheckpoints: + get: + deprecated: true + description: Returns all legacy backup checkpoints for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listLegacyBackupCheckpoints + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the cluster that contains the checkpoints that you want to return. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiAtlasCheckpoint" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Legacy Backup Checkpoints + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listLegacyBackupCheckpoints --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListLegacyBackupCheckpointsApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + ListLegacyBackupCheckpointsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backupCheckpoints?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backupCheckpoints?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/listLegacyBackupCheckpoints + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backupCheckpoints/{checkpointId}: + get: + deprecated: true + description: Returns one legacy backup checkpoint for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getLegacyBackupCheckpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the checkpoint. + in: path + name: checkpointId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: Human-readable label that identifies the cluster that contains the checkpoints that you want to return. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiAtlasCheckpoint" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Legacy Backup Checkpoint + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getLegacyBackupCheckpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetLegacyBackupCheckpointApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + GetLegacyBackupCheckpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backupCheckpoints/{checkpointId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backupCheckpoints/{checkpointId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/getLegacyBackupCheckpoint + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/pinned: + get: + description: Returns a list of given cluster's pinned namespaces, a set of namespaces manually selected by users to collect query latency metrics on. + operationId: getPinnedNamespaces + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster to retrieve pinned namespaces for. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/PinnedNamespaces" + x-xgen-version: 2023-11-15 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Pinned Namespaces + tags: + - Collection Level Metrics + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPinnedNamespaces --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPinnedNamespacesApiParams{} + sdkResp, httpResp, err := client.CollectionLevelMetricsApi. + GetPinnedNamespacesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/pinned?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/pinned?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/getPinnedNamespaces + patch: + description: Add provided list of namespaces to existing pinned namespaces list for collection-level latency metrics collection for the given Group and Cluster. + operationId: pinNamespacesPatch + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster to pin namespaces to. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/NamespacesRequest" + description: List of namespace strings (combination of database and collection name) to pin for query latency metric collection. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/PinnedNamespaces" + x-xgen-version: 2023-11-15 + description: OK + "201": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/PinnedNamespaces" + x-xgen-version: 2023-11-15 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add Pinned Namespaces + tags: + - Collection Level Metrics + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api pinNamespacesPatch --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.PinNamespacesPatchApiParams{} + sdkResp, httpResp, err := client.CollectionLevelMetricsApi. + PinNamespacesPatchWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/pinned" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/pinned" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/pinNamespacesPatch + put: + description: Pin provided list of namespaces for collection-level latency metrics collection for the given Group and Cluster. This initializes a pinned namespaces list or replaces any existing pinned namespaces list for the Group and Cluster. + operationId: pinNamespacesPut + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster to pin namespaces to. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/NamespacesRequest" + description: List of namespace strings (combination of database and collection name) to pin for query latency metric collection. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/PinnedNamespaces" + x-xgen-version: 2023-11-15 + description: OK + "201": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/PinnedNamespaces" + x-xgen-version: 2023-11-15 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Pin Namespaces + tags: + - Collection Level Metrics + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api pinNamespacesPut --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.PinNamespacesPutApiParams{} + sdkResp, httpResp, err := client.CollectionLevelMetricsApi. + PinNamespacesPutWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/pinned" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/pinned" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/pinNamespacesPut + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/unpin: + patch: + description: Unpin provided list of namespaces for collection-level latency metrics collection for the given Group and Cluster. + operationId: unpinNamespaces + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster to unpin namespaces from. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/NamespacesRequest" + description: List of namespace strings (combination of database and collection name) to pin for query latency metric collection. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/PinnedNamespaces" + x-xgen-version: 2023-11-15 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Unpin namespaces + tags: + - Collection Level Metrics + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api unpinNamespaces --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UnpinNamespacesApiParams{} + sdkResp, httpResp, err := client.CollectionLevelMetricsApi. + UnpinNamespacesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/unpin" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/collStats/unpin" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/unpinNamespaces + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes: + post: + deprecated: true + description: Creates one Atlas Search index on the specified collection. Atlas Search indexes define the fields on which to create the index and the analyzers to use when creating the index. Only clusters running MongoDB v4.2 or later can use Atlas Search. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: createAtlasSearchIndexDeprecated + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection on which to create an Atlas Search index. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterSearchIndex" + description: Creates one Atlas Search index on the specified collection. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterSearchIndex" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Atlas Search Index + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createAtlasSearchIndexDeprecated --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateAtlasSearchIndexDeprecatedApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + CreateAtlasSearchIndexDeprecatedWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes" \ + -d '{ }' + x-sunset: 2026-11-30 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/createAtlasSearchIndexDeprecated + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{databaseName}/{collectionName}: + get: + deprecated: true + description: Returns all Atlas Search indexes on the specified collection. Atlas Search indexes contain the indexed fields and the analyzers used to create the indexes. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Write role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: listAtlasSearchIndexesDeprecated + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection with one or more Atlas Search indexes. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Name of the collection that contains one or more Atlas Search indexes. + in: path + name: collectionName + required: true + schema: + type: string + - description: Human-readable label that identifies the database that contains the collection with one or more Atlas Search indexes. + in: path + name: databaseName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/ClusterSearchIndex" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Atlas Search Indexes for One Collection + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAtlasSearchIndexesDeprecated --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAtlasSearchIndexesDeprecatedApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + ListAtlasSearchIndexesDeprecatedWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{databaseName}/{collectionName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{databaseName}/{collectionName}?pretty=true" + x-sunset: 2026-11-30 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/listAtlasSearchIndexesDeprecated + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}: + delete: + deprecated: true + description: Removes one Atlas Search index that you identified with its unique ID. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: deleteAtlasSearchIndexDeprecated + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the database and collection with one or more Application Search indexes. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the Atlas Search index. Use the [Get All Atlas Search Indexes for a Collection API](https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-all/) endpoint to find the IDs of all Atlas Search indexes. + in: path + name: indexId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Atlas Search Index + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteAtlasSearchIndexDeprecated --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteAtlasSearchIndexDeprecatedApiParams{} + httpResp, err := client.AtlasSearchApi. + DeleteAtlasSearchIndexDeprecatedWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}" + x-sunset: 2026-11-30 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/deleteAtlasSearchIndexDeprecated + get: + deprecated: true + description: Returns one Atlas Search index in the specified project. You identify this index using its unique ID. Atlas Search index contains the indexed fields and the analyzers used to create the index. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Write role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: getAtlasSearchIndexDeprecated + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection with one or more Atlas Search indexes. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the Application Search [index](https://dochub.mongodb.org/core/index-definitions-fts). Use the [Get All Application Search Indexes for a Collection API](https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-all/) endpoint to find the IDs of all Application Search indexes. + in: path + name: indexId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterSearchIndex" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Atlas Search Index + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAtlasSearchIndexDeprecated --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAtlasSearchIndexDeprecatedApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + GetAtlasSearchIndexDeprecatedWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}?pretty=true" + x-sunset: 2026-11-30 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/getAtlasSearchIndexDeprecated + patch: + deprecated: true + description: Updates one Atlas Search index that you identified with its unique ID. Atlas Search indexes define the fields on which to create the index and the analyzers to use when creating the index. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: updateAtlasSearchIndexDeprecated + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection whose Atlas Search index to update. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the Atlas Search [index](https://dochub.mongodb.org/core/index-definitions-fts). Use the [Get All Atlas Search Indexes for a Collection API](https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-all/) endpoint to find the IDs of all Atlas Search indexes. + in: path + name: indexId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterSearchIndex" + description: Details to update on the Atlas Search index. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterSearchIndex" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Atlas Search Index + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateAtlasSearchIndexDeprecated --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateAtlasSearchIndexDeprecatedApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + UpdateAtlasSearchIndexDeprecatedWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/fts/indexes/{indexId}" \ + -d '{ }' + x-sunset: 2026-11-30 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/updateAtlasSearchIndexDeprecated + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites: + get: + description: "Returns one managed namespace within the specified global cluster. A managed namespace identifies a collection using the database name, the dot separator, and the collection name. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Deprecated versions: v2-{2023-02-01}, v2-{2023-01-01}" + externalDocs: + description: Global Clusters + url: https://www.mongodb.com/docs/atlas/global-clusters/ + operationId: getManagedNamespace + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GeoSharding20240805" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Managed Namespace in One Global Cluster + tags: + - Global Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getManagedNamespace --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetManagedNamespaceApiParams{} + sdkResp, httpResp, err := client.GlobalClustersApi. + GetManagedNamespaceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Global-Clusters/operation/getManagedNamespace + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/customZoneMapping: + delete: + description: "Removes all custom zone mappings for the specified global cluster. A custom zone mapping matches one ISO 3166-2 location code to a zone in your global cluster. Removing the custom zone mappings restores the default mapping. By default, MongoDB Cloud maps each location code to the closest geographical zone. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Deprecated versions: v2-{2023-02-01}, v2-{2023-01-01}" + externalDocs: + description: Global Clusters + url: https://www.mongodb.com/docs/atlas/global-clusters/ + operationId: deleteAllCustomZoneMappings + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GeoSharding20240805" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove All Custom Zone Mappings from One Global Cluster + tags: + - Global Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteAllCustomZoneMappings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteAllCustomZoneMappingsApiParams{} + httpResp, err := client.GlobalClustersApi. + DeleteAllCustomZoneMappingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/customZoneMapping" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/customZoneMapping" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Global-Clusters/operation/deleteAllCustomZoneMappings + post: + description: "Creates one custom zone mapping for the specified global cluster. A custom zone mapping matches one ISO 3166-2 location code to a zone in your global cluster. By default, MongoDB Cloud maps each location code to the closest geographical zone. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Deprecated versions: v2-{2023-02-01}, v2-{2023-01-01}" + externalDocs: + description: Global Clusters + url: https://www.mongodb.com/docs/atlas/global-clusters/ + operationId: createCustomZoneMapping + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/CustomZoneMappings" + x-xgen-version: 2024-08-05 + description: Custom zone mapping to add to the specified global cluster. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GeoSharding20240805" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One Custom Zone Mapping to One Global Cluster + tags: + - Global Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createCustomZoneMapping --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateCustomZoneMappingApiParams{} + sdkResp, httpResp, err := client.GlobalClustersApi. + CreateCustomZoneMappingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/customZoneMapping" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/customZoneMapping" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Global-Clusters/operation/createCustomZoneMapping + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/managedNamespaces: + delete: + description: "Removes one managed namespace within the specified global cluster. A managed namespace identifies a collection using the database name, the dot separator, and the collection name. Deleting a managed namespace does not remove the associated collection or data. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. Deprecated versions: v2-{2023-02-01}, v2-{2023-01-01}" + externalDocs: + description: Global Clusters + url: https://www.mongodb.com/docs/atlas/global-clusters/ + operationId: deleteManagedNamespace + parameters: + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the database that contains the collection. + in: query + name: db + schema: + type: string + - description: Human-readable label that identifies the collection associated with the managed namespace. + in: query + name: collection + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GeoSharding20240805" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Managed Namespace from One Global Cluster + tags: + - Global Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteManagedNamespace --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteManagedNamespaceApiParams{} + httpResp, err := client.GlobalClustersApi. + DeleteManagedNamespaceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/managedNamespaces" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/managedNamespaces" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Global-Clusters/operation/deleteManagedNamespace + post: + description: "Creates one managed namespace within the specified global cluster. A managed namespace identifies a collection using the database name, the dot separator, and the collection name. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. Deprecated versions: v2-{2023-02-01}, v2-{2023-01-01}" + externalDocs: + description: Global Clusters + url: https://www.mongodb.com/docs/atlas/global-clusters/ + operationId: createManagedNamespace + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ManagedNamespaces" + x-xgen-version: 2024-08-05 + description: Managed namespace to create within the specified global cluster. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GeoSharding20240805" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "405": + $ref: "#/components/responses/methodNotAllowed" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Managed Namespace in One Global Cluster + tags: + - Global Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createManagedNamespace --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateManagedNamespaceApiParams{} + sdkResp, httpResp, err := client.GlobalClustersApi. + CreateManagedNamespaceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/managedNamespaces" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/globalWrites/managedNamespaces" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Global-Clusters/operation/createManagedNamespace + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/index: + post: + description: Creates an index on the cluster identified by its name in a rolling manner. Creating the index in this way allows index builds on one replica set member as a standalone at a time, starting with the secondary members. Creating indexes in this way requires at least one replica set election. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Rolling Index Builds on Replica Sets + url: https://docs.mongodb.com/manual/tutorial/build-indexes-on-replica-sets/ + operationId: createRollingIndex + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster on which MongoDB Cloud creates an index. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + examples: + 2dspere Index: + description: 2dspere Index + value: + collation: + alternate: non-ignorable + backwards: false + caseFirst: lower + caseLevel: false + locale: af + maxVariable: punct + normalization: false + numericOrdering: false + strength: 3 + collection: accounts + db: sample_airbnb + keys: + - property_type: "1" + options: + name: PartialIndexTest + partialFilterExpression: + limit: + $gt: 900 + Partial Index: + description: Partial Index + value: + collation: + alternate: non-ignorable + backwards: false + caseFirst: lower + caseLevel: false + locale: af + maxVariable: punct + normalization: false + numericOrdering: false + strength: 3 + collection: accounts + db: sample_airbnb + keys: + - property_type: "1" + options: + name: PartialIndexTest + partialFilterExpression: + limit: + $gt: 900 + Sparse Index: + description: Sparse Index + value: + collation: + alternate: non-ignorable + backwards: false + caseFirst: lower + caseLevel: false + locale: af + maxVariable: punct + normalization: false + numericOrdering: false + strength: 3 + collection: accounts + db: sample_airbnb + keys: + - test_field: "1" + options: + name: SparseIndexTest + sparse: true + schema: + $ref: "#/components/schemas/DatabaseRollingIndexRequest" + description: Rolling index to create on the specified cluster. + required: true + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: Accepted + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Rolling Index + tags: + - Rolling Index + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createRollingIndex --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateRollingIndexApiParams{} + sdkResp, httpResp, err := client.RollingIndexApi. + CreateRollingIndexWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/index" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/index" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Rolling-Index/operation/createRollingIndex + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives: + get: + description: Returns details of all online archives. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + externalDocs: + description: Online Archive + url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive + operationId: listOnlineArchives + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the cluster that contains the collection for which you want to return the online archives. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedOnlineArchive" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Online Archives for One Cluster + tags: + - Online Archive + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listOnlineArchives --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListOnlineArchivesApiParams{} + sdkResp, httpResp, err := client.OnlineArchiveApi. + ListOnlineArchivesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/listOnlineArchives + post: + description: Creates one online archive. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Online Archive + url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive + operationId: createOnlineArchive + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster that contains the collection for which you want to create one online archive. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupOnlineArchiveCreate" + description: Creates one online archive. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupOnlineArchive" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Online Archive + tags: + - Online Archive + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createOnlineArchive --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateOnlineArchiveApiParams{} + sdkResp, httpResp, err := client.OnlineArchiveApi. + CreateOnlineArchiveWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives" \ + -d '{ }' + x-xgen-changelog: + 2023-08-02: If 'criteria':'DATE' is specified, then you must specify 'DATE' values in partition fields + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/createOnlineArchive + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}: + delete: + description: Removes one online archive. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Online Archive + url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive + operationId: deleteOnlineArchive + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the online archive to delete. + in: path + name: archiveId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: Human-readable label that identifies the cluster that contains the collection from which you want to remove an online archive. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Online Archive + tags: + - Online Archive + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteOnlineArchive --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteOnlineArchiveApiParams{} + httpResp, err := client.OnlineArchiveApi. + DeleteOnlineArchiveWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/deleteOnlineArchive + get: + description: Returns one online archive for one cluster. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + externalDocs: + description: Online Archive + url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive + operationId: getOnlineArchive + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the online archive to return. + in: path + name: archiveId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: Human-readable label that identifies the cluster that contains the specified collection from which Application created the online archive. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupOnlineArchive" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Online Archive + tags: + - Online Archive + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getOnlineArchive --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetOnlineArchiveApiParams{} + sdkResp, httpResp, err := client.OnlineArchiveApi. + GetOnlineArchiveWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/getOnlineArchive + patch: + description: Updates, pauses, or resumes one online archive. This archive stores data from one cluster within one project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Online Archive + url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive + operationId: updateOnlineArchive + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the online archive to update. + in: path + name: archiveId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: Human-readable label that identifies the cluster that contains the specified collection from which Application created the online archive. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupOnlineArchive" + description: Updates, pauses, or resumes one online archive. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupOnlineArchive" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Online Archive + tags: + - Online Archive + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateOnlineArchive --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateOnlineArchiveApiParams{} + sdkResp, httpResp, err := client.OnlineArchiveApi. + UpdateOnlineArchiveWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/updateOnlineArchive + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/queryLogs.gz: + get: + description: 'Downloads query logs for the specified online archive. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Only or higher role. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: "Accept: application/vnd.atlas.YYYY-MM-DD+gzip".' + externalDocs: + description: Online Archive + url: https://docs.atlas.mongodb.com/online-archive/manage-online-archive/#std-label-manage-online-archive + operationId: downloadOnlineArchiveQueryLogs + parameters: + - $ref: "#/components/parameters/groupId" + - description: Date and time that specifies the starting point for the range of log messages to return. This resource expresses this value in the number of seconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). + in: query + name: startDate + schema: + example: 1636481348 + format: int64 + minimum: 1199145600 + type: integer + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + - description: Date and time that specifies the end point for the range of log messages to return. This resource expresses this value in the number of seconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). + in: query + name: endDate + schema: + example: 1636481348 + format: int64 + minimum: 1199145600 + type: integer + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + - description: Human-readable label that identifies the cluster that contains the collection for which you want to return the query logs from one online archive. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Flag that indicates whether to download logs for queries against your online archive only or both your online archive and cluster. + in: query + name: archiveOnly + schema: + default: false + type: boolean + responses: + "200": + content: + application/vnd.atlas.2023-01-01+gzip: + schema: + description: This resource downloads a compressed log file to your current working directory. You can specify its name using the `--output` option or use the default filename using the `-OJ` option. The default filename varies based on whether you download logs for queries of your online archive only or both your online archive and cluster. + format: binary + type: string + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Download Online Archive Query Logs + tags: + - Online Archive + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api downloadOnlineArchiveQueryLogs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DownloadOnlineArchiveQueryLogsApiParams{} + sdkResp, httpResp, err := client.OnlineArchiveApi. + DownloadOnlineArchiveQueryLogsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/queryLogs.gz?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/queryLogs.gz?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Online-Archive/operation/downloadOnlineArchiveQueryLogs + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/outageSimulation: + delete: + description: Ends a cluster outage simulation. + externalDocs: + description: Cluster Outage Simulation + url: https://dochub.mongodb.org/core/test-regional-outage + operationId: endOutageSimulation + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster that is undergoing outage simulation. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterOutageSimulation" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: End One Outage Simulation + tags: + - Cluster Outage Simulation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api endOutageSimulation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.EndOutageSimulationApiParams{} + httpResp, err := client.ClusterOutageSimulationApi. + EndOutageSimulationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/outageSimulation" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/outageSimulation" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cluster-Outage-Simulation/operation/endOutageSimulation + get: + description: Returns one outage simulation for one cluster. + externalDocs: + description: Cluster Outage Simulation + url: https://dochub.mongodb.org/core/test-regional-outage + operationId: getOutageSimulation + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster that is undergoing outage simulation. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterOutageSimulation" + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Singleton method, mistakenly identified as a List method. + xgen-IPA-110-collections-response-define-results-array: Singleton method, mistakenly identified as a List method. + xgen-IPA-110-collections-use-paginated-prefix: Singleton method, mistakenly identified as a List method. + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Outage Simulation + tags: + - Cluster Outage Simulation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getOutageSimulation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetOutageSimulationApiParams{} + sdkResp, httpResp, err := client.ClusterOutageSimulationApi. + GetOutageSimulationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/outageSimulation?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/outageSimulation?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cluster-Outage-Simulation/operation/getOutageSimulation + post: + description: Starts a cluster outage simulation. + externalDocs: + description: Cluster Outage Simulation + url: https://dochub.mongodb.org/core/test-regional-outage + operationId: startOutageSimulation + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster to undergo an outage simulation. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterOutageSimulation" + description: Describes the outage simulation. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterOutageSimulation" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Start One Outage Simulation + tags: + - Cluster Outage Simulation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api startOutageSimulation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.StartOutageSimulationApiParams{} + sdkResp, httpResp, err := client.ClusterOutageSimulationApi. + StartOutageSimulationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/outageSimulation" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/outageSimulation" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cluster-Outage-Simulation/operation/startOutageSimulation + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/dropIndexSuggestions: + get: + description: Returns the indexes that the Performance Advisor suggests to drop. The Performance Advisor suggests dropping unused, redundant, and hidden indexes to improve write performance and increase storage space. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listDropIndexes + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/DropIndexSuggestionsResponse" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Suggested Indexes to Drop + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listDropIndexes --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListDropIndexesApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + ListDropIndexesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/dropIndexSuggestions?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/dropIndexSuggestions?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/listDropIndexes + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice: + get: + description: Returns the schema suggestions that the Performance Advisor detects. The Performance Advisor provides holistic schema recommendations for your cluster by sampling documents in your most active collections and collections with slow-running queries. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listSchemaAdvice + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/SchemaAdvisorResponse" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Schema Advice + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listSchemaAdvice --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListSchemaAdviceApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + ListSchemaAdviceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/schemaAdvice?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/listSchemaAdvice + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/suggestedIndexes: + get: + description: Returns the indexes that the Performance Advisor suggests. The Performance Advisor monitors queries that MongoDB considers slow and suggests new indexes to improve query performance. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listClusterSuggestedIndexes + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: ProcessIds from which to retrieve suggested indexes. A processId is a combination of host and port that serves the MongoDB process. The host must be the hostname, FQDN, IPv4 address, or IPv6 address of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. To include multiple processIds, pass the parameter multiple times delimited with an ampersand (`&`) between each processId. + in: query + name: processIds + schema: + items: + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + type: array + style: form + - description: "Namespaces from which to retrieve suggested indexes. A namespace consists of one database and one collection resource written as `.`: `.`. To include multiple namespaces, pass the parameter multiple times delimited with an ampersand (`&`) between each namespace. Omit this parameter to return results for all namespaces." + in: query + name: namespaces + schema: + items: + type: string + type: array + style: form + - description: |- + Date and time from which the query retrieves the suggested indexes. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). + + - If you don't specify the **until** parameter, the endpoint returns data covering from the **since** value and the current time. + - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: since + schema: + format: int64 + minimum: 1199145600000 + type: integer + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + - description: |- + Date and time up until which the query retrieves the suggested indexes. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). + + - If you specify the **until** parameter, you must specify the **since** parameter. + - If you specify neither the **since** nor the **until** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: until + schema: + format: int64 + minimum: 1199145600000 + type: integer + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PerformanceAdvisorResponse" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Suggested Indexes + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listClusterSuggestedIndexes --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListClusterSuggestedIndexesApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + ListClusterSuggestedIndexesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/suggestedIndexes?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/performanceAdvisor/suggestedIndexes?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/listClusterSuggestedIndexes + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs: + get: + description: "Returns the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, flex clusters, or serverless clusters. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Deprecated versions: v2-{2023-01-01}" + externalDocs: + description: Global Clusters + url: https://www.mongodb.com/docs/atlas/global-clusters/ + operationId: getClusterAdvancedConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ClusterDescriptionProcessArgs20240805" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Advanced Configuration Options for One Cluster + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getClusterAdvancedConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetClusterAdvancedConfigurationApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + GetClusterAdvancedConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/getClusterAdvancedConfiguration + patch: + description: "Updates the advanced configuration details for one cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. Advanced configuration details include the read/write concern, index and oplog limits, and other database settings. To use this resource, the requesting Service Account or API Key must have the Project Cluster Manager role. This feature isn't available for `M0` free clusters, `M2` and `M5` shared-tier clusters, flex clusters, or serverless clusters. Deprecated versions: v2-{2023-01-01}" + externalDocs: + description: Global Clusters + url: https://www.mongodb.com/docs/atlas/global-clusters/ + operationId: updateClusterAdvancedConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ClusterDescriptionProcessArgs20240805" + x-xgen-version: 2024-08-05 + description: Advanced configuration details to add for one cluster in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ClusterDescriptionProcessArgs20240805" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Advanced Configuration Options for One Cluster + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateClusterAdvancedConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateClusterAdvancedConfigurationApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + UpdateClusterAdvancedConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/updateClusterAdvancedConfiguration + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restartPrimaries: + post: + description: "Starts a failover test for the specified cluster in the specified project. Clusters contain a group of hosts that maintain the same data set. A failover test checks how MongoDB Cloud handles the failure of the cluster's primary node. During the test, MongoDB Cloud shuts down the primary node and elects a new primary. To use this resource, the requesting Service Account or API Key must have the Project Cluster Manager role. Deprecated versions: v2-{2023-01-01}" + operationId: testFailover + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Test Failover for One Cluster + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api testFailover --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.TestFailoverApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + TestFailoverWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restartPrimaries" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restartPrimaries" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/testFailover + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restoreJobs: + get: + deprecated: true + description: |- + Returns all legacy backup restore jobs for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation. If you use the `BATCH-ID` query parameter, you can retrieve all restore jobs in the specified batch. When creating a restore job for a sharded cluster, MongoDB Cloud creates a separate job for each shard, plus another for the config server. Each of those jobs are part of a batch. However, a batch can't include a restore job for a replica set. + externalDocs: + description: Cloud Backup Documentation + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/scheduling/#std-label-cloud-provider-backup-schedule + operationId: listLegacyBackupRestoreJobs + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Unique 24-hexadecimal digit string that identifies the batch of restore jobs to return. Timestamp in ISO 8601 date and time format in UTC when creating a restore job for a sharded cluster, Application creates a separate job for each shard, plus another for the config host. Each of these jobs comprise one batch. A restore job for a replica set can't be part of a batch. + in: query + name: batchId + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: Human-readable label that identifies the cluster with the snapshot you want to return. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedRestoreJob" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Legacy Backup Restore Jobs + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listLegacyBackupRestoreJobs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListLegacyBackupRestoreJobsApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + ListLegacyBackupRestoreJobsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restoreJobs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restoreJobs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/listLegacyBackupRestoreJobs + post: + deprecated: true + description: Restores one legacy backup for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation. This endpoint doesn't support creating checkpoint restore jobs for sharded clusters, or creating restore jobs for queryable backup snapshots. If you create an automated restore job by specifying `delivery.methodName` of `AUTOMATED_RESTORE` in your request body, MongoDB Cloud removes all existing data on the target cluster prior to the restore. + externalDocs: + description: Cloud Backup Documentation + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/scheduling/#std-label-cloud-provider-backup-schedule + operationId: createLegacyBackupRestoreJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster with the snapshot you want to return. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupRestoreJob" + description: Legacy backup to restore to one cluster in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedRestoreJob" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Legacy Backup Restore Job + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createLegacyBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateLegacyBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + CreateLegacyBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restoreJobs" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restoreJobs" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/createLegacyBackupRestoreJob + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restoreJobs/{jobId}: + get: + deprecated: true + description: |- + Returns one legacy backup restore job for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation. + externalDocs: + description: Cloud Backup Documentation + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/scheduling/#std-label-cloud-provider-backup-schedule + operationId: getLegacyBackupRestoreJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster with the snapshot you want to return. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the restore job. + in: path + name: jobId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupRestoreJob" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-response-has-no-input-fields: API predates IPA validation + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Legacy Backup Restore Job + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getLegacyBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetLegacyBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + GetLegacyBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restoreJobs/{jobId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/restoreJobs/{jobId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/getLegacyBackupRestoreJob + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment: + delete: + description: Deletes the Search Nodes for the specified cluster. + operationId: deleteAtlasSearchDeployment + parameters: + - $ref: "#/components/parameters/groupId" + - description: Label that identifies the cluster to delete. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "204": + content: + application/vnd.atlas.2024-05-30+json: + x-xgen-version: 2024-05-30 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete Search Nodes + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteAtlasSearchDeployment --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteAtlasSearchDeploymentApiParams{} + httpResp, err := client.AtlasSearchApi. + DeleteAtlasSearchDeploymentWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/deleteAtlasSearchDeployment + get: + description: "Returns the Search Nodes for the specified cluster. Deprecated versions: v2-{2024-05-30}, v2-{2023-01-01}" + operationId: getAtlasSearchDeployment + parameters: + - $ref: "#/components/parameters/groupId" + - description: Label that identifies the cluster to return the Search Nodes for. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2025-03-12+json: + schema: + $ref: "#/components/schemas/ApiSearchDeploymentResponse" + x-xgen-version: 2025-03-12 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Search Nodes + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAtlasSearchDeployment --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAtlasSearchDeploymentApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + GetAtlasSearchDeploymentWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment?pretty=true" + x-xgen-changelog: + 2025-03-12: Updates the return of the API when no nodes exist, the endpoint returns 200 with an empty JSON ({}) instead of 400. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/getAtlasSearchDeployment + patch: + description: "Updates the Search Nodes for the specified cluster. Deprecated versions: v2-{2023-01-01}" + operationId: updateAtlasSearchDeployment + parameters: + - $ref: "#/components/parameters/groupId" + - description: Label that identifies the cluster to update the Search Nodes for. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/ApiSearchDeploymentRequest" + description: Updates the Search Nodes for the specified cluster. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/ApiSearchDeploymentResponse" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Search Nodes + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateAtlasSearchDeployment --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateAtlasSearchDeploymentApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + UpdateAtlasSearchDeploymentWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/updateAtlasSearchDeployment + post: + description: Creates Search Nodes for the specified cluster. + operationId: createAtlasSearchDeployment + parameters: + - $ref: "#/components/parameters/groupId" + - description: Label that identifies the cluster to create Search Nodes for. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/ApiSearchDeploymentRequest" + description: Creates Search Nodes for the specified cluster. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/ApiSearchDeploymentResponse" + x-xgen-version: 2024-05-30 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create Search Nodes + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createAtlasSearchDeployment --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateAtlasSearchDeploymentApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + CreateAtlasSearchDeploymentWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/createAtlasSearchDeployment + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes: + get: + description: Returns all Atlas Search indexes on the specified cluster. Atlas Search indexes contain the indexed fields and the analyzers used to create the indexes. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Write role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: listAtlasSearchIndexesCluster + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection with one or more Atlas Search indexes. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + items: + $ref: "#/components/schemas/SearchIndexResponse" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + "503": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/ApiError" + description: Service Unavailable. + summary: Return All Atlas Search Indexes for One Cluster + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAtlasSearchIndexesCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAtlasSearchIndexesClusterApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + ListAtlasSearchIndexesClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/listAtlasSearchIndexesCluster + post: + description: Creates one Atlas Search index on the specified collection. Atlas Search indexes define the fields on which to create the index and the analyzers to use when creating the index. Only clusters running MongoDB v4.2 or later can use Atlas Search. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: createAtlasSearchIndex + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection on which to create an Atlas Search index. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/SearchIndexCreateRequest" + description: Creates one Atlas Search index on the specified collection. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/SearchIndexResponse" + x-xgen-version: 2024-05-30 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Atlas Search Index + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createAtlasSearchIndex --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateAtlasSearchIndexApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + CreateAtlasSearchIndexWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/createAtlasSearchIndex + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}: + get: + description: Returns all Atlas Search indexes on the specified collection. Atlas Search indexes contain the indexed fields and the analyzers used to create the indexes. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Write role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: listAtlasSearchIndexes + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection with one or more Atlas Search indexes. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Name of the collection that contains one or more Atlas Search indexes. + in: path + name: collectionName + required: true + schema: + type: string + - description: Label that identifies the database that contains the collection with one or more Atlas Search indexes. + in: path + name: databaseName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + items: + $ref: "#/components/schemas/SearchIndexResponse" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + "503": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/ApiError" + description: Service Unavailable. + summary: Return All Atlas Search Indexes for One Collection + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAtlasSearchIndexes --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAtlasSearchIndexesApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + ListAtlasSearchIndexesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/listAtlasSearchIndexes + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}/{indexName}: + delete: + description: Removes one Atlas Search index that you identified with its database, collection, and name. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. This deletion is eventually consistent. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: deleteAtlasSearchIndexByName + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the database and collection with one or more Application Search indexes. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Name of the collection that contains one or more Atlas Search indexes. + in: path + name: collectionName + required: true + schema: + type: string + - description: Label that identifies the database that contains the collection with one or more Atlas Search indexes. + in: path + name: databaseName + required: true + schema: + type: string + - description: Name of the Atlas Search index to delete. + in: path + name: indexName + required: true + schema: + type: string + responses: + "204": + content: + application/vnd.atlas.2024-05-30+json: + x-xgen-version: 2024-05-30 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Atlas Search Index by Name + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteAtlasSearchIndexByName --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteAtlasSearchIndexByNameApiParams{} + httpResp, err := client.AtlasSearchApi. + DeleteAtlasSearchIndexByNameWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}/{indexName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}/{indexName}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/deleteAtlasSearchIndexByName + get: + description: Returns one Atlas Search index in the specified project. You identify this index using its database, collection and name. Atlas Search index contains the indexed fields and the analyzers used to create the index. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Write role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: getAtlasSearchIndexByName + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection with one or more Atlas Search indexes. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Name of the collection that contains one or more Atlas Search indexes. + in: path + name: collectionName + required: true + schema: + type: string + - description: Label that identifies the database that contains the collection with one or more Atlas Search indexes. + in: path + name: databaseName + required: true + schema: + type: string + - description: Name of the Atlas Search index to return. + in: path + name: indexName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/SearchIndexResponse" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Atlas Search Index by Name + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAtlasSearchIndexByName --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAtlasSearchIndexByNameApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + GetAtlasSearchIndexByNameWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}/{indexName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}/{indexName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/getAtlasSearchIndexByName + patch: + description: Updates one Atlas Search index that you identified with its database, collection name, and index name. Atlas Search indexes define the fields on which to create the index and the analyzers to use when creating the index. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: updateAtlasSearchIndexByName + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection whose Atlas Search index you want to update. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Name of the collection that contains one or more Atlas Search indexes. + in: path + name: collectionName + required: true + schema: + type: string + - description: Label that identifies the database that contains the collection with one or more Atlas Search indexes. + in: path + name: databaseName + required: true + schema: + type: string + - description: Name of the Atlas Search index to update. + in: path + name: indexName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/SearchIndexUpdateRequest" + description: Details to update the Atlas Search index with. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/SearchIndexResponse" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Atlas Search Index by Name + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateAtlasSearchIndexByName --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateAtlasSearchIndexByNameApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + UpdateAtlasSearchIndexByNameWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}/{indexName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{databaseName}/{collectionName}/{indexName}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/updateAtlasSearchIndexByName + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{indexId}: + delete: + description: Removes one Atlas Search index that you identified with its unique ID. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. This deletion is eventually consistent. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: deleteAtlasSearchIndex + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the database and collection with one or more Application Search indexes. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the Atlas Search index. Use the [Get All Atlas Search Indexes for a Collection API](https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-all/) endpoint to find the IDs of all Atlas Search indexes. + in: path + name: indexId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + responses: + "204": + content: + application/vnd.atlas.2024-05-30+json: + x-xgen-version: 2024-05-30 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Atlas Search Index by ID + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteAtlasSearchIndex --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteAtlasSearchIndexApiParams{} + httpResp, err := client.AtlasSearchApi. + DeleteAtlasSearchIndexWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{indexId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{indexId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/deleteAtlasSearchIndex + get: + description: Returns one Atlas Search index in the specified project. You identify this index using its unique ID. Atlas Search index contains the indexed fields and the analyzers used to create the index. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Write role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: getAtlasSearchIndex + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection with one or more Atlas Search indexes. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the Application Search [index](https://dochub.mongodb.org/core/index-definitions-fts). Use the [Get All Application Search Indexes for a Collection API](https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-all/) endpoint to find the IDs of all Application Search indexes. + in: path + name: indexId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/SearchIndexResponse" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + "503": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/ApiError" + description: Service Unavailable. + summary: Return One Atlas Search Index by ID + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAtlasSearchIndex --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAtlasSearchIndexApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + GetAtlasSearchIndexWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{indexId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{indexId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/getAtlasSearchIndex + patch: + description: Updates one Atlas Search index that you identified with its unique ID. Atlas Search indexes define the fields on which to create the index and the analyzers to use when creating the index. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role. + externalDocs: + description: Atlas Search Indexes + url: https://dochub.mongodb.org/core/index-definitions-fts + operationId: updateAtlasSearchIndex + parameters: + - $ref: "#/components/parameters/groupId" + - description: Name of the cluster that contains the collection whose Atlas Search index you want to update. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the Atlas Search [index](https://dochub.mongodb.org/core/index-definitions-fts). Use the [Get All Atlas Search Indexes for a Collection API](https://docs.atlas.mongodb.com/reference/api/fts-indexes-get-all/) endpoint to find the IDs of all Atlas Search indexes. + in: path + name: indexId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/SearchIndexUpdateRequest" + description: Details to update on the Atlas Search index. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/SearchIndexResponse" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Atlas Search Index by ID + tags: + - Atlas Search + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateAtlasSearchIndex --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateAtlasSearchIndexApiParams{} + sdkResp, httpResp, err := client.AtlasSearchApi. + UpdateAtlasSearchIndexWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{indexId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/indexes/{indexId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Atlas-Search/operation/updateAtlasSearchIndex + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshotSchedule: + get: + deprecated: true + description: |- + Returns the snapshot schedule for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation. + externalDocs: + description: Cloud Backup Documentation + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/scheduling/#std-label-cloud-provider-backup-schedule + operationId: getLegacySnapshotSchedule + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster with the snapshot you want to return. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiAtlasSnapshotSchedule" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Snapshot Schedule + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getLegacySnapshotSchedule --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetLegacySnapshotScheduleApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + GetLegacySnapshotScheduleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshotSchedule?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshotSchedule?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/getLegacySnapshotSchedule + patch: + deprecated: true + description: |- + Updates the snapshot schedule for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation. + externalDocs: + description: Cloud Backup Documentation + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/scheduling/#std-label-cloud-provider-backup-schedule + operationId: updateLegacySnapshotSchedule + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster with the snapshot you want to return. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiAtlasSnapshotSchedule" + description: Update the snapshot schedule for one cluster in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiAtlasSnapshotSchedule" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Snapshot Schedule for One Cluster + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateLegacySnapshotSchedule --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateLegacySnapshotScheduleApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + UpdateLegacySnapshotScheduleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshotSchedule" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshotSchedule" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/updateLegacySnapshotSchedule + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots: + get: + deprecated: true + description: Returns all legacy backup snapshots for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation. + externalDocs: + description: Cloud Backup Documentation + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/scheduling/#std-label-cloud-provider-backup-schedule + operationId: listLegacySnapshots + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Human-readable label that specifies whether to return only completed, incomplete, or all snapshots. By default, MongoDB Cloud only returns completed snapshots. + in: query + name: completed + schema: + default: "true" + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedSnapshot" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Legacy Backup Snapshots + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listLegacySnapshots --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListLegacySnapshotsApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + ListLegacySnapshotsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/listLegacySnapshots + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots/{snapshotId}: + delete: + deprecated: true + description: Removes one legacy backup snapshot for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation. + externalDocs: + description: Cloud Backup Documentation + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/scheduling/#std-label-cloud-provider-backup-schedule + operationId: deleteLegacySnapshot + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Legacy Backup Snapshot + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteLegacySnapshot --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteLegacySnapshotApiParams{} + httpResp, err := client.LegacyBackupApi. + DeleteLegacySnapshotWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots/{snapshotId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots/{snapshotId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/deleteLegacySnapshot + get: + deprecated: true + description: Returns one legacy backup snapshot for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation. + externalDocs: + description: Cloud Backup Documentation + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/scheduling/#std-label-cloud-provider-backup-schedule + operationId: getLegacySnapshot + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupSnapshot" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Legacy Backup Snapshot + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getLegacySnapshot --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetLegacySnapshotApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + GetLegacySnapshotWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots/{snapshotId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots/{snapshotId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/getLegacySnapshot + patch: + deprecated: true + description: Changes the expiration date for one legacy backup snapshot for one cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Effective 23 March 2020, all new clusters can use only Cloud Backups. When you upgrade to 4.2, your backup system upgrades to cloud backup if it is currently set to legacy backup. After this upgrade, all your existing legacy backup snapshots remain available. They expire over time in accordance with your retention policy. Your backup policy resets to the default schedule. If you had a custom backup policy in place with legacy backups, you must re-create it with the procedure outlined in the Cloud Backup documentation. + externalDocs: + description: Cloud Backup Documentation + url: https://www.mongodb.com/docs/atlas/backup/cloud-backup/scheduling/#std-label-cloud-provider-backup-schedule + operationId: updateLegacySnapshotRetention + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupSnapshot" + description: Changes One Legacy Backup Snapshot Expiration. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BackupSnapshot" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Expiration Date for One Legacy Backup Snapshot + tags: + - Legacy Backup + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateLegacySnapshotRetention --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateLegacySnapshotRetentionApiParams{} + sdkResp, httpResp, err := client.LegacyBackupApi. + UpdateLegacySnapshotRetentionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots/{snapshotId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/snapshots/{snapshotId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Legacy-Backup/operation/updateLegacySnapshotRetention + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/status: + get: + description: Returns the status of all changes that you made to the specified cluster in the specified project. Use this resource to check the progress MongoDB Cloud has made in processing your changes. The response does not include the deployment of new dedicated clusters. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getClusterStatus + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ClusterStatus" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Status of All Cluster Operations + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getClusterStatus --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetClusterStatusApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + GetClusterStatusWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/status?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/status?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/getClusterStatus + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}:grantMongoDBEmployeeAccess: + post: + description: Grants MongoDB employee cluster access for the given duration and at the specified level for one cluster. + operationId: grantMongoDbEmployeeAccess + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/EmployeeAccessGrant" + x-xgen-version: 2024-08-05 + description: Grant access level and expiration. + required: true + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Grant MongoDB Employee Cluster Access for One Cluster + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api grantMongoDbEmployeeAccess --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GrantMongoDbEmployeeAccessApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + GrantMongoDbEmployeeAccessWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}:grantMongoDBEmployeeAccess" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}:grantMongoDBEmployeeAccess" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/grantMongoDbEmployeeAccess + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}:pinFeatureCompatibilityVersion: + post: + description: Pins the Feature Compatibility Version (FCV) to the current MongoDB version and sets the pin expiration date. If an FCV pin already exists for the cluster, calling this method will only update the expiration date of the existing pin and will not repin the FCV. + operationId: pinFeatureCompatibilityVersion + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/PinFCV" + x-xgen-version: 2024-05-30 + description: Optional request params for tuning FCV pinning configuration. + responses: + "204": + content: + application/vnd.atlas.2024-05-30+json: + x-xgen-version: 2024-05-30 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Pin Feature Compatibility Version for One Cluster in One Project + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api pinFeatureCompatibilityVersion --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.PinFeatureCompatibilityVersionApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + PinFeatureCompatibilityVersionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}:pinFeatureCompatibilityVersion" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}:pinFeatureCompatibilityVersion" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/pinFeatureCompatibilityVersion + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}:revokeMongoDBEmployeeAccess: + post: + description: Revokes a previously granted MongoDB employee cluster access. + operationId: revokeMongoDbEmployeeAccess + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Revoke MongoDB Employee Cluster Access for One Cluster + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api revokeMongoDbEmployeeAccess --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RevokeMongoDbEmployeeAccessApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + RevokeMongoDbEmployeeAccessWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}:revokeMongoDBEmployeeAccess" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}:revokeMongoDBEmployeeAccess" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/revokeMongoDbEmployeeAccess + /api/atlas/v2/groups/{groupId}/clusters/{clusterName}:unpinFeatureCompatibilityVersion: + post: + description: Unpins the current fixed Feature Compatibility Version (FCV). This feature is not available for clusters on rapid release. + operationId: unpinFeatureCompatibilityVersion + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies this cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "204": + content: + application/vnd.atlas.2024-05-30+json: + x-xgen-version: 2024-05-30 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Unpin Feature Compatibility Version for One Cluster in One Project + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api unpinFeatureCompatibilityVersion --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UnpinFeatureCompatibilityVersionApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + UnpinFeatureCompatibilityVersionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}:unpinFeatureCompatibilityVersion" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{clusterName}:unpinFeatureCompatibilityVersion" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/unpinFeatureCompatibilityVersion + /api/atlas/v2/groups/{groupId}/clusters/{hostName}/logs/{logName}.gz: + get: + description: "Returns a compressed (.gz) log file that contains a range of log messages for the specified host for the specified project. MongoDB updates process and audit logs from the cluster backend infrastructure every five minutes. Logs are stored in chunks approximately five minutes in length, but this duration may vary. If you poll the API for log files, we recommend polling every five minutes even though consecutive polls could contain some overlapping logs. This feature isn't available for `M0` free clusters, `M2`, `M5`, flex, or serverless clusters. To use this resource, the requesting Service Account or API Key must have the Project Data Access Read Only or higher role. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: \"Accept: application/vnd.atlas.YYYY-MM-DD+gzip\". Deprecated versions: v2-{2023-01-01}" + operationId: getHostLogs + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the host that stores the log files that you want to download. + in: path + name: hostName + required: true + schema: + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?$ + type: string + - description: Human-readable label that identifies the log file that you want to return. To return audit logs, enable *Database Auditing* for the specified project. + in: path + name: logName + required: true + schema: + externalDocs: + description: Set up Database Auditing + url: https://docs.atlas.mongodb.com/database-auditing/ + type: string + - description: Specifies the date and time for the ending point of the range of log messages to retrieve, in the number of seconds that have elapsed since the UNIX epoch. This value will default to 24 hours after the start date. If the start date is also unspecified, the value will default to the time of the request. + in: query + name: endDate + schema: + format: int64 + minimum: 1199145600 + type: integer + - description: Specifies the date and time for the starting point of the range of log messages to retrieve, in the number of seconds that have elapsed since the UNIX epoch. This value will default to 24 hours prior to the end date. If the end date is also unspecified, the value will default to 24 hours prior to the time of the request. + in: query + name: startDate + schema: + format: int64 + minimum: 1199145600 + type: integer + responses: + "200": + content: + application/vnd.atlas.2023-02-01+gzip: + schema: + description: Compressed (.gz) log file that contains a range of log messages for the specified host for the specified project + format: binary + type: string + x-xgen-version: 2023-02-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Download Logs for One Cluster Host in One Project + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getHostLogs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetHostLogsApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + GetHostLogsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{hostName}/logs/{logName}.gz?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/{hostName}/logs/{logName}.gz?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/getHostLogs + /api/atlas/v2/groups/{groupId}/clusters/provider/regions: + get: + description: Returns the list of regions available for the specified cloud provider at the specified tier. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listCloudProviderRegions + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Cloud providers whose regions to retrieve. When you specify multiple providers, the response can return only tiers and regions that support multi-cloud clusters. + in: query + name: providers + schema: + items: + type: string + type: array + - description: Cluster tier for which to retrieve the regions. + in: query + name: tier + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiAtlasProviderRegions" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Cloud Provider Regions + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listCloudProviderRegions --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListCloudProviderRegionsApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + ListCloudProviderRegionsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/provider/regions?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/provider/regions?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/listCloudProviderRegions + /api/atlas/v2/groups/{groupId}/clusters/tenantUpgrade: + post: + description: |- + Upgrades a shared-tier cluster to a Flex or Dedicated (M10+) cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Cluster Manager role. Each project supports up to 25 clusters. + + This endpoint can also be used to upgrade Flex clusters that were created using the [createCluster](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster) API or former M2/M5 clusters that have been migrated to Flex clusters, using instanceSizeName to “M2” or “M5” until January 2026. This functionality will be available until January 2026, after which it will only be available for M0 clusters. Please use the upgradeFlexCluster endpoint instead. + externalDocs: + description: upgradeFlexCluster + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/upgradeFlexCluster + operationId: upgradeSharedCluster + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest" + description: Details of the shared-tier cluster upgrade in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/LegacyAtlasCluster" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Upgrade One Shared-Tier Cluster + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api upgradeSharedCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpgradeSharedClusterApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + UpgradeSharedClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/tenantUpgrade" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/tenantUpgrade" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/upgradeSharedCluster + /api/atlas/v2/groups/{groupId}/clusters/tenantUpgradeToServerless: + post: + deprecated: true + description: |- + This endpoint has been deprecated as of February 2025 as we no longer support the creation of new serverless instances. Please use the upgradeFlexCluster endpoint to upgrade Flex clusters. + + Upgrades a shared-tier cluster to a serverless instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Cluster Manager role. + externalDocs: + description: upgradeFlexCluster + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/upgradeFlexCluster + operationId: upgradeSharedClusterToServerless + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessInstanceDescription" + description: Details of the shared-tier cluster upgrade in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessInstanceDescription" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Upgrade One Shared-Tier Cluster to One Serverless Instance + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api upgradeSharedClusterToServerless --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpgradeSharedClusterToServerlessApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + UpgradeSharedClusterToServerlessWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/tenantUpgradeToServerless" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/clusters/tenantUpgradeToServerless" \ + -d '{ }' + x-sunset: 2025-02-05 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/upgradeSharedClusterToServerless + /api/atlas/v2/groups/{groupId}/collStats/metrics: + get: + description: Returns all available Coll Stats Latency metric names and their respective units for the specified project at the time of request. + operationId: getCollStatsLatencyNamespaceMetrics + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + x-xgen-version: 2023-11-15 + description: Succeeded + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return all metric names + tags: + - Collection Level Metrics + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getCollStatsLatencyNamespaceMetrics --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetCollStatsLatencyNamespaceMetricsApiParams{} + sdkResp, httpResp, err := client.CollectionLevelMetricsApi. + GetCollStatsLatencyNamespaceMetricsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/collStats/metrics?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/collStats/metrics?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/getCollStatsLatencyNamespaceMetrics + /api/atlas/v2/groups/{groupId}/containers: + get: + description: Returns details about all network peering containers in the specified project for the specified cloud provider. If you do not specify the cloud provider, MongoDB Cloud returns details about all network peering containers in the project for Amazon Web Services (AWS). To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listPeeringContainerByCloudProvider + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Cloud service provider that serves the desired network peering containers. + in: query + name: providerName + required: true + schema: + default: AWS + type: string + x-xgen-IPA-exception: + xgen-IPA-119-no-default-for-cloud-providers: Schema predates IPA validation + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedCloudProviderContainer" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Network Peering Containers in One Project for One Cloud Provider + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPeeringContainerByCloudProvider --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPeeringContainerByCloudProviderApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + ListPeeringContainerByCloudProviderWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/listPeeringContainerByCloudProvider + post: + description: Creates one new network peering container in the specified project. MongoDB Cloud can deploy Network Peering connections in a network peering container. GCP can have one container per project. AWS and Azure can have one container per cloud provider region. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: createPeeringContainer + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderContainer" + description: Creates one new network peering container in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderContainer" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Network Peering Container + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createPeeringContainer --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreatePeeringContainerApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + CreatePeeringContainerWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/createPeeringContainer + /api/atlas/v2/groups/{groupId}/containers/{containerId}: + delete: + description: Removes one network peering container in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deletePeeringContainer + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud network container that you want to remove. + in: path + name: containerId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Network Peering Container + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deletePeeringContainer --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeletePeeringContainerApiParams{} + httpResp, err := client.NetworkPeeringApi. + DeletePeeringContainerWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers/{containerId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers/{containerId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/deletePeeringContainer + get: + description: Returns details about one network peering container in one specified project. Network peering containers contain network peering connections. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getPeeringContainer + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud network container. + in: path + name: containerId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderContainer" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Network Peering Container + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPeeringContainer --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPeeringContainerApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + GetPeeringContainerWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers/{containerId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers/{containerId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/getPeeringContainer + patch: + description: Updates the network details and labels of one specified network peering container in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: updatePeeringContainer + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud network container that you want to remove. + in: path + name: containerId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderContainer" + description: Updates the network details and labels of one specified network peering container in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderContainer" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Network Peering Container + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updatePeeringContainer --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdatePeeringContainerApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + UpdatePeeringContainerWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers/{containerId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers/{containerId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/updatePeeringContainer + /api/atlas/v2/groups/{groupId}/containers/all: + get: + description: Returns details about all network peering containers in the specified project. Network peering containers contain network peering connections. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listPeeringContainers + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedCloudProviderContainer" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Network Peering Containers in One Project + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPeeringContainers --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPeeringContainersApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + ListPeeringContainersWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers/all?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/containers/all?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/listPeeringContainers + /api/atlas/v2/groups/{groupId}/customDBRoles/roles: + get: + description: Returns all custom roles for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listCustomDatabaseRoles + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/UserCustomDBRole" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Custom Roles in One Project + tags: + - Custom Database Roles + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listCustomDatabaseRoles --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListCustomDatabaseRolesApiParams{} + sdkResp, httpResp, err := client.CustomDatabaseRolesApi. + ListCustomDatabaseRolesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/listCustomDatabaseRoles + post: + description: Creates one custom role in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Stream Processing Owner role, or the Project Database Access Admin role. + operationId: createCustomDatabaseRole + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserCustomDBRole" + description: Creates one custom role in the specified project. + required: true + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserCustomDBRole" + x-xgen-version: 2023-01-01 + description: Accepted + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Custom Role + tags: + - Custom Database Roles + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createCustomDatabaseRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateCustomDatabaseRoleApiParams{} + sdkResp, httpResp, err := client.CustomDatabaseRolesApi. + CreateCustomDatabaseRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/createCustomDatabaseRole + /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}: + delete: + description: Removes one custom role from the specified project. You can't remove a custom role that would leave one or more child roles with no parent roles or actions. You also can't remove a custom role that would leave one or more database users without roles. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Stream Processing Owner role, or the Project Database Access Admin role. + operationId: deleteCustomDatabaseRole + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. + in: path + name: roleName + required: true + schema: + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: No Content + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Custom Role from One Project + tags: + - Custom Database Roles + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteCustomDatabaseRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteCustomDatabaseRoleApiParams{} + httpResp, err := client.CustomDatabaseRolesApi. + DeleteCustomDatabaseRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/deleteCustomDatabaseRole + get: + description: Returns one custom role for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getCustomDatabaseRole + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. + in: path + name: roleName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserCustomDBRole" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Custom Role in One Project + tags: + - Custom Database Roles + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getCustomDatabaseRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetCustomDatabaseRoleApiParams{} + sdkResp, httpResp, err := client.CustomDatabaseRolesApi. + GetCustomDatabaseRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/getCustomDatabaseRole + patch: + description: Updates one custom role in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Stream Processing Owner role, or the Project Database Access Admin role. + operationId: updateCustomDatabaseRole + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the role for the request. This name must beunique for this custom role in this project. + in: path + name: roleName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UpdateCustomDBRole" + description: Updates one custom role in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserCustomDBRole" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Custom Role in One Project + tags: + - Custom Database Roles + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateCustomDatabaseRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateCustomDatabaseRoleApiParams{} + sdkResp, httpResp, err := client.CustomDatabaseRolesApi. + UpdateCustomDatabaseRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Custom-Database-Roles/operation/updateCustomDatabaseRole + /api/atlas/v2/groups/{groupId}/dataFederation: + get: + description: Returns the details of all federated database instances in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only or higher role. + operationId: listFederatedDatabases + parameters: + - $ref: "#/components/parameters/groupId" + - description: Type of Federated Database Instances to return. + in: query + name: type + schema: + default: USER + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/DataLakeTenant" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Federated Database Instances in One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listFederatedDatabases --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListFederatedDatabasesApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + ListFederatedDatabasesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/listFederatedDatabases + post: + description: Creates one federated database instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Charts Admin roles. + operationId: createFederatedDatabase + parameters: + - $ref: "#/components/parameters/groupId" + - description: Flag that indicates whether this request should check if the requesting IAM role can read from the S3 bucket. AWS checks if the role can list the objects in the bucket before writing to it. Some IAM roles only need write permissions. This flag allows you to skip that check. + in: query + name: skipRoleValidation + schema: + default: false + type: boolean + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeTenant" + description: Details to create one federated database instance in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeTenant" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Federated Database Instance in One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createFederatedDatabase --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateFederatedDatabaseApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + CreateFederatedDatabaseWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/createFederatedDatabase + /api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}: + delete: + description: Removes one federated database instance from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Charts Admin roles. + operationId: deleteFederatedDatabase + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the federated database instance to remove. + in: path + name: tenantName + required: true + schema: + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Federated Database Instance from One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteFederatedDatabase --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteFederatedDatabaseApiParams{} + httpResp, err := client.DataFederationApi. + DeleteFederatedDatabaseWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/deleteFederatedDatabase + get: + description: Returns the details of one federated database instance within the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only or Project Charts Admin roles. + operationId: getFederatedDatabase + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Federated Database to return. + in: path + name: tenantName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeTenant" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-response-has-no-input-fields: Content predates IPA validation + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Federated Database Instance in One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getFederatedDatabase --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetFederatedDatabaseApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + GetFederatedDatabaseWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/getFederatedDatabase + patch: + description: Updates the details of one federated database instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner or higher role. + operationId: updateFederatedDatabase + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the federated database instance to update. + in: path + name: tenantName + required: true + schema: + type: string + - description: Flag that indicates whether this request should check if the requesting IAM role can read from the S3 bucket. AWS checks if the role can list the objects in the bucket before writing to it. Some IAM roles only need write permissions. This flag allows you to skip that check. + in: query + name: skipRoleValidation + required: true + schema: + type: boolean + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeTenant" + description: Details of one Federated Database to update in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeTenant" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Federated Database Instance in One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateFederatedDatabase --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateFederatedDatabaseApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + UpdateFederatedDatabaseWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/updateFederatedDatabase + /api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits: + get: + description: Returns query limits for a federated databases instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: returnFederatedDatabaseQueryLimits + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the federated database instance for which you want to retrieve query limits. + in: path + name: tenantName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/DataFederationTenantQueryLimit" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Query Limits for One Federated Database Instance + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api returnFederatedDatabaseQueryLimits --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ReturnFederatedDatabaseQueryLimitsApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + ReturnFederatedDatabaseQueryLimitsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/returnFederatedDatabaseQueryLimits + /api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits/{limitName}: + delete: + description: Deletes one query limit for one federated database instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deleteOneDataFederationInstanceQueryLimit + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the federated database instance to which the query limit applies. + in: path + name: tenantName + required: true + schema: + type: string + - description: | + Human-readable label that identifies this data federation instance limit. + + | Limit Name | Description | Default | + | --- | --- | --- | + | bytesProcessed.query | Limit on the number of bytes processed during a single data federation query | N/A | + | bytesProcessed.daily | Limit on the number of bytes processed for the data federation instance for the current day | N/A | + | bytesProcessed.weekly | Limit on the number of bytes processed for the data federation instance for the current week | N/A | + | bytesProcessed.monthly | Limit on the number of bytes processed for the data federation instance for the current month | N/A | + in: path + name: limitName + required: true + schema: + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Query Limit for One Federated Database Instance + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteOneDataFederationInstanceQueryLimit --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteOneDataFederationInstanceQueryLimitApiParams{} + httpResp, err := client.DataFederationApi. + DeleteOneDataFederationInstanceQueryLimitWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits/{limitName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits/{limitName}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/deleteOneDataFederationInstanceQueryLimit + get: + description: Returns the details of one query limit for the specified federated database instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: returnFederatedDatabaseQueryLimit + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the federated database instance to which the query limit applies. + in: path + name: tenantName + required: true + schema: + type: string + - description: | + Human-readable label that identifies this data federation instance limit. + + | Limit Name | Description | Default | + | --- | --- | --- | + | bytesProcessed.query | Limit on the number of bytes processed during a single data federation query | N/A | + | bytesProcessed.daily | Limit on the number of bytes processed for the data federation instance for the current day | N/A | + | bytesProcessed.weekly | Limit on the number of bytes processed for the data federation instance for the current week | N/A | + | bytesProcessed.monthly | Limit on the number of bytes processed for the data federation instance for the current month | N/A | + in: path + name: limitName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataFederationTenantQueryLimit" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Federated Database Instance Query Limit for One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api returnFederatedDatabaseQueryLimit --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ReturnFederatedDatabaseQueryLimitApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + ReturnFederatedDatabaseQueryLimitWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits/{limitName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits/{limitName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/returnFederatedDatabaseQueryLimit + patch: + description: Creates or updates one query limit for one federated database instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: createOneDataFederationQueryLimit + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the federated database instance to which the query limit applies. + in: path + name: tenantName + required: true + schema: + type: string + - description: | + Human-readable label that identifies this data federation instance limit. + + | Limit Name | Description | Default | + | --- | --- | --- | + | bytesProcessed.query | Limit on the number of bytes processed during a single data federation query | N/A | + | bytesProcessed.daily | Limit on the number of bytes processed for the data federation instance for the current day | N/A | + | bytesProcessed.weekly | Limit on the number of bytes processed for the data federation instance for the current week | N/A | + | bytesProcessed.monthly | Limit on the number of bytes processed for the data federation instance for the current month | N/A | + in: path + name: limitName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataFederationTenantQueryLimit" + description: Creates or updates one query limit for one federated database instance. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataFederationTenantQueryLimit" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Configure One Query Limit for One Federated Database Instance + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createOneDataFederationQueryLimit --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateOneDataFederationQueryLimitApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + CreateOneDataFederationQueryLimitWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits/{limitName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits/{limitName}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/createOneDataFederationQueryLimit + /api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/queryLogs.gz: + get: + description: 'Downloads the query logs for the specified federated database instance. To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Data Access Read Write roles. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: "Accept: application/vnd.atlas.YYYY-MM-DD+gzip".' + operationId: downloadFederatedDatabaseQueryLogs + parameters: + - $ref: "#/components/parameters/groupId" + - description: Timestamp that specifies the end point for the range of log messages to download. MongoDB Cloud expresses this timestamp in the number of seconds that have elapsed since the UNIX epoch. + in: query + name: endDate + schema: + example: 1636481348 + format: int64 + pattern: "1199145600" + type: integer + - description: Timestamp that specifies the starting point for the range of log messages to download. MongoDB Cloud expresses this timestamp in the number of seconds that have elapsed since the UNIX epoch. + in: query + name: startDate + schema: + example: 1636466948 + format: int64 + pattern: "1199145600" + type: integer + - description: Human-readable label that identifies the federated database instance for which you want to download query logs. + in: path + name: tenantName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+gzip: + schema: + description: Compressed archive labeled `queryLogs.gz` downloads + format: binary + type: string + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Download Query Logs for One Federated Database Instance + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api downloadFederatedDatabaseQueryLogs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DownloadFederatedDatabaseQueryLogsApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + DownloadFederatedDatabaseQueryLogsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/queryLogs.gz?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/queryLogs.gz?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/downloadFederatedDatabaseQueryLogs + /api/atlas/v2/groups/{groupId}/databaseUsers: + get: + description: Returns all database users that belong to the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listDatabaseUsers + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiAtlasDatabaseUser" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Database Users in One Project + tags: + - Database Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listDatabaseUsers --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListDatabaseUsersApiParams{} + sdkResp, httpResp, err := client.DatabaseUsersApi. + ListDatabaseUsersWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Database-Users/operation/listDatabaseUsers + post: + description: Creates one database user in the specified project. This MongoDB Cloud supports a maximum of 100 database users per project. If you require more than 100 database users on a project, contact Support. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Charts Admin role, Project Stream Processing Owner role, or the Project Database Access Admin role. + externalDocs: + description: Contact MongoDB Support + url: https://cloud.mongodb.com/support + operationId: createDatabaseUser + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + examples: + AWS IAM Authentication: + description: AWS IAM Authentication + value: + awsIAMType: USER + databaseName: $external + groupId: 32b6e34b3d91647abb20e7b8 + roles: + - databaseName: sales + roleName: readWrite + - databaseName: marketing + roleName: read + scopes: + - name: myCluster + type: CLUSTER + username: arn:aws:iam::358363220050:user/mongodb-aws-iam-auth-test-user + LDAP Authentication: + description: LDAP Authentication + value: + databaseName: admin + groupId: 32b6e34b3d91647abb20e7b8 + ldapAuthType: GROUP + roles: + - databaseName: sales + roleName: readWrite + - databaseName: marketing + roleName: read + scopes: + - name: myCluster + type: CLUSTER + username: CN=marketing,OU=groups,DC=example,DC=com + OIDC Workforce Federated Authentication: + description: OIDC Workforce Federated Authentication + value: + databaseName: admin + groupId: 32b6e34b3d91647abb20e7b8 + oidcAuthType: IDP_GROUP + roles: + - databaseName: sales + roleName: readWrite + - databaseName: marketing + roleName: read + scopes: + - name: myCluster + type: CLUSTER + username: 5dd7496c7a3e5a648454341c/sales + OIDC Workload Federated Authentication: + description: OIDC Workload Federated Authentication + value: + databaseName: $external + groupId: 32b6e34b3d91647abb20e7b8 + oidcAuthType: USER + roles: + - databaseName: sales + roleName: readWrite + - databaseName: marketing + roleName: read + scopes: + - name: myCluster + type: CLUSTER + username: 5dd7496c7a3e5a648454341c/sales + SCRAM-SHA Authentication: + description: SCRAM-SHA Authentication + value: + databaseName: admin + groupId: 32b6e34b3d91647abb20e7b8 + password: changeme123 + roles: + - databaseName: sales + roleName: readWrite + - databaseName: marketing + roleName: read + scopes: + - name: myCluster + type: CLUSTER + username: david + X509 Authentication: + description: X509 Authentication + value: + databaseName: $external + groupId: 32b6e34b3d91647abb20e7b8 + roles: + - databaseName: sales + roleName: readWrite + - databaseName: marketing + roleName: read + scopes: + - name: myCluster + type: CLUSTER + username: CN=david@example.com,OU=users,DC=example,DC=com + x509Type: CUSTOMER + schema: + $ref: "#/components/schemas/CloudDatabaseUser" + description: Creates one database user in the specified project. + required: true + responses: + "201": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudDatabaseUser" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Database User in One Project + tags: + - Database Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createDatabaseUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateDatabaseUserApiParams{} + sdkResp, httpResp, err := client.DatabaseUsersApi. + CreateDatabaseUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Database-Users/operation/createDatabaseUser + /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username}: + delete: + description: Removes one database user from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Stream Processing Owner role, or the Project Database Access Admin role. + operationId: deleteDatabaseUser + parameters: + - $ref: "#/components/parameters/groupId" + - description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. + in: path + name: databaseName + required: true + schema: + type: string + - description: | + Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: + + | Authentication Method | Parameter Needed | Parameter Value | username Format | + |---|---|---|---| + | AWS IAM | awsIAMType | ROLE | ARN | + | AWS IAM | awsIAMType | USER | ARN | + | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | + | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | + | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | + in: path + name: username + required: true + schema: + example: "SCRAM-SHA: dylan or AWS IAM: arn:aws:iam::123456789012:user/sales/enterprise/DylanBloggs or x.509/LDAP: CN=Dylan Bloggs,OU=Enterprise,OU=Sales,DC=Example,DC=COM or OIDC: IdPIdentifier/IdPGroupName" + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-must-not-use-html: Description predates IPA validation + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + xgen-IPA-117-description-should-not-use-inline-tables: Description predates IPA validation + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Database User from One Project + tags: + - Database Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteDatabaseUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteDatabaseUserApiParams{} + httpResp, err := client.DatabaseUsersApi. + DeleteDatabaseUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Database-Users/operation/deleteDatabaseUser + get: + description: Returns one database user that belong to the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getDatabaseUser + parameters: + - $ref: "#/components/parameters/groupId" + - description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. + in: path + name: databaseName + required: true + schema: + type: string + - description: | + Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: + + | Authentication Method | Parameter Needed | Parameter Value | username Format | + |---|---|---|---| + | AWS IAM | awsIAMType | ROLE | ARN | + | AWS IAM | awsIAMType | USER | ARN | + | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | + | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | + | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | + in: path + name: username + required: true + schema: + example: "SCRAM-SHA: dylan or AWS IAM: arn:aws:iam::123456789012:user/sales/enterprise/DylanBloggs or x.509/LDAP: CN=Dylan Bloggs,OU=Enterprise,OU=Sales,DC=Example,DC=COM or OIDC: IdPIdentifier/IdPGroupName" + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-must-not-use-html: Description predates IPA validation + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + xgen-IPA-117-description-should-not-use-inline-tables: Description predates IPA validation + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudDatabaseUser" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Database User from One Project + tags: + - Database Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getDatabaseUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetDatabaseUserApiParams{} + sdkResp, httpResp, err := client.DatabaseUsersApi. + GetDatabaseUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Database-Users/operation/getDatabaseUser + patch: + description: Updates one database user that belongs to the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Charts Admin role, Project Stream Processing Owner role, or the Project Database Access Admin role. + operationId: updateDatabaseUser + parameters: + - $ref: "#/components/parameters/groupId" + - description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. + in: path + name: databaseName + required: true + schema: + type: string + - description: | + Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: + + | Authentication Method | Parameter Needed | Parameter Value | username Format | + |---|---|---|---| + | AWS IAM | awsIAMType | ROLE | ARN | + | AWS IAM | awsIAMType | USER | ARN | + | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | + | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | + | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | + in: path + name: username + required: true + schema: + example: "SCRAM-SHA: dylan or AWS IAM: arn:aws:iam::123456789012:user/sales/enterprise/DylanBloggs or x.509/LDAP: CN=Dylan Bloggs,OU=Enterprise,OU=Sales,DC=Example,DC=COM or OIDC: IdPIdentifier/IdPGroupName" + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-must-not-use-html: Description predates IPA validation + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + xgen-IPA-117-description-should-not-use-inline-tables: Description predates IPA validation + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudDatabaseUser" + description: Updates one database user that belongs to the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudDatabaseUser" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Database User in One Project + tags: + - Database Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateDatabaseUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateDatabaseUserApiParams{} + sdkResp, httpResp, err := client.DatabaseUsersApi. + UpdateDatabaseUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Database-Users/operation/updateDatabaseUser + /api/atlas/v2/groups/{groupId}/databaseUsers/{username}/certs: + get: + description: Returns all unexpired X.509 certificates for the specified MongoDB user. This MongoDB user belongs to one project. Atlas manages these certificates and the MongoDB user. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listDatabaseUserCertificates + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that represents the MongoDB database user account whose certificates you want to return. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedUserCert" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All X.509 Certificates Assigned to One Database User + tags: + - X.509 Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listDatabaseUserCertificates --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListDatabaseUserCertificatesApiParams{} + sdkResp, httpResp, err := client.X509AuthenticationApi. + ListDatabaseUserCertificatesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{username}/certs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{username}/certs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/X.509-Authentication/operation/listDatabaseUserCertificates + post: + description: |- + Generates one X.509 certificate for the specified MongoDB user. Atlas manages the certificate and MongoDB user that belong to one project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + To get MongoDB Cloud to generate a managed certificate for a database user, set `"x509Type" : "MANAGED"` on the desired MongoDB Database User. + + If you are managing your own Certificate Authority (CA) in Self-Managed X.509 mode, you must generate certificates for database users using your own CA. + externalDocs: + description: Self-Managed X.509 + url: https://www.mongodb.com/docs/atlas/security-self-managed-x509/#std-label-self-managed-x509 + operationId: createDatabaseUserCertificate + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that represents the MongoDB database user account for whom to create a certificate. + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserCert" + description: Generates one X.509 certificate for the specified MongoDB user. + required: true + responses: + "201": + content: + application/vnd.atlas.2023-01-01+json: + schema: + description: PEM file that contains the user's X.509 certificate and private key. + type: string + x-xgen-version: 2023-01-01 + description: This endpoint returns a PEM file with the certificate and private key. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One X.509 Certificate for One Database User + tags: + - X.509 Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createDatabaseUserCertificate --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateDatabaseUserCertificateApiParams{} + sdkResp, httpResp, err := client.X509AuthenticationApi. + CreateDatabaseUserCertificateWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{username}/certs" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/databaseUsers/{username}/certs" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/X.509-Authentication/operation/createDatabaseUserCertificate + /api/atlas/v2/groups/{groupId}/dbAccessHistory/clusters/{clusterName}: + get: + description: Returns the access logs of one cluster identified by the cluster's name. Access logs contain a list of authentication requests made against your cluster. You can't use this feature on tenant-tier clusters (M0, M2, M5). To use this resource, the requesting Service Account or API Key must have the Project Monitoring Admin role or the Project Database Access Admin role. + externalDocs: + description: Database Access History + url: https://docs.atlas.mongodb.com/access-tracking/ + operationId: listAccessLogsByClusterName + parameters: + - $ref: "#/components/parameters/groupId" + - description: Flag that indicates whether the response returns the successful authentication attempts only. + in: query + name: authResult + schema: + type: boolean + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Date and time when to stop retrieving database history. If you specify **end**, you must also specify **start**. This parameter uses UNIX epoch time in milliseconds. + in: query + name: end + schema: + format: int64 + type: integer + - description: One Internet Protocol address that attempted to authenticate with the database. + in: query + name: ipAddress + schema: + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + - description: Maximum number of lines from the log to return. + in: query + name: nLogs + schema: + default: 20000 + format: int32 + maximum: 20000 + minimum: 0 + type: integer + - description: Date and time when MongoDB Cloud begins retrieving database history. If you specify **start**, you must also specify **end**. This parameter uses UNIX epoch time in milliseconds. + in: query + name: start + schema: + format: int64 + type: integer + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/MongoDBAccessLogsList" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Database Access History for One Cluster by Cluster Name + tags: + - Access Tracking + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAccessLogsByClusterName --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAccessLogsByClusterNameApiParams{} + sdkResp, httpResp, err := client.AccessTrackingApi. + ListAccessLogsByClusterNameWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dbAccessHistory/clusters/{clusterName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dbAccessHistory/clusters/{clusterName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Access-Tracking/operation/listAccessLogsByClusterName + /api/atlas/v2/groups/{groupId}/dbAccessHistory/processes/{hostname}: + get: + description: Returns the access logs of one cluster identified by the cluster's hostname. Access logs contain a list of authentication requests made against your clusters. You can't use this feature on tenant-tier clusters (M0, M2, M5). To use this resource, the requesting Service Account or API Key must have the Project Monitoring Admin role or the Project Database Access Admin role. + externalDocs: + description: Database Access History + url: https://docs.atlas.mongodb.com/access-tracking/ + operationId: listAccessLogsByHostname + parameters: + - $ref: "#/components/parameters/groupId" + - description: Flag that indicates whether the response returns the successful authentication attempts only. + in: query + name: authResult + schema: + type: boolean + - description: Date and time when to stop retrieving database history. If you specify **end**, you must also specify **start**. This parameter uses UNIX epoch time in milliseconds. + in: query + name: end + schema: + format: int64 + type: integer + - description: Fully qualified domain name or IP address of the MongoDB host that stores the log files that you want to download. + in: path + name: hostname + required: true + schema: + type: string + - description: One Internet Protocol address that attempted to authenticate with the database. + in: query + name: ipAddress + schema: + pattern: ^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)(\.(?!$)|$)){4}|([0-9a-f]{1,4}:){7}[0-9a-f]{1,4}$ + type: string + - description: Maximum number of lines from the log to return. + in: query + name: nLogs + schema: + default: 20000 + format: int32 + maximum: 20000 + minimum: 0 + type: integer + - description: Date and time when MongoDB Cloud begins retrieving database history. If you specify **start**, you must also specify **end**. This parameter uses UNIX epoch time in milliseconds. + in: query + name: start + schema: + format: int64 + type: integer + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/MongoDBAccessLogsList" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Database Access History for One Cluster by Hostname + tags: + - Access Tracking + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAccessLogsByHostname --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAccessLogsByHostnameApiParams{} + sdkResp, httpResp, err := client.AccessTrackingApi. + ListAccessLogsByHostnameWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dbAccessHistory/processes/{hostname}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/dbAccessHistory/processes/{hostname}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Access-Tracking/operation/listAccessLogsByHostname + /api/atlas/v2/groups/{groupId}/encryptionAtRest: + get: + description: |- + Returns the configuration for encryption at rest using the keys you manage through your cloud provider. MongoDB Cloud encrypts all storage even if you don't use your own key management. This resource requires the requesting Service Account or API Key to have the Project Owner role. + + **LIMITED TO M10 OR GREATER:** MongoDB Cloud limits this feature to dedicated cluster tiers of M10 and greater. + operationId: getEncryptionAtRest + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EncryptionAtRest" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-response-has-no-input-fields: Content predates IPA validation + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Configuration for Encryption at Rest using Customer-Managed Keys for One Project + tags: + - Encryption at Rest using Customer Key Management + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getEncryptionAtRest --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetEncryptionAtRestApiParams{} + sdkResp, httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi. + GetEncryptionAtRestWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/getEncryptionAtRest + patch: + description: |- + Updates the configuration for encryption at rest using the keys you manage through your cloud provider. MongoDB Cloud encrypts all storage even if you don't use your own key management. This resource requires the requesting Service Account or API Key to have the Project Owner role. This feature isn't available for `M0` free clusters, `M2`, `M5`, or serverless clusters. + + After you configure at least one Encryption at Rest using a Customer Key Management provider for the MongoDB Cloud project, Project Owners can enable Encryption at Rest using Customer Key Management for each MongoDB Cloud cluster for which they require encryption. The Encryption at Rest using Customer Key Management provider doesn't have to match the cluster cloud service provider. MongoDB Cloud doesn't automatically rotate user-managed encryption keys. Defer to your preferred Encryption at Rest using Customer Key Management provider's documentation and guidance for best practices on key rotation. MongoDB Cloud automatically creates a 90-day key rotation alert when you configure Encryption at Rest using Customer Key Management using your Key Management in an MongoDB Cloud project. MongoDB Cloud encrypts all storage whether or not you use your own key management. + operationId: updateEncryptionAtRest + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EncryptionAtRest" + description: |- + Required parameters depend on whether someone has enabled Encryption at Rest using Customer Key Management: + + If you have enabled Encryption at Rest using Customer Key Management (CMK), Atlas requires all of the parameters for the desired encryption provider. + + - To use AWS Key Management Service (KMS), MongoDB Cloud requires all the fields in the **awsKms** object. + - To use Azure Key Vault, MongoDB Cloud requires all the fields in the **azureKeyVault** object. + - To use Google Cloud Key Management Service (KMS), MongoDB Cloud requires all the fields in the **googleCloudKms** object. + + If you enabled Encryption at Rest using Customer Key Management, administrators can pass only the changed fields for the **awsKms**, **azureKeyVault**, or **googleCloudKms** object to update the configuration to this endpoint. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EncryptionAtRest" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Encryption at Rest Configuration for One Project + tags: + - Encryption at Rest using Customer Key Management + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateEncryptionAtRest --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateEncryptionAtRestApiParams{} + sdkResp, httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi. + UpdateEncryptionAtRestWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/updateEncryptionAtRest + /api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints: + get: + description: Returns the private endpoints of the specified cloud provider for encryption at rest using customer key management. + operationId: getEncryptionAtRestPrivateEndpointsForCloudProvider + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the cloud provider for the private endpoints to return. + in: path + name: cloudProvider + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiAtlasEARPrivateEndpoint" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Private Endpoints of a Cloud Provider for Encryption at Rest Using Customer Key Management for One Project + tags: + - Encryption at Rest using Customer Key Management + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getEncryptionAtRestPrivateEndpointsForCloudProvider --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetEncryptionAtRestPrivateEndpointsForCloudProviderApiParams{} + sdkResp, httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi. + GetEncryptionAtRestPrivateEndpointsForCloudProviderWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/getEncryptionAtRestPrivateEndpointsForCloudProvider + post: + description: Creates a private endpoint in the specified region for encryption at rest using customer key management. + operationId: createEncryptionAtRestPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cloud provider for the private endpoint to create. + in: path + name: cloudProvider + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EARPrivateEndpoint" + description: Creates a private endpoint in the specified region. + required: true + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EARPrivateEndpoint" + x-xgen-version: 2023-01-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Private Endpoint in a Specified Region for Encryption at Rest Using Customer Key Management + tags: + - Encryption at Rest using Customer Key Management + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createEncryptionAtRestPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateEncryptionAtRestPrivateEndpointApiParams{} + sdkResp, httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi. + CreateEncryptionAtRestPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/createEncryptionAtRestPrivateEndpoint + /api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints/{endpointId}: + delete: + description: Deletes one private endpoint, identified by its ID, for encryption at rest using Customer Key Management. + operationId: requestEncryptionAtRestPrivateEndpointDeletion + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cloud provider of the private endpoint to delete. + in: path + name: cloudProvider + required: true + schema: + type: string + - description: Unique 24-hexadecimal digit string that identifies the private endpoint to delete. + in: path + name: endpointId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Private Endpoint for Encryption at Rest Using Customer Key Management + tags: + - Encryption at Rest using Customer Key Management + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api requestEncryptionAtRestPrivateEndpointDeletion --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RequestEncryptionAtRestPrivateEndpointDeletionApiParams{} + httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi. + RequestEncryptionAtRestPrivateEndpointDeletionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints/{endpointId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints/{endpointId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/requestEncryptionAtRestPrivateEndpointDeletion + get: + description: Returns one private endpoint, identified by its ID, for encryption at rest using Customer Key Management. + operationId: getEncryptionAtRestPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cloud provider of the private endpoint. + in: path + name: cloudProvider + required: true + schema: + type: string + - description: Unique 24-hexadecimal digit string that identifies the private endpoint. + in: path + name: endpointId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EARPrivateEndpoint" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Private Endpoint for Encryption at Rest Using Customer Key Management + tags: + - Encryption at Rest using Customer Key Management + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getEncryptionAtRestPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetEncryptionAtRestPrivateEndpointApiParams{} + sdkResp, httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi. + GetEncryptionAtRestPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints/{endpointId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest/{cloudProvider}/privateEndpoints/{endpointId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Encryption-at-Rest-using-Customer-Key-Management/operation/getEncryptionAtRestPrivateEndpoint + /api/atlas/v2/groups/{groupId}/events: + get: + description: |- + Returns events for the specified project. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This resource remains under revision and may change. + operationId: listProjectEvents + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the cluster. + in: query + name: clusterNames + schema: + items: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + type: array + style: form + - description: |- + Category of incident recorded at this moment in time. + + **IMPORTANT**: The complete list of event type values changes frequently. + in: query + name: eventType + schema: + items: + $ref: "#/components/schemas/EventTypeForNdsGroup" + type: array + - description: |- + Category of event that you would like to exclude from query results, such as CLUSTER_CREATED + + **IMPORTANT**: Event type names change frequently. Verify that you specify the event type correctly by checking the complete list of event types. + in: query + name: excludedEventType + schema: + items: + $ref: "#/components/schemas/EventTypeForNdsGroup" + type: array + - description: Flag that indicates whether to include the raw document in the output. The raw document contains additional meta information about the event. + in: query + name: includeRaw + schema: + default: false + type: boolean + - description: Date and time from when MongoDB Cloud stops returning events. This parameter uses the ISO 8601 timestamp format in UTC. + in: query + name: maxDate + schema: + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + type: string + - description: Date and time from when MongoDB Cloud starts returning events. This parameter uses the ISO 8601 timestamp format in UTC. + in: query + name: minDate + schema: + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupPaginatedEvent" + x-xgen-IPA-exception: + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Events from One Project + tags: + - Events + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjectEvents --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectEventsApiParams{} + sdkResp, httpResp, err := client.EventsApi. + ListProjectEventsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/events?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/events?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Events/operation/listProjectEvents + /api/atlas/v2/groups/{groupId}/events/{eventId}: + get: + description: |- + Returns one event for the specified project. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. Use the Return Events from One Project endpoint to retrieve all events to which the authenticated user has access. + + This resource remains under revision and may change. + externalDocs: + description: Return Events from One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Events/operation/listProjectEvents + operationId: getProjectEvent + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the event that you want to return. + in: path + name: eventId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: Flag that indicates whether to include the raw document in the output. The raw document contains additional meta information about the event. + in: query + name: includeRaw + schema: + default: false + type: boolean + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EventViewForNdsGroup" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Event from One Project + tags: + - Events + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectEvent --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectEventApiParams{} + sdkResp, httpResp, err := client.EventsApi. + GetProjectEventWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/events/{eventId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/events/{eventId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Events/operation/getProjectEvent + /api/atlas/v2/groups/{groupId}/flexClusters: + get: + description: Returns details for all flex clusters in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listFlexClusters + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/PaginatedFlexClusters20241113" + x-xgen-version: 2024-11-13 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Flex Clusters from One Project + tags: + - Flex Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listFlexClusters --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListFlexClustersApiParams{} + sdkResp, httpResp, err := client.FlexClustersApi. + ListFlexClustersWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/listFlexClusters + post: + description: Creates one flex cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: createFlexCluster + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexClusterDescriptionCreate20241113" + description: Create One Flex Cluster in One Project. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexClusterDescription20241113" + x-xgen-version: 2024-11-13 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Flex Cluster in One Project + tags: + - Flex Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createFlexCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateFlexClusterApiParams{} + sdkResp, httpResp, err := client.FlexClustersApi. + CreateFlexClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/createFlexCluster + /api/atlas/v2/groups/{groupId}/flexClusters/{name}: + delete: + description: Removes one flex cluster from the specified project. The flex cluster must have termination protection disabled in order to be deleted. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deleteFlexCluster + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the flex cluster. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "204": + content: + application/vnd.atlas.2024-11-13+json: + x-xgen-version: 2024-11-13 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Flex Cluster from One Project + tags: + - Flex Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteFlexCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteFlexClusterApiParams{} + httpResp, err := client.FlexClustersApi. + DeleteFlexClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/deleteFlexCluster + get: + description: Returns details for one flex cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getFlexCluster + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the flex cluster. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexClusterDescription20241113" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2024-11-13 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Flex Cluster from One Project + tags: + - Flex Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getFlexCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetFlexClusterApiParams{} + sdkResp, httpResp, err := client.FlexClustersApi. + GetFlexClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/getFlexCluster + patch: + description: Updates one flex cluster in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: updateFlexCluster + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the flex cluster. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexClusterDescriptionUpdate20241113" + description: Update One Flex Cluster in One Project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexClusterDescription20241113" + x-xgen-version: 2024-11-13 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + summary: Update One Flex Cluster in One Project + tags: + - Flex Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateFlexCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateFlexClusterApiParams{} + sdkResp, httpResp, err := client.FlexClustersApi. + UpdateFlexClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/updateFlexCluster + /api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/download: + post: + description: Requests one snapshot for the specified flex cluster. This resource returns a `snapshotURL` that you can use to download the snapshot. This `snapshotURL` remains active for four hours after you make the request. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: downloadFlexBackup + parameters: + - description: Human-readable label that identifies the flex cluster. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexBackupSnapshotDownloadCreate20241113" + description: Snapshot to be downloaded. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexBackupRestoreJob20241113" + x-xgen-version: 2024-11-13 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Download One Flex Cluster Snapshot + tags: + - Flex Snapshots + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api downloadFlexBackup --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DownloadFlexBackupApiParams{} + sdkResp, httpResp, err := client.FlexSnapshotsApi. + DownloadFlexBackupWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/download" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/download" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Snapshots/operation/downloadFlexBackup + /api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/restoreJobs: + get: + description: Returns all restore jobs for one flex cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: listFlexBackupRestoreJobs + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the flex cluster. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/PaginatedApiAtlasFlexBackupRestoreJob20241113" + x-xgen-version: 2024-11-13 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Restore Jobs for One Flex Cluster + tags: + - Flex Restore Jobs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listFlexBackupRestoreJobs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListFlexBackupRestoreJobsApiParams{} + sdkResp, httpResp, err := client.FlexRestoreJobsApi. + ListFlexBackupRestoreJobsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/restoreJobs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/restoreJobs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/listFlexBackupRestoreJobs + post: + description: Restores one snapshot of one flex cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: createFlexBackupRestoreJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the flex cluster whose snapshot you want to restore. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexBackupRestoreJobCreate20241113" + description: Restores one snapshot of one flex cluster from the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexBackupRestoreJob20241113" + x-xgen-version: 2024-11-13 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Restore One Snapshot of One Flex Cluster + tags: + - Flex Restore Jobs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createFlexBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateFlexBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.FlexRestoreJobsApi. + CreateFlexBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/restoreJobs" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/restoreJobs" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/createFlexBackupRestoreJob + /api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/restoreJobs/{restoreJobId}: + get: + description: Returns one restore job for one flex cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: getFlexBackupRestoreJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the flex cluster. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the restore job to return. + in: path + name: restoreJobId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexBackupRestoreJob20241113" + x-xgen-version: 2024-11-13 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Restore Job for One Flex Cluster + tags: + - Flex Restore Jobs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getFlexBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetFlexBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.FlexRestoreJobsApi. + GetFlexBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/restoreJobs/{restoreJobId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/restoreJobs/{restoreJobId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/getFlexBackupRestoreJob + /api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/snapshots: + get: + description: Returns all snapshots of one flex cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listFlexBackups + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the flex cluster. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/PaginatedApiAtlasFlexBackupSnapshot20241113" + x-xgen-version: 2024-11-13 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Snapshots of One Flex Cluster + tags: + - Flex Snapshots + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listFlexBackups --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListFlexBackupsApiParams{} + sdkResp, httpResp, err := client.FlexSnapshotsApi. + ListFlexBackupsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/snapshots?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/snapshots?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Snapshots/operation/listFlexBackups + /api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/snapshots/{snapshotId}: + get: + description: Returns one snapshot of one flex cluster from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getFlexBackup + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the flex cluster. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexBackupSnapshot20241113" + x-xgen-version: 2024-11-13 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Snapshot of One Flex Cluster + tags: + - Flex Snapshots + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getFlexBackup --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetFlexBackupApiParams{} + sdkResp, httpResp, err := client.FlexSnapshotsApi. + GetFlexBackupWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/snapshots/{snapshotId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/snapshots/{snapshotId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Snapshots/operation/getFlexBackup + /api/atlas/v2/groups/{groupId}/flexClusters:tenantUpgrade: + post: + description: Upgrades a flex cluster to a dedicated cluster (M10+) in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Cluster Manager role. + operationId: upgradeFlexCluster + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/AtlasTenantClusterUpgradeRequest20240805" + description: Details of the flex cluster upgrade in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/FlexClusterDescription20241113" + x-xgen-version: 2024-11-13 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Upgrade One Flex Cluster + tags: + - Flex Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api upgradeFlexCluster --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpgradeFlexClusterApiParams{} + sdkResp, httpResp, err := client.FlexClustersApi. + UpgradeFlexClusterWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters:tenantUpgrade" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/flexClusters:tenantUpgrade" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/upgradeFlexCluster + /api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics: + get: + description: Returns all Atlas Search metric types available for one process in the specified project. You must have the Project Read Only or higher role to view the Atlas Search metric types. + operationId: listMetricTypes + parameters: + - $ref: "#/components/parameters/processId" + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudSearchMetrics" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Atlas Search Metric Types for One Process + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listMetricTypes --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListMetricTypesApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + ListMetricTypesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/listMetricTypes + /api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/indexes/{databaseName}/{collectionName}/{indexName}/measurements: + get: + description: Returns the Atlas Search metrics data series within the provided time range for one namespace and index name on the specified process. You must have the Project Read Only or higher role to view the Atlas Search metric types. + operationId: getIndexMetrics + parameters: + - $ref: "#/components/parameters/processId" + - $ref: "#/components/parameters/indexName" + - $ref: "#/components/parameters/databaseName" + - $ref: "#/components/parameters/collectionName" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/granularity" + - $ref: "#/components/parameters/period" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - description: List that contains the measurements that MongoDB Atlas reports for the associated data series. + in: query + name: metrics + required: true + schema: + description: List that contains the measurements that MongoDB Atlas reports for the associated data series. + items: + type: string + maxItems: 10 + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/MeasurementsIndexes" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Atlas Search Metrics for One Index in One Namespace + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getIndexMetrics --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetIndexMetricsApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + GetIndexMetricsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/indexes/{databaseName}/{collectionName}/{indexName}/measurements?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/indexes/{databaseName}/{collectionName}/{indexName}/measurements?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/getIndexMetrics + /api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/indexes/{databaseName}/{collectionName}/measurements: + get: + description: Returns the Atlas Search index metrics within the specified time range for one namespace in the specified process. + operationId: listIndexMetrics + parameters: + - $ref: "#/components/parameters/processId" + - $ref: "#/components/parameters/databaseName" + - $ref: "#/components/parameters/collectionName" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/granularity" + - $ref: "#/components/parameters/period" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - description: List that contains the measurements that MongoDB Atlas reports for the associated data series. + in: query + name: metrics + required: true + schema: + description: List that contains the measurements that MongoDB Atlas reports for the associated data series. + items: + type: string + maxItems: 10 + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/MeasurementsIndexes" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Atlas Search Index Metrics for One Namespace + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listIndexMetrics --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListIndexMetricsApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + ListIndexMetricsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/indexes/{databaseName}/{collectionName}/measurements?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/indexes/{databaseName}/{collectionName}/measurements?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/listIndexMetrics + /api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/measurements: + get: + description: Returns the Atlas Search hardware and status data series within the provided time range for one process in the specified project. You must have the Project Read Only or higher role to view the Atlas Search metric types. + operationId: getMeasurements + parameters: + - $ref: "#/components/parameters/processId" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/granularity" + - $ref: "#/components/parameters/period" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - description: List that contains the metrics that you want MongoDB Atlas to report for the associated data series. If you don't set this parameter, this resource returns all hardware and status metrics for the associated data series. + in: query + name: metrics + required: true + schema: + description: List that contains the metrics that you want MongoDB Atlas to report for the associated data series. If you don't set this parameter, this resource returns all hardware and status metrics for the associated data series. + items: + type: string + maxItems: 10 + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/MeasurementsNonIndex" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Atlas Search Hardware and Status Metrics + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getMeasurements --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetMeasurementsApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + GetMeasurementsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/measurements?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/hosts/{processId}/fts/metrics/measurements?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/getMeasurements + /api/atlas/v2/groups/{groupId}/integrations: + get: + description: Returns the settings that permit integrations with all configured third-party services. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. + operationId: listThirdPartyIntegrations + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedIntegration" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Active Third-Party Service Integrations + tags: + - Third-Party Integrations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listThirdPartyIntegrations --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListThirdPartyIntegrationsApiParams{} + sdkResp, httpResp, err := client.Third - PartyIntegrationsApi. + ListThirdPartyIntegrationsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Third-Party-Integrations/operation/listThirdPartyIntegrations + /api/atlas/v2/groups/{groupId}/integrations/{integrationType}: + delete: + description: Removes the settings that permit configuring one third-party service integration. These settings apply to all databases managed in one MongoDB Cloud project. If you delete an integration from a project, you remove that integration configuration only for that project. This action doesn't affect any other project or organization's configured `{INTEGRATION-TYPE}` integrations. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. + operationId: deleteThirdPartyIntegration + parameters: + - description: Human-readable label that identifies the service which you want to integrate with MongoDB Cloud. + in: path + name: integrationType + required: true + schema: + title: Integration Type + type: string + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Third-Party Service Integration + tags: + - Third-Party Integrations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteThirdPartyIntegration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteThirdPartyIntegrationApiParams{} + httpResp, err := client.Third - PartyIntegrationsApi. + DeleteThirdPartyIntegrationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Third-Party-Integrations/operation/deleteThirdPartyIntegration + get: + description: Returns the settings for configuring integration with one third-party service. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. + operationId: getThirdPartyIntegration + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the service which you want to integrate with MongoDB Cloud. + in: path + name: integrationType + required: true + schema: + title: Integration Type + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ThirdPartyIntegration" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Third-Party Service Integration + tags: + - Third-Party Integrations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getThirdPartyIntegration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetThirdPartyIntegrationApiParams{} + sdkResp, httpResp, err := client.Third - PartyIntegrationsApi. + GetThirdPartyIntegrationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Third-Party-Integrations/operation/getThirdPartyIntegration + post: + description: Adds the settings for configuring one third-party service integration. These settings apply to all databases managed in the specified MongoDB Cloud project. Each project can have only one configuration per `{INTEGRATION-TYPE}`. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. + operationId: createThirdPartyIntegration + parameters: + - description: Human-readable label that identifies the service which you want to integrate with MongoDB Cloud. + in: path + name: integrationType + required: true + schema: + title: Integration Type + type: string + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ThirdPartyIntegration" + description: Third-party integration that you want to configure for your project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedIntegration" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Configure One Third-Party Service Integration + tags: + - Third-Party Integrations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createThirdPartyIntegration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateThirdPartyIntegrationApiParams{} + sdkResp, httpResp, err := client.Third - PartyIntegrationsApi. + CreateThirdPartyIntegrationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Third-Party-Integrations/operation/createThirdPartyIntegration + put: + description: Updates the settings for configuring integration with one third-party service. These settings apply to all databases managed in one MongoDB Cloud project. To use this resource, the requesting Service Account or API Key must have the Organization Owner or Project Owner role. + operationId: updateThirdPartyIntegration + parameters: + - description: Human-readable label that identifies the service which you want to integrate with MongoDB Cloud. + in: path + name: integrationType + required: true + schema: + title: Integration Type + type: string + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ThirdPartyIntegration" + description: Third-party integration that you want to configure for your project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedIntegration" + x-xgen-IPA-exception: + xgen-IPA-107-update-method-response-is-get-method-response: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Third-Party Service Integration + tags: + - Third-Party Integrations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateThirdPartyIntegration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateThirdPartyIntegrationApiParams{} + sdkResp, httpResp, err := client.Third - PartyIntegrationsApi. + UpdateThirdPartyIntegrationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/integrations/{integrationType}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Third-Party-Integrations/operation/updateThirdPartyIntegration + /api/atlas/v2/groups/{groupId}/invites: + get: + deprecated: true + description: Returns all pending invitations to the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: listProjectInvitations + parameters: + - $ref: "#/components/parameters/groupId" + - description: Email address of the user account invited to this project. + in: query + name: username + schema: + format: email + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/GroupInvitation" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Project Invitations + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjectInvitations --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectInvitationsApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + ListProjectInvitationsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites?pretty=true" + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/listProjectInvitations + patch: + deprecated: true + description: Updates the details of one pending invitation to the specified project. To specify which invitation to update, provide the username of the invited user. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: updateProjectInvitation + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupInvitationRequest" + description: Updates the details of one pending invitation to the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupInvitation" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Project Invitation + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateProjectInvitation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateProjectInvitationApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + UpdateProjectInvitationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/updateProjectInvitation + post: + deprecated: true + description: Invites one MongoDB Cloud user to join the specified project. The MongoDB Cloud user must accept the invitation to access information within the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: createProjectInvitation + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupInvitationRequest" + description: Invites one MongoDB Cloud user to join the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupInvitation" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Invite One MongoDB Cloud User to One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createProjectInvitation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateProjectInvitationApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + CreateProjectInvitationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + /api/atlas/v2/groups/{groupId}/invites/{invitationId}: + delete: + deprecated: true + description: Cancels one pending invitation sent to the specified MongoDB Cloud user to join a project. You can't cancel an invitation that the user accepted. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deleteProjectInvitation + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the invitation. + in: path + name: invitationId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Project Invitation + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteProjectInvitation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteProjectInvitationApiParams{} + httpResp, err := client.ProjectsApi. + DeleteProjectInvitationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites/{invitationId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites/{invitationId}" + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/deleteProjectInvitation + get: + deprecated: true + description: Returns the details of one pending invitation to the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: getProjectInvitation + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the invitation. + in: path + name: invitationId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupInvitation" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Project Invitation + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectInvitation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectInvitationApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + GetProjectInvitationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites/{invitationId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites/{invitationId}?pretty=true" + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/getProjectInvitation + patch: + deprecated: true + description: Updates the details of one pending invitation to the specified project. To specify which invitation to update, provide the unique identification string for that invitation. Use the Return All Project Invitations endpoint to retrieve IDs for all pending project invitations. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: updateProjectInvitationById + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the invitation. + in: path + name: invitationId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupInvitationUpdateRequest" + description: Updates the details of one pending invitation to the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupInvitation" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Project Invitation by Invitation ID + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateProjectInvitationById --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateProjectInvitationByIdApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + UpdateProjectInvitationByIdWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites/{invitationId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/invites/{invitationId}" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/updateProjectInvitationById + /api/atlas/v2/groups/{groupId}/ipAddresses: + get: + description: Returns all IP addresses for this project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: returnAllIpAddresses + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupIPAddresses" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All IP Addresses for One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api returnAllIpAddresses --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ReturnAllIpAddressesApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + ReturnAllIpAddressesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/ipAddresses?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/ipAddresses?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/returnAllIpAddresses + /api/atlas/v2/groups/{groupId}/limits: + get: + description: Returns all the limits for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listProjectLimits + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/DataFederationLimit" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Limits for One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjectLimits --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectLimitsApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + ListProjectLimitsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/limits?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/limits?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/listProjectLimits + /api/atlas/v2/groups/{groupId}/limits/{limitName}: + delete: + description: Removes the specified project limit. Depending on the limit, Atlas either resets the limit to its default value or removes the limit entirely. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deleteProjectLimit + parameters: + - description: | + Human-readable label that identifies this project limit. + + | Limit Name | Description | Default | API Override Limit | + | --- | --- | --- | --- | + | atlas.project.deployment.clusters | Limit on the number of clusters in this project if the org is not sales-sold (If org is sales-sold, the limit is 100) | 25 | 90 | + | atlas.project.deployment.nodesPerPrivateLinkRegion | Limit on the number of nodes per Private Link region in this project | 50 | 90 | + | atlas.project.security.databaseAccess.customRoles | Limit on the number of custom roles in this project | 100 | 1400 | + | atlas.project.security.databaseAccess.users | Limit on the number of database users in this project | 100 | 900 | + | atlas.project.security.networkAccess.crossRegionEntries | Limit on the number of cross-region network access entries in this project | 40 | 220 | + | atlas.project.security.networkAccess.entries | Limit on the number of network access entries in this project | 200 | 20 | + | dataFederation.bytesProcessed.query | Limit on the number of bytes processed during a single Data Federation query | N/A | N/A | + | dataFederation.bytesProcessed.daily | Limit on the number of bytes processed across all Data Federation tenants for the current day | N/A | N/A | + | dataFederation.bytesProcessed.weekly | Limit on the number of bytes processed across all Data Federation tenants for the current week | N/A | N/A | + | dataFederation.bytesProcessed.monthly | Limit on the number of bytes processed across all Data Federation tenants for the current month | N/A | N/A | + | atlas.project.deployment.privateServiceConnectionsPerRegionGroup | Number of Private Service Connections per Region Group | 50 | 100| + | atlas.project.deployment.privateServiceConnectionsSubnetMask | Subnet mask for GCP PSC Networks. Has lower limit of 20. | 27 | 27| + | atlas.project.deployment.salesSoldM0s | Limit on the number of M0 clusters in this project if the org is sales-sold | 100 | 100 | + in: path + name: limitName + required: true + schema: + type: string + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Project Limit + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteProjectLimit --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteProjectLimitApiParams{} + httpResp, err := client.ProjectsApi. + DeleteProjectLimitWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/limits/{limitName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/limits/{limitName}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/deleteProjectLimit + get: + description: Returns the specified limit for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getProjectLimit + parameters: + - description: | + Human-readable label that identifies this project limit. + + | Limit Name | Description | Default | API Override Limit | + | --- | --- | --- | --- | + | atlas.project.deployment.clusters | Limit on the number of clusters in this project if the org is not sales-sold (If org is sales-sold, the limit is 100) | 25 | 90 | + | atlas.project.deployment.nodesPerPrivateLinkRegion | Limit on the number of nodes per Private Link region in this project | 50 | 90 | + | atlas.project.security.databaseAccess.customRoles | Limit on the number of custom roles in this project | 100 | 1400 | + | atlas.project.security.databaseAccess.users | Limit on the number of database users in this project | 100 | 900 | + | atlas.project.security.networkAccess.crossRegionEntries | Limit on the number of cross-region network access entries in this project | 40 | 220 | + | atlas.project.security.networkAccess.entries | Limit on the number of network access entries in this project | 200 | 20 | + | dataFederation.bytesProcessed.query | Limit on the number of bytes processed during a single Data Federation query | N/A | N/A | + | dataFederation.bytesProcessed.daily | Limit on the number of bytes processed across all Data Federation tenants for the current day | N/A | N/A | + | dataFederation.bytesProcessed.weekly | Limit on the number of bytes processed across all Data Federation tenants for the current week | N/A | N/A | + | dataFederation.bytesProcessed.monthly | Limit on the number of bytes processed across all Data Federation tenants for the current month | N/A | N/A | + | atlas.project.deployment.privateServiceConnectionsPerRegionGroup | Number of Private Service Connections per Region Group | 50 | 100| + | atlas.project.deployment.privateServiceConnectionsSubnetMask | Subnet mask for GCP PSC Networks. Has lower limit of 20. | 27 | 27| + | atlas.project.deployment.salesSoldM0s | Limit on the number of M0 clusters in this project if the org is sales-sold | 100 | 100 | + in: path + name: limitName + required: true + schema: + type: string + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataFederationLimit" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Limit for One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectLimit --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectLimitApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + GetProjectLimitWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/limits/{limitName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/limits/{limitName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/getProjectLimit + patch: + description: |- + Sets the specified project limit. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + **NOTE**: Increasing the following configuration limits might lead to slower response times in the MongoDB Cloud UI or increased user management overhead leading to authentication or authorization re-architecture. If possible, we recommend that you create additional projects to gain access to more of these resources for a more sustainable growth pattern. + operationId: setProjectLimit + parameters: + - description: | + Human-readable label that identifies this project limit. + + | Limit Name | Description | Default | API Override Limit | + | --- | --- | --- | --- | + | atlas.project.deployment.clusters | Limit on the number of clusters in this project if the org is not sales-sold (If org is sales-sold, the limit is 100) | 25 | 90 | + | atlas.project.deployment.nodesPerPrivateLinkRegion | Limit on the number of nodes per Private Link region in this project | 50 | 90 | + | atlas.project.security.databaseAccess.customRoles | Limit on the number of custom roles in this project | 100 | 1400 | + | atlas.project.security.databaseAccess.users | Limit on the number of database users in this project | 100 | 900 | + | atlas.project.security.networkAccess.crossRegionEntries | Limit on the number of cross-region network access entries in this project | 40 | 220 | + | atlas.project.security.networkAccess.entries | Limit on the number of network access entries in this project | 200 | 20 | + | dataFederation.bytesProcessed.query | Limit on the number of bytes processed during a single Data Federation query | N/A | N/A | + | dataFederation.bytesProcessed.daily | Limit on the number of bytes processed across all Data Federation tenants for the current day | N/A | N/A | + | dataFederation.bytesProcessed.weekly | Limit on the number of bytes processed across all Data Federation tenants for the current week | N/A | N/A | + | dataFederation.bytesProcessed.monthly | Limit on the number of bytes processed across all Data Federation tenants for the current month | N/A | N/A | + | atlas.project.deployment.privateServiceConnectionsPerRegionGroup | Number of Private Service Connections per Region Group | 50 | 100| + | atlas.project.deployment.privateServiceConnectionsSubnetMask | Subnet mask for GCP PSC Networks. Has lower limit of 20. | 27 | 27| + | atlas.project.deployment.salesSoldM0s | Limit on the number of M0 clusters in this project if the org is sales-sold | 100 | 100 | + in: path + name: limitName + required: true + schema: + type: string + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataFederationLimit" + description: Limit to update. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataFederationLimit" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Set One Project Limit + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api setProjectLimit --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.SetProjectLimitApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + SetProjectLimitWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/limits/{limitName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/limits/{limitName}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/setProjectLimit + /api/atlas/v2/groups/{groupId}/liveMigrations: + post: + description: |- + Migrate one cluster that Cloud or Ops Manager manages to MongoDB Atlas. + + Please make sure to validate your migration before initiating it. + + You can use this API endpoint for push live migrations only. Your API Key must have the Organization Owner role to successfully call this resource. + + **NOTE**: Migrating time-series collections is not yet supported on MongoDB 6.0 or higher. Migrations on MongoDB 6.0 or higher will skip any time-series collections on the source cluster. Deprecated versions: v2-{2023-01-01} + externalDocs: + description: Validate Migration + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Migration-Service/operation/validateMigration + operationId: createPushMigration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/LiveMigrationRequest20240530" + x-xgen-version: 2024-05-30 + description: One migration to be created. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/LiveMigrationResponse" + x-xgen-version: 2024-05-30 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Migrate One Local Managed Cluster to MongoDB Atlas + tags: + - Cloud Migration Service + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createPushMigration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreatePushMigrationApiParams{} + sdkResp, httpResp, err := client.CloudMigrationServiceApi. + CreatePushMigrationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Migration-Service/operation/createPushMigration + /api/atlas/v2/groups/{groupId}/liveMigrations/{liveMigrationId}: + get: + description: Return details of one cluster migration job. Each push live migration job uses one migration host. Your API Key must have the Organization Member role to successfully call this resource. + operationId: getPushMigration + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/liveMigrationId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/LiveMigrationResponse" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Migration Job + tags: + - Cloud Migration Service + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPushMigration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPushMigrationApiParams{} + sdkResp, httpResp, err := client.CloudMigrationServiceApi. + GetPushMigrationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations/{liveMigrationId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations/{liveMigrationId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Migration-Service/operation/getPushMigration + /api/atlas/v2/groups/{groupId}/liveMigrations/{liveMigrationId}/cutover: + put: + description: Cut over the migrated cluster to MongoDB Atlas. Confirm when the cut over completes. When the cut over completes, MongoDB Atlas completes the live migration process and stops synchronizing with the source cluster. Your API Key must have the Organization Owner role to successfully call this resource. + operationId: cutoverMigration + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/liveMigrationId" + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: Accepted. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Cut Over One Migrated Cluster + tags: + - Cloud Migration Service + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api cutoverMigration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CutoverMigrationApiParams{} + sdkResp, httpResp, err := client.CloudMigrationServiceApi. + CutoverMigrationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations/{liveMigrationId}/cutover" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations/{liveMigrationId}/cutover" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Migration-Service/operation/cutoverMigration + /api/atlas/v2/groups/{groupId}/liveMigrations/validate: + post: + description: "Verifies whether the provided credentials, available disk space, MongoDB versions, and so on meet the requirements of the migration request. If the check passes, the migration can proceed. Your API Key must have the Organization Owner role to successfully call this resource. Deprecated versions: v2-{2023-01-01}" + operationId: validateMigration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/LiveMigrationRequest20240530" + x-xgen-version: 2024-05-30 + description: One migration to be validated. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/LiveImportValidation" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Validate One Migration Request + tags: + - Cloud Migration Service + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api validateMigration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ValidateMigrationApiParams{} + sdkResp, httpResp, err := client.CloudMigrationServiceApi. + ValidateMigrationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations/validate" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations/validate" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Migration-Service/operation/validateMigration + /api/atlas/v2/groups/{groupId}/liveMigrations/validate/{validationId}: + get: + description: Return the status of one migration validation job. Your API Key must have the Organization Owner role to successfully call this resource. + operationId: getValidationStatus + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the validation job. + in: path + name: validationId + required: true + schema: + example: 507f1f77bcf86cd799439011 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/LiveImportValidation" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Migration Validation Job + tags: + - Cloud Migration Service + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getValidationStatus --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetValidationStatusApiParams{} + sdkResp, httpResp, err := client.CloudMigrationServiceApi. + GetValidationStatusWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations/validate/{validationId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/liveMigrations/validate/{validationId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Migration-Service/operation/getValidationStatus + /api/atlas/v2/groups/{groupId}/maintenanceWindow: + delete: + description: Resets the maintenance window for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. Urgent maintenance activities such as security patches can't wait for your chosen window. MongoDB Cloud starts those maintenance activities when needed. After you schedule maintenance for your cluster, you can't change your maintenance window until the current maintenance efforts complete. The maintenance procedure that MongoDB Cloud performs requires at least one replica set election during the maintenance window per replica set. Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or unexpected system issues could delay the start time. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: resetMaintenanceWindow + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Reset One Maintenance Window for One Project + tags: + - Maintenance Windows + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api resetMaintenanceWindow --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ResetMaintenanceWindowApiParams{} + httpResp, err := client.MaintenanceWindowsApi. + ResetMaintenanceWindowWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Maintenance-Windows/operation/resetMaintenanceWindow + get: + description: Returns the maintenance window for the specified project. MongoDB Cloud starts those maintenance activities when needed. You can't change your maintenance window until the current maintenance efforts complete. The maintenance procedure that MongoDB Cloud performs requires at least one replica set election during the maintenance window per replica set. Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or unexpected system issues could delay the start time. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: getMaintenanceWindow + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupMaintenanceWindow" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Maintenance Window for One Project + tags: + - Maintenance Windows + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getMaintenanceWindow --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetMaintenanceWindowApiParams{} + sdkResp, httpResp, err := client.MaintenanceWindowsApi. + GetMaintenanceWindowWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Maintenance-Windows/operation/getMaintenanceWindow + patch: + description: Updates the maintenance window for the specified project. Urgent maintenance activities such as security patches can't wait for your chosen window. MongoDB Cloud starts those maintenance activities when needed. After you schedule maintenance for your cluster, you can't change your maintenance window until the current maintenance efforts complete. The maintenance procedure that MongoDB Cloud performs requires at least one replica set election during the maintenance window per replica set. Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or unexpected system issues could delay the start time. Updating the maintenance window will reset any maintenance deferrals for this project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: updateMaintenanceWindow + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupMaintenanceWindow" + description: Updates the maintenance window for the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Maintenance Window for One Project + tags: + - Maintenance Windows + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateMaintenanceWindow --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateMaintenanceWindowApiParams{} + sdkResp, httpResp, err := client.MaintenanceWindowsApi. + UpdateMaintenanceWindowWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Maintenance-Windows/operation/updateMaintenanceWindow + /api/atlas/v2/groups/{groupId}/maintenanceWindow/autoDefer: + post: + description: Toggles automatic deferral of the maintenance window for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: toggleMaintenanceAutoDefer + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Toggle Automatic Deferral of Maintenance for One Project + tags: + - Maintenance Windows + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api toggleMaintenanceAutoDefer --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ToggleMaintenanceAutoDeferApiParams{} + sdkResp, httpResp, err := client.MaintenanceWindowsApi. + ToggleMaintenanceAutoDeferWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow/autoDefer" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow/autoDefer" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Maintenance-Windows/operation/toggleMaintenanceAutoDefer + /api/atlas/v2/groups/{groupId}/maintenanceWindow/defer: + post: + description: Defers the maintenance window for the specified project. Urgent maintenance activities such as security patches can't wait for your chosen window. MongoDB Cloud starts those maintenance activities when needed. After you schedule maintenance for your cluster, you can't change your maintenance window until the current maintenance efforts complete. The maintenance procedure that MongoDB Cloud performs requires at least one replica set election during the maintenance window per replica set. Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or unexpected system issues could delay the start time. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deferMaintenanceWindow + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Defer One Maintenance Window for One Project + tags: + - Maintenance Windows + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deferMaintenanceWindow --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeferMaintenanceWindowApiParams{} + sdkResp, httpResp, err := client.MaintenanceWindowsApi. + DeferMaintenanceWindowWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow/defer" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/maintenanceWindow/defer" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Maintenance-Windows/operation/deferMaintenanceWindow + /api/atlas/v2/groups/{groupId}/managedSlowMs: + get: + description: Get whether the Managed Slow MS feature is enabled. + operationId: getManagedSlowMs + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + type: boolean + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Managed Slow Operation Threshold Status + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getManagedSlowMs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetManagedSlowMsApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + GetManagedSlowMsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/managedSlowMs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/managedSlowMs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/getManagedSlowMs + /api/atlas/v2/groups/{groupId}/managedSlowMs/disable: + delete: + description: Disables the slow operation threshold that MongoDB Cloud calculated for the specified project. The threshold determines which operations the Performance Advisor and Query Profiler considers slow. When enabled, MongoDB Cloud uses the average execution time for operations on your cluster to determine slow-running queries. As a result, the threshold is more pertinent to your cluster workload. The slow operation threshold is enabled by default for dedicated clusters (M10+). When disabled, MongoDB Cloud considers any operation that takes longer than 100 milliseconds to be slow. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: disableSlowOperationThresholding + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Disable Managed Slow Operation Threshold + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api disableSlowOperationThresholding --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DisableSlowOperationThresholdingApiParams{} + httpResp, err := client.PerformanceAdvisorApi. + DisableSlowOperationThresholdingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/managedSlowMs/disable" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/managedSlowMs/disable" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/disableSlowOperationThresholding + /api/atlas/v2/groups/{groupId}/managedSlowMs/enable: + post: + description: Enables MongoDB Cloud to use its slow operation threshold for the specified project. The threshold determines which operations the Performance Advisor and Query Profiler considers slow. When enabled, MongoDB Cloud uses the average execution time for operations on your cluster to determine slow-running queries. As a result, the threshold is more pertinent to your cluster workload. The slow operation threshold is enabled by default for dedicated clusters (M10+). When disabled, MongoDB Cloud considers any operation that takes longer than 100 milliseconds to be slow. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: enableSlowOperationThresholding + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Enable Managed Slow Operation Threshold + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api enableSlowOperationThresholding --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.EnableSlowOperationThresholdingApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + EnableSlowOperationThresholdingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/managedSlowMs/enable" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/managedSlowMs/enable" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/enableSlowOperationThresholding + /api/atlas/v2/groups/{groupId}/mongoDBVersions: + get: + description: Returns the MongoDB Long Term Support Major Versions available to new clusters in this project. + operationId: getProjectLtsVersions + parameters: + - $ref: "#/components/parameters/groupId" + - description: Filter results to only one cloud provider. + in: query + name: cloudProvider + schema: + type: string + - description: Filter results to only one instance size. + in: query + name: instanceSize + schema: + example: M10 + type: string + - description: Filter results to only the default values per tier. This value must be DEFAULT. + in: query + name: defaultStatus + schema: + type: string + - description: Number of items that the response returns per page. + in: query + name: itemsPerPage + schema: + default: 100 + example: 100 + format: int64 + minimum: 1 + type: integer + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedAvailableVersion" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + xgen-IPA-104-get-method-returns-single-resource: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Available MongoDB LTS Versions for Clusters in One Project + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectLtsVersions --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectLtsVersionsApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + GetProjectLtsVersionsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/mongoDBVersions?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/mongoDBVersions?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/getProjectLtsVersions + /api/atlas/v2/groups/{groupId}/peers: + get: + description: Returns details about all network peering connections in the specified project. Network peering allows multiple cloud-hosted applications to securely connect to the same project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listPeeringConnections + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Cloud service provider to use for this VPC peering connection. + in: query + name: providerName + schema: + default: AWS + type: string + x-xgen-IPA-exception: + xgen-IPA-119-no-default-for-cloud-providers: Schema predates IPA validation + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedContainerPeer" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Network Peering Connections in One Project + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPeeringConnections --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPeeringConnectionsApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + ListPeeringConnectionsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/listPeeringConnections + post: + description: Creates one new network peering connection in the specified project. Network peering allows multiple cloud-hosted applications to securely connect to the same project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. To learn more about considerations and prerequisites, see the Network Peering Documentation. + externalDocs: + description: Azure Network Peering Prerequisites + url: https://docs.atlas.mongodb.com/reference/api/vpc-create-peering-connection/#prerequisites + operationId: createPeeringConnection + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BaseNetworkPeeringConnectionSettings" + description: Create one network peering connection. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BaseNetworkPeeringConnectionSettings" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Network Peering Connection + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createPeeringConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreatePeeringConnectionApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + CreatePeeringConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/createPeeringConnection + /api/atlas/v2/groups/{groupId}/peers/{peerId}: + delete: + description: Removes one network peering connection in the specified project. If you Removes the last network peering connection associated with a project, MongoDB Cloud also removes any AWS security groups from the project IP access list. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deletePeeringConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the network peering connection that you want to delete. + in: path + name: peerId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/RequestAccepted" + x-xgen-version: 2023-01-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Network Peering Connection + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deletePeeringConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeletePeeringConnectionApiParams{} + httpResp, err := client.NetworkPeeringApi. + DeletePeeringConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers/{peerId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers/{peerId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/deletePeeringConnection + get: + description: Returns details about one specified network peering connection in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getPeeringConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the network peering connection that you want to retrieve. + in: path + name: peerId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BaseNetworkPeeringConnectionSettings" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Network Peering Connection in One Project + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPeeringConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPeeringConnectionApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + GetPeeringConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers/{peerId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers/{peerId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/getPeeringConnection + patch: + description: Updates one specified network peering connection in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: updatePeeringConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the network peering connection that you want to update. + in: path + name: peerId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BaseNetworkPeeringConnectionSettings" + description: Modify one network peering connection. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BaseNetworkPeeringConnectionSettings" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Network Peering Connection + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updatePeeringConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdatePeeringConnectionApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + UpdatePeeringConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers/{peerId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/peers/{peerId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/updatePeeringConnection + /api/atlas/v2/groups/{groupId}/pipelines: + get: + deprecated: true + description: Returns a list of Data Lake Pipelines. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listPipelines + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/DataLakeIngestionPipeline" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Data Lake Pipelines in One Project + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPipelines --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPipelinesApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + ListPipelinesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines?pretty=true" + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/listPipelines + post: + deprecated: true + description: Creates one Data Lake Pipeline. + externalDocs: + description: Data Lake Pipelines are deprecated. Please see Data Lake Deprecation Guide. + url: https://dochub.mongodb.org/core/data-lake-deprecation + operationId: createPipeline + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeIngestionPipeline" + description: Creates one Data Lake Pipeline. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeIngestionPipeline" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Data Lake Pipeline + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createPipeline --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreatePipelineApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + CreatePipelineWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines" \ + -d '{ }' + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/createPipeline + /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}: + delete: + deprecated: true + description: Removes one Data Lake Pipeline. + operationId: deletePipeline + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Data Lake Pipeline + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deletePipeline --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeletePipelineApiParams{} + httpResp, err := client.DataLakePipelinesApi. + DeletePipelineWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}" + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/deletePipeline + get: + deprecated: true + description: Returns the details of one Data Lake Pipeline within the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getPipeline + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeIngestionPipeline" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Data Lake Pipeline + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPipeline --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPipelineApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + GetPipelineWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}?pretty=true" + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/getPipeline + patch: + deprecated: true + description: Updates one Data Lake Pipeline. + operationId: updatePipeline + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeIngestionPipeline" + description: Updates one Data Lake Pipeline. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeIngestionPipeline" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Data Lake Pipeline + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updatePipeline --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdatePipelineApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + UpdatePipelineWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}" \ + -d '{ }' + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/updatePipeline + /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/availableSchedules: + get: + deprecated: true + description: Returns a list of backup schedule policy items that you can use as a Data Lake Pipeline source. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listPipelineSchedules + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/DiskBackupApiPolicyItem" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + xgen-IPA-104-get-method-returns-single-resource: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Ingestion Schedules for One Data Lake Pipeline + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPipelineSchedules --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPipelineSchedulesApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + ListPipelineSchedulesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/availableSchedules?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/availableSchedules?pretty=true" + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/listPipelineSchedules + /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/availableSnapshots: + get: + deprecated: true + description: Returns a list of backup snapshots that you can use to trigger an on demand pipeline run. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listPipelineSnapshots + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Date and time after which MongoDB Cloud created the snapshot. If specified, MongoDB Cloud returns available backup snapshots created after this time and date only. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + in: query + name: completedAfter + schema: + format: date-time + type: string + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedBackupSnapshot" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + xgen-IPA-104-get-method-returns-single-resource: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Backup Snapshots for One Data Lake Pipeline + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPipelineSnapshots --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPipelineSnapshotsApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + ListPipelineSnapshotsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/availableSnapshots?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/availableSnapshots?pretty=true" + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/listPipelineSnapshots + /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/pause: + post: + deprecated: true + description: Pauses ingestion for a Data Lake Pipeline within the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: pausePipeline + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeIngestionPipeline" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Pause One Data Lake Pipeline + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api pausePipeline --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.PausePipelineApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + PausePipelineWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/pause" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/pause" \ + -d '{ }' + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/pausePipeline + /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/resume: + post: + deprecated: true + description: Resumes ingestion for a Data Lake Pipeline within the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: resumePipeline + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/DataLakeIngestionPipeline" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Resume One Data Lake Pipeline + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api resumePipeline --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ResumePipelineApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + ResumePipelineWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/resume" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/resume" \ + -d '{ }' + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/resumePipeline + /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/runs: + get: + deprecated: true + description: Returns a list of past Data Lake Pipeline runs. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listPipelineRuns + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: If specified, Atlas returns only Data Lake Pipeline runs initiated before this time and date. + in: query + name: createdBefore + schema: + format: date-time + type: string + x-xgen-IPA-exception: + xgen-IPA-121-date-time-fields-mention-iso-8601: Schema predates IPA validation + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedPipelineRun" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Data Lake Pipeline Runs in One Project + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPipelineRuns --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPipelineRunsApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + ListPipelineRunsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/runs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/runs?pretty=true" + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/listPipelineRuns + /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/runs/{pipelineRunId}: + delete: + deprecated: true + description: Deletes dataset that Atlas generated during the specified pipeline run. + operationId: deletePipelineRunDataset + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + - description: Unique 24-hexadecimal character string that identifies a Data Lake Pipeline run. + in: path + name: pipelineRunId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/RequestAccepted" + x-xgen-version: 2023-01-01 + description: Accepted + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Pipeline Run Dataset + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deletePipelineRunDataset --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeletePipelineRunDatasetApiParams{} + httpResp, err := client.DataLakePipelinesApi. + DeletePipelineRunDatasetWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/runs/{pipelineRunId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/runs/{pipelineRunId}" + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/deletePipelineRunDataset + get: + deprecated: true + description: Returns the details of one Data Lake Pipeline run within the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getPipelineRun + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + - description: Unique 24-hexadecimal character string that identifies a Data Lake Pipeline run. + in: path + name: pipelineRunId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/IngestionPipelineRun" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Data Lake Pipeline Run + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPipelineRun --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPipelineRunApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + GetPipelineRunWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/runs/{pipelineRunId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/runs/{pipelineRunId}?pretty=true" + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/getPipelineRun + /api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/trigger: + post: + deprecated: true + description: Triggers a Data Lake Pipeline ingestion of a specified snapshot. + operationId: triggerSnapshotIngestion + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the Data Lake Pipeline. + in: path + name: pipelineName + required: true + schema: + pattern: ^[^/\\ "$]{1,64}$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TriggerIngestionPipelineRequest" + description: Triggers a single ingestion run of a snapshot. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/IngestionPipelineRun" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Trigger On-Demand Snapshot Ingestion + tags: + - Data Lake Pipelines + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api triggerSnapshotIngestion --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.TriggerSnapshotIngestionApiParams{} + sdkResp, httpResp, err := client.DataLakePipelinesApi. + TriggerSnapshotIngestionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/trigger" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}/trigger" \ + -d '{ }' + x-sunset: 2025-09-09 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Lake-Pipelines/operation/triggerSnapshotIngestion + /api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService: + get: + description: Returns the name, interfaces, and state of all private endpoint services for the specified cloud service provider. This cloud service provider manages the private endpoint service for the project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listPrivateEndpointServices + parameters: + - $ref: "#/components/parameters/groupId" + - description: Cloud service provider that manages this private endpoint service. + in: path + name: cloudProvider + required: true + schema: + default: AWS + type: string + x-xgen-IPA-exception: + xgen-IPA-119-no-default-for-cloud-providers: Schema predates IPA validation + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/EndpointService" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Private Endpoint Services for One Provider + tags: + - Private Endpoint Services + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPrivateEndpointServices --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPrivateEndpointServicesApiParams{} + sdkResp, httpResp, err := client.PrivateEndpointServicesApi. + ListPrivateEndpointServicesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/listPrivateEndpointServices + /api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}: + delete: + description: Removes one private endpoint service from the specified project. This cloud service provider manages the private endpoint service that belongs to the project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deletePrivateEndpointService + parameters: + - $ref: "#/components/parameters/groupId" + - description: Cloud service provider that manages this private endpoint service. + in: path + name: cloudProvider + required: true + schema: + default: AWS + type: string + x-xgen-IPA-exception: + xgen-IPA-119-no-default-for-cloud-providers: Schema predates IPA validation + - description: Unique 24-hexadecimal digit string that identifies the private endpoint service that you want to delete. + in: path + name: endpointServiceId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Private Endpoint Service for One Provider + tags: + - Private Endpoint Services + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deletePrivateEndpointService --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeletePrivateEndpointServiceApiParams{} + httpResp, err := client.PrivateEndpointServicesApi. + DeletePrivateEndpointServiceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/deletePrivateEndpointService + get: + description: Returns the name, interfaces, and state of the specified private endpoint service from one project. The cloud service provider hosted this private endpoint service that belongs to the project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getPrivateEndpointService + parameters: + - $ref: "#/components/parameters/groupId" + - description: Cloud service provider that manages this private endpoint service. + in: path + name: cloudProvider + required: true + schema: + default: AWS + type: string + x-xgen-IPA-exception: + xgen-IPA-119-no-default-for-cloud-providers: Schema predates IPA validation + - description: Unique 24-hexadecimal digit string that identifies the private endpoint service that you want to return. + in: path + name: endpointServiceId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EndpointService" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Private Endpoint Service for One Provider + tags: + - Private Endpoint Services + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPrivateEndpointService --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPrivateEndpointServiceApiParams{} + sdkResp, httpResp, err := client.PrivateEndpointServicesApi. + GetPrivateEndpointServiceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/getPrivateEndpointService + /api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}/endpoint: + post: + description: Creates one private endpoint for the specified cloud service provider. This cloud service provider manages the private endpoint service, which in turn manages the private endpoints for the project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. To learn more about considerations, limitations, and prerequisites, see the MongoDB documentation for setting up a private endpoint. + operationId: createPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Cloud service provider that manages this private endpoint. + in: path + name: cloudProvider + required: true + schema: + default: AWS + type: string + x-xgen-IPA-exception: + xgen-IPA-119-no-default-for-cloud-providers: Schema predates IPA validation + - description: Unique 24-hexadecimal digit string that identifies the private endpoint service for which you want to create a private endpoint. + in: path + name: endpointServiceId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CreateEndpointRequest" + description: Creates one private endpoint for the specified cloud service provider. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PrivateLinkEndpoint" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Private Endpoint for One Provider + tags: + - Private Endpoint Services + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreatePrivateEndpointApiParams{} + sdkResp, httpResp, err := client.PrivateEndpointServicesApi. + CreatePrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}/endpoint" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}/endpoint" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/createPrivateEndpoint + /api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}/endpoint/{endpointId}: + delete: + description: Removes one private endpoint from the specified project and private endpoint service, as managed by the specified cloud service provider. When the last private endpoint is removed from a given private endpoint service, that private endpoint service is also removed. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deletePrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Cloud service provider that manages this private endpoint. + in: path + name: cloudProvider + required: true + schema: + default: AWS + type: string + x-xgen-IPA-exception: + xgen-IPA-119-no-default-for-cloud-providers: Schema predates IPA validation + - description: Unique string that identifies the private endpoint you want to delete. The format of the **endpointId** parameter differs for AWS and Azure. You must URL encode the **endpointId** for Azure private endpoints. + in: path + name: endpointId + required: true + schema: + pattern: ^vpce-[0-9a-f]{17}|^%2[fF]subscriptions%2[fF][0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}%2[fF]resource[gG]roups%2[fF]([-\w._()]+)%2[fF]providers%2[fF]Microsoft\.Network%2[fF]privateEndpoints%2[fF]([-\w._()]+) + type: string + - description: Unique 24-hexadecimal digit string that identifies the private endpoint service from which you want to delete a private endpoint. + in: path + name: endpointServiceId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Private Endpoint for One Provider + tags: + - Private Endpoint Services + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deletePrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeletePrivateEndpointApiParams{} + httpResp, err := client.PrivateEndpointServicesApi. + DeletePrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}/endpoint/{endpointId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}/endpoint/{endpointId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/deletePrivateEndpoint + get: + description: Returns the connection state of the specified private endpoint. The private endpoint service manages this private endpoint which belongs to one project hosted from one cloud service provider. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Cloud service provider that manages this private endpoint. + in: path + name: cloudProvider + required: true + schema: + default: AWS + type: string + x-xgen-IPA-exception: + xgen-IPA-119-no-default-for-cloud-providers: Schema predates IPA validation + - description: Unique string that identifies the private endpoint you want to return. The format of the **endpointId** parameter differs for AWS and Azure. You must URL encode the **endpointId** for Azure private endpoints. + in: path + name: endpointId + required: true + schema: + pattern: ^vpce-[0-9a-f]{17}|^%2[fF]subscriptions%2[fF][0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}%2[fF]resource[gG]roups%2[fF]([-\w._()]+)%2[fF]providers%2[fF]Microsoft\.Network%2[fF]privateEndpoints%2[fF]([-\w._()]+) + type: string + - description: Unique 24-hexadecimal digit string that identifies the private endpoint service for which you want to return a private endpoint. + in: path + name: endpointServiceId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PrivateLinkEndpoint" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Private Endpoint for One Provider + tags: + - Private Endpoint Services + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPrivateEndpointApiParams{} + sdkResp, httpResp, err := client.PrivateEndpointServicesApi. + GetPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}/endpoint/{endpointId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}/endpoint/{endpointId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/getPrivateEndpoint + /api/atlas/v2/groups/{groupId}/privateEndpoint/endpointService: + post: + description: Creates one private endpoint service for the specified cloud service provider. This cloud service provider manages the private endpoint service for the project. When you create a private endpoint service, MongoDB Cloud creates a network container in the project for the cloud provider for which you create the private endpoint service if one doesn't already exist. To learn more about private endpoint terminology in MongoDB Cloud, see Private Endpoint Concepts. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + externalDocs: + description: Private Endpoint Concepts + url: https://dochub.mongodb.org/core/private-endpoint-concepts + operationId: createPrivateEndpointService + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudProviderEndpointServiceRequest" + description: Creates one private endpoint for the specified cloud service provider. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EndpointService" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Private Endpoint Service for One Provider + tags: + - Private Endpoint Services + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createPrivateEndpointService --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreatePrivateEndpointServiceApiParams{} + sdkResp, httpResp, err := client.PrivateEndpointServicesApi. + CreatePrivateEndpointServiceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/endpointService" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/endpointService" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/createPrivateEndpointService + /api/atlas/v2/groups/{groupId}/privateEndpoint/regionalMode: + get: + description: Checks whether each region in the specified cloud service provider can create multiple private endpoints per region. The cloud service provider manages the private endpoint for the project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getRegionalizedPrivateEndpointSetting + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ProjectSettingItem" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Regionalized Private Endpoint Status + tags: + - Private Endpoint Services + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getRegionalizedPrivateEndpointSetting --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetRegionalizedPrivateEndpointSettingApiParams{} + sdkResp, httpResp, err := client.PrivateEndpointServicesApi. + GetRegionalizedPrivateEndpointSettingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/regionalMode?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/regionalMode?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/getRegionalizedPrivateEndpointSetting + patch: + description: Enables or disables the ability to create multiple private endpoints per region in all cloud service providers in one project. The cloud service provider manages the private endpoints for the project. Connection strings to existing multi-region and global sharded clusters change when you enable this setting. You must update your applications to use the new connection strings. This might cause downtime. To use this resource, the requesting Service Account or API Key must have the Project Owner role and all clusters in the deployment must be sharded clusters. Once enabled, you cannot create replica sets. + operationId: toggleRegionalizedPrivateEndpointSetting + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ProjectSettingItem" + description: Enables or disables the ability to create multiple private endpoints per region in all cloud service providers in one project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ProjectSettingItem" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Toggle Regionalized Private Endpoint Status + tags: + - Private Endpoint Services + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api toggleRegionalizedPrivateEndpointSetting --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ToggleRegionalizedPrivateEndpointSettingApiParams{} + sdkResp, httpResp, err := client.PrivateEndpointServicesApi. + ToggleRegionalizedPrivateEndpointSettingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/regionalMode" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/regionalMode" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/toggleRegionalizedPrivateEndpointSetting + /api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint: + get: + description: |- + Returns all private endpoints for one serverless instance. You must have at least the Project Read Only role for the project to successfully call this resource. + + This feature does not work for Flex clusters. To continue using Private Endpoints once Serverless is replaced by Flex, please use a Dedicated cluster instead. + operationId: listServerlessPrivateEndpoints + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance associated with the tenant endpoint. + in: path + name: instanceName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/ServerlessTenantEndpoint" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Private Endpoints for One Serverless Instance + tags: + - Serverless Private Endpoints + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listServerlessPrivateEndpoints --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListServerlessPrivateEndpointsApiParams{} + sdkResp, httpResp, err := client.ServerlessPrivateEndpointsApi. + ListServerlessPrivateEndpointsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Private-Endpoints/operation/listServerlessPrivateEndpoints + post: + description: |- + Creates one private endpoint for one serverless instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + A new endpoint won't be immediately available after creation. Read the steps in the linked tutorial for detailed guidance. + + This feature does not work for Flex clusters. To continue using Private Endpoints once Serverless is replaced by Flex, please use a Dedicated cluster instead. + externalDocs: + description: Set Up a Private Endpoint for a Serverless Instance Tutorial + url: https://dochub.mongodb.org/core/serverless-private-endpoint + operationId: createServerlessPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance for which the tenant endpoint will be created. + in: path + name: instanceName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessTenantCreateRequest" + description: Information about the Private Endpoint to create for the Serverless Instance. + required: true + responses: + "201": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessTenantEndpoint" + x-xgen-version: 2023-01-01 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Private Endpoint for One Serverless Instance + tags: + - Serverless Private Endpoints + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createServerlessPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateServerlessPrivateEndpointApiParams{} + sdkResp, httpResp, err := client.ServerlessPrivateEndpointsApi. + CreateServerlessPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Private-Endpoints/operation/createServerlessPrivateEndpoint + /api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId}: + delete: + description: |- + Remove one private endpoint from one serverless instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + This feature does not work for Flex clusters. To continue using Private Endpoints once Serverless is replaced by Flex, please use a Dedicated cluster instead. + operationId: deleteServerlessPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance from which the tenant endpoint will be removed. + in: path + name: instanceName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the tenant endpoint which will be removed. + in: path + name: endpointId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Private Endpoint for One Serverless Instance + tags: + - Serverless Private Endpoints + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteServerlessPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteServerlessPrivateEndpointApiParams{} + httpResp, err := client.ServerlessPrivateEndpointsApi. + DeleteServerlessPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Private-Endpoints/operation/deleteServerlessPrivateEndpoint + get: + description: |- + Return one private endpoint for one serverless instance. Identify this endpoint using its unique ID. You must have at least the Project Read Only role for the project to successfully call this resource. + + This feature does not work for Flex clusters. To continue using Private Endpoints once Serverless is replaced by Flex, please use a Dedicated cluster instead. + operationId: getServerlessPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance associated with the tenant endpoint. + in: path + name: instanceName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the tenant endpoint. + in: path + name: endpointId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessTenantEndpoint" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Private Endpoint for One Serverless Instance + tags: + - Serverless Private Endpoints + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getServerlessPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetServerlessPrivateEndpointApiParams{} + sdkResp, httpResp, err := client.ServerlessPrivateEndpointsApi. + GetServerlessPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Private-Endpoints/operation/getServerlessPrivateEndpoint + patch: + description: |- + Updates one private endpoint for one serverless instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + This feature does not work for Flex clusters. To continue using Private Endpoints once Serverless is replaced by Flex, please use a Dedicated cluster instead. + operationId: updateServerlessPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance associated with the tenant endpoint that will be updated. + in: path + name: instanceName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the tenant endpoint which will be updated. + in: path + name: endpointId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessTenantEndpointUpdate" + description: Object used for update. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessTenantEndpoint" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Private Endpoint for One Serverless Instance + tags: + - Serverless Private Endpoints + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateServerlessPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateServerlessPrivateEndpointApiParams{} + sdkResp, httpResp, err := client.ServerlessPrivateEndpointsApi. + UpdateServerlessPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateEndpoint/serverless/instance/{instanceName}/endpoint/{endpointId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Private-Endpoints/operation/updateServerlessPrivateEndpoint + /api/atlas/v2/groups/{groupId}/privateIpMode: + get: + deprecated: true + description: Verifies if someone set the specified project to **Connect via Peering Only** mode. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + externalDocs: + description: Changes to Connection Strings + url: https://docs.atlas.mongodb.com/reference/faq/connection-changes/ + operationId: verifyConnectViaPeeringOnlyModeForOneProject + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PrivateIPMode" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Verify Connect via Peering-Only Mode for One Project + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api verifyConnectViaPeeringOnlyModeForOneProject --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.VerifyConnectViaPeeringOnlyModeForOneProjectApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + VerifyConnectViaPeeringOnlyModeForOneProjectWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateIpMode?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateIpMode?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/verifyConnectViaPeeringOnlyModeForOneProject + patch: + deprecated: true + description: Disables Connect via Peering Only mode for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + externalDocs: + description: Changes to Connection Strings + url: https://docs.atlas.mongodb.com/reference/faq/connection-changes/ + operationId: disablePeering + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PrivateIPMode" + description: Disables Connect via Peering Only mode for the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PrivateIPMode" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Disable Connect via Peering-Only Mode for One Project + tags: + - Network Peering + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api disablePeering --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DisablePeeringApiParams{} + sdkResp, httpResp, err := client.NetworkPeeringApi. + DisablePeeringWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateIpMode" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateIpMode" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Network-Peering/operation/disablePeering + /api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds: + get: + description: Returns all private endpoints for Federated Database Instances and Online Archives in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only or Project Charts Admin roles. + operationId: listDataFederationPrivateEndpoints + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedPrivateNetworkEndpointIdEntry" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Federated Database Instance and Online Archive Private Endpoints in One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listDataFederationPrivateEndpoints --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListDataFederationPrivateEndpointsApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + ListDataFederationPrivateEndpointsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/listDataFederationPrivateEndpoints + post: + description: |- + Adds one private endpoint for Federated Database Instances and Online Archives to the specified projects. If the endpoint ID already exists and the associated comment is unchanged, Atlas Data Federation makes no change to the endpoint ID list. If the endpoint ID already exists and the associated comment is changed, Atlas Data Federation updates the comment value only in the endpoint ID list. If the endpoint ID doesn't exist, Atlas Data Federation appends the new endpoint to the list of endpoints in the endpoint ID list. Each region has an associated service name for the various endpoints in each region. + + `us-east-1` is `com.amazonaws.vpce.us-east-1.vpce-svc-00e311695874992b4`. + + `us-west-1` is `com.amazonaws.vpce.us-west-2.vpce-svc-09d86b19e59d1b4bb`. + + `eu-west-1` is `com.amazonaws.vpce.eu-west-1.vpce-svc-0824460b72e1a420e`. + + `eu-west-2` is `com.amazonaws.vpce.eu-west-2.vpce-svc-052f1840aa0c4f1f9`. + + `eu-central-1` is `com.amazonaws.vpce.eu-central-1.vpce-svc-0ac8ce91871138c0d`. + + `sa-east-1` is `com.amazonaws.vpce.sa-east-1.vpce-svc-0b56e75e8cdf50044`. + + `ap-southeast-2` is `com.amazonaws.vpce.ap-southeast-2.vpce-svc-036f1de74d761706e`. + + `ap-south-1` is `com.amazonaws.vpce.ap-south-1.vpce-svc-03eb8a541f96d356d`. + + To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Charts Admin roles. + operationId: createDataFederationPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PrivateNetworkEndpointIdEntry" + description: Private endpoint for Federated Database Instances and Online Archives to add to the specified project. + required: true + responses: + "201": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedPrivateNetworkEndpointIdEntry" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Federated Database Instance and Online Archive Private Endpoint for One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createDataFederationPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateDataFederationPrivateEndpointApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + CreateDataFederationPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/createDataFederationPrivateEndpoint + /api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds/{endpointId}: + delete: + description: Removes one private endpoint for Federated Database Instances and Online Archives in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deleteDataFederationPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 22-character alphanumeric string that identifies the private endpoint to remove. Atlas Data Federation supports AWS private endpoints using the AWS PrivateLink feature. + in: path + name: endpointId + required: true + schema: + pattern: ^vpce-[0-9a-f]{17}$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Federated Database Instance and Online Archive Private Endpoint from One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteDataFederationPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteDataFederationPrivateEndpointApiParams{} + httpResp, err := client.DataFederationApi. + DeleteDataFederationPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds/{endpointId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds/{endpointId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/deleteDataFederationPrivateEndpoint + get: + description: Returns the specified private endpoint for Federated Database Instances or Online Archives in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only or Project Charts Admin roles. + operationId: getDataFederationPrivateEndpoint + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 22-character alphanumeric string that identifies the private endpoint to return. Atlas Data Federation supports AWS private endpoints using the AWS PrivateLink feature. + in: path + name: endpointId + required: true + schema: + pattern: ^vpce-[0-9a-f]{17}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PrivateNetworkEndpointIdEntry" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Federated Database Instance and Online Archive Private Endpoint in One Project + tags: + - Data Federation + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getDataFederationPrivateEndpoint --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetDataFederationPrivateEndpointApiParams{} + sdkResp, httpResp, err := client.DataFederationApi. + GetDataFederationPrivateEndpointWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds/{endpointId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/privateNetworkSettings/endpointIds/{endpointId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Data-Federation/operation/getDataFederationPrivateEndpoint + /api/atlas/v2/groups/{groupId}/processes: + get: + description: Returns details of all processes for the specified project. A MongoDB process can be either a `mongod` or `mongos`. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listAtlasProcesses + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedHostView_Atlas" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All MongoDB Processes in One Project + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listAtlasProcesses --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListAtlasProcessesApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + ListAtlasProcessesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/listAtlasProcesses + /api/atlas/v2/groups/{groupId}/processes/{processId}: + get: + description: Returns the processes for the specified host for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getAtlasProcess + parameters: + - $ref: "#/components/parameters/groupId" + - description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiHostView_Atlas" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One MongoDB Process by ID + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAtlasProcess --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAtlasProcessApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + GetAtlasProcessWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/getAtlasProcess + /api/atlas/v2/groups/{groupId}/processes/{processId}/{databaseName}/{collectionName}/collStats/measurements: + get: + description: Get a list of the Coll Stats Latency process-level measurements for the given namespace. + operationId: getCollStatsLatencyNamespaceHostMeasurements + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/processId" + - $ref: "#/components/parameters/databaseName" + - $ref: "#/components/parameters/collectionName" + - description: List that contains the metrics that you want to retrieve for the associated data series. If you don't set this parameter, this resource returns data series for all Coll Stats Latency metrics. + in: query + name: metrics + schema: + items: + description: Metric requested for the given process + type: string + type: array + uniqueItems: true + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/period" + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/MeasurementsCollStatsLatencyHost" + x-xgen-version: 2023-11-15 + description: Succeeded + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Host-Level Query Latency + tags: + - Collection Level Metrics + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getCollStatsLatencyNamespaceHostMeasurements --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetCollStatsLatencyNamespaceHostMeasurementsApiParams{} + sdkResp, httpResp, err := client.CollectionLevelMetricsApi. + GetCollStatsLatencyNamespaceHostMeasurementsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/{databaseName}/{collectionName}/collStats/measurements?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/{databaseName}/{collectionName}/collStats/measurements?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/getCollStatsLatencyNamespaceHostMeasurements + /api/atlas/v2/groups/{groupId}/processes/{processId}/collStats/namespaces: + get: + description: Return the subset of namespaces from the given process ranked by highest total execution time (descending) within the given time window. + operationId: getCollStatsLatencyNamespacesForHost + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/processId" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + - $ref: "#/components/parameters/period" + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/CollStatsRankedNamespaces" + x-xgen-version: 2023-11-15 + description: Succeeded + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Ranked Namespaces from a Host + tags: + - Collection Level Metrics + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getCollStatsLatencyNamespacesForHost --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetCollStatsLatencyNamespacesForHostApiParams{} + sdkResp, httpResp, err := client.CollectionLevelMetricsApi. + GetCollStatsLatencyNamespacesForHostWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/collStats/namespaces?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/collStats/namespaces?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Collection-Level-Metrics/operation/getCollStatsLatencyNamespacesForHost + /api/atlas/v2/groups/{groupId}/processes/{processId}/databases: + get: + description: Returns the list of databases running on the specified host for the specified project. `M0` free clusters, `M2`, `M5`, serverless, and Flex clusters have some operational limits. The MongoDB Cloud process must be a `mongod`. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + externalDocs: + description: Operational Limits + url: https://www.mongodb.com/docs/atlas/reference/limitations/ + operationId: listDatabases + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedDatabase" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Available Databases for One MongoDB Process + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listDatabases --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListDatabasesApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + ListDatabasesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/databases?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/databases?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/listDatabases + /api/atlas/v2/groups/{groupId}/processes/{processId}/databases/{databaseName}: + get: + description: Returns one database running on the specified host for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getDatabase + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the database that the specified MongoDB process serves. + in: path + name: databaseName + required: true + schema: + type: string + - description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/MesurementsDatabase" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Database for One MongoDB Process + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getDatabase --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetDatabaseApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + GetDatabaseWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/databases/{databaseName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/databases/{databaseName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/getDatabase + /api/atlas/v2/groups/{groupId}/processes/{processId}/databases/{databaseName}/measurements: + get: + description: Returns the measurements of one database for the specified host for the specified project. Returns the database's on-disk storage space based on the MongoDB `dbStats` command output. To calculate some metric series, Atlas takes the rate between every two adjacent points. For these metric series, the first data point has a null value because Atlas can't calculate a rate for the first data point given the query time range. Atlas retrieves database metrics every 20 minutes but reduces frequency when necessary to optimize database performance. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getDatabaseMeasurements + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the database that the specified MongoDB process serves. + in: path + name: databaseName + required: true + schema: + type: string + - description: One or more types of measurement to request for this MongoDB process. If omitted, the resource returns all measurements. To specify multiple values for `m`, repeat the `m` parameter for each value. Specify measurements that apply to the specified host. MongoDB Cloud returns an error if you specified any invalid measurements. + in: query + name: m + schema: + items: + description: One measurement requested for this MongoDB process. + type: string + maxItems: 10 + minItems: 1 + type: array + uniqueItems: true + style: form + - description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + - $ref: "#/components/parameters/granularity" + - $ref: "#/components/parameters/period" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiMeasurementsGeneralView_Atlas" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Measurements for One Database in One MongoDB Process + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getDatabaseMeasurements --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetDatabaseMeasurementsApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + GetDatabaseMeasurementsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/databases/{databaseName}/measurements?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/databases/{databaseName}/measurements?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/getDatabaseMeasurements + /api/atlas/v2/groups/{groupId}/processes/{processId}/disks: + get: + description: Returns the list of disks or partitions for the specified host for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listDiskPartitions + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedDiskPartition" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Available Disks for One MongoDB Process + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listDiskPartitions --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListDiskPartitionsApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + ListDiskPartitionsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/disks?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/disks?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/listDiskPartitions + /api/atlas/v2/groups/{groupId}/processes/{processId}/disks/{partitionName}: + get: + description: Returns measurement details for one disk or partition for the specified host for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listDiskMeasurements + parameters: + - description: Human-readable label of the disk or partition to which the measurements apply. + in: path + name: partitionName + required: true + schema: + type: string + - $ref: "#/components/parameters/groupId" + - description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/MeasurementDiskPartition" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Measurements for One Disk + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listDiskMeasurements --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListDiskMeasurementsApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + ListDiskMeasurementsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/disks/{partitionName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/disks/{partitionName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/listDiskMeasurements + /api/atlas/v2/groups/{groupId}/processes/{processId}/disks/{partitionName}/measurements: + get: + description: |- + Returns the measurements of one disk or partition for the specified host for the specified project. Returned value can be one of the following: + - Throughput of I/O operations for the disk partition used for the MongoDB process + - Percentage of time during which requests the partition issued and serviced + - Latency per operation type of the disk partition used for the MongoDB process + - Amount of free and used disk space on the disk partition used for the MongoDB process + + To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getDiskMeasurements + parameters: + - $ref: "#/components/parameters/groupId" + - description: One or more types of measurement to request for this MongoDB process. If omitted, the resource returns all measurements. To specify multiple values for `m`, repeat the `m` parameter for each value. Specify measurements that apply to the specified host. MongoDB Cloud returns an error if you specified any invalid measurements. + in: query + name: m + schema: + items: + description: One measurement requested for this MongoDB process. + type: string + maxItems: 10 + minItems: 1 + type: array + uniqueItems: true + style: form + - description: Human-readable label of the disk or partition to which the measurements apply. + in: path + name: partitionName + required: true + schema: + type: string + - description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + - $ref: "#/components/parameters/granularity" + - $ref: "#/components/parameters/period" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiMeasurementsGeneralView_Atlas" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Measurements of One Disk for One MongoDB Process + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getDiskMeasurements --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetDiskMeasurementsApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + GetDiskMeasurementsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/disks/{partitionName}/measurements?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/disks/{partitionName}/measurements?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/getDiskMeasurements + /api/atlas/v2/groups/{groupId}/processes/{processId}/measurements: + get: + description: |- + Returns disk, partition, or host measurements per process for the specified host for the specified project. Returned value can be one of the following: + - Throughput of I/O operations for the disk partition used for the MongoDB process + - Percentage of time during which requests the partition issued and serviced + - Latency per operation type of the disk partition used for the MongoDB process + - Amount of free and used disk space on the disk partition used for the MongoDB process + - Measurements for the host, such as CPU usage or number of I/O operations + + To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getHostMeasurements + parameters: + - $ref: "#/components/parameters/groupId" + - description: One or more types of measurement to request for this MongoDB process. If omitted, the resource returns all measurements. To specify multiple values for `m`, repeat the `m` parameter for each value. Specify measurements that apply to the specified host. MongoDB Cloud returns an error if you specified any invalid measurements. + in: query + name: m + schema: + items: + description: One measurement requested for this MongoDB process. + type: string + maxItems: 10 + minItems: 1 + type: array + uniqueItems: true + style: form + - $ref: "#/components/parameters/period" + - description: Combination of hostname and Internet Assigned Numbers Authority (IANA) port that serves the MongoDB process. The host must be the hostname, fully qualified domain name (FQDN), or Internet Protocol address (IPv4 or IPv6) of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + example: mongodb.example.com:27017 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + - $ref: "#/components/parameters/granularity" + - $ref: "#/components/parameters/start" + - $ref: "#/components/parameters/end" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiMeasurementsGeneralView_Atlas" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Measurements for One MongoDB Process + tags: + - Monitoring and Logs + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getHostMeasurements --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetHostMeasurementsApiParams{} + sdkResp, httpResp, err := client.MonitoringandLogsApi. + GetHostMeasurementsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/measurements?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/measurements?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Monitoring-and-Logs/operation/getHostMeasurements + /api/atlas/v2/groups/{groupId}/processes/{processId}/performanceAdvisor/namespaces: + get: + description: Returns up to 20 namespaces for collections experiencing slow queries on the specified host. If you specify a secondary member of a replica set that hasn't received any database read operations, the endpoint doesn't return any namespaces. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listSlowQueryNamespaces + parameters: + - $ref: "#/components/parameters/groupId" + - description: |- + Length of time expressed during which the query finds suggested indexes among the managed namespaces in the cluster. This parameter expresses its value in milliseconds. + + - If you don't specify the **since** parameter, the endpoint returns data covering the duration before the current time. + - If you specify neither the **duration** nor **since** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: duration + schema: + format: int64 + type: integer + - description: Combination of host and port that serves the MongoDB process. The host must be the hostname, FQDN, IPv4 address, or IPv6 address of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + - description: |- + Date and time from which the query retrieves the suggested indexes. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). + + - If you don't specify the **duration** parameter, the endpoint returns data covering from the **since** value and the current time. + - If you specify neither the **duration** nor the **since** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: since + schema: + format: int64 + minimum: 1199145600000 + type: integer + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/Namespaces" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Namespaces for One Host + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listSlowQueryNamespaces --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListSlowQueryNamespacesApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + ListSlowQueryNamespacesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/performanceAdvisor/namespaces?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/performanceAdvisor/namespaces?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/listSlowQueryNamespaces + /api/atlas/v2/groups/{groupId}/processes/{processId}/performanceAdvisor/slowQueryLogs: + get: + description: Returns log lines for slow queries that the Performance Advisor and Query Profiler identified. The Performance Advisor monitors queries that MongoDB considers slow and suggests new indexes to improve query performance. MongoDB Cloud bases the threshold for slow queries on the average time of operations on your cluster. This enables workload-relevant recommendations. To use this resource, the requesting Service Account or API Key must have any Project Data Access role or the Project Observability Viewer role. + operationId: listSlowQueries + parameters: + - $ref: "#/components/parameters/groupId" + - description: |- + Length of time expressed during which the query finds slow queries among the managed namespaces in the cluster. This parameter expresses its value in milliseconds. + + - If you don't specify the **since** parameter, the endpoint returns data covering the duration before the current time. + - If you specify neither the **duration** nor **since** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: duration + schema: + format: int64 + type: integer + - description: "Namespaces from which to retrieve slow queries. A namespace consists of one database and one collection resource written as `.`: `.`. To include multiple namespaces, pass the parameter multiple times delimited with an ampersand (`&`) between each namespace. Omit this parameter to return results for all namespaces." + in: query + name: namespaces + schema: + items: + type: string + type: array + style: form + - description: Maximum number of lines from the log to return. + in: query + name: nLogs + schema: + default: 20000 + format: int64 + maximum: 20000 + minimum: 0 + type: integer + - description: Combination of host and port that serves the MongoDB process. The host must be the hostname, FQDN, IPv4 address, or IPv6 address of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + - description: |- + Date and time from which the query retrieves the slow queries. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). + + - If you don't specify the **duration** parameter, the endpoint returns data covering from the **since** value and the current time. + - If you specify neither the **duration** nor the **since** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: since + schema: + format: int64 + minimum: 1199145600000 + type: integer + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + - description: Whether or not to include metrics extracted from the slow query log as separate fields. + in: query + name: includeMetrics + schema: + default: false + type: boolean + - description: Whether or not to include the replica state of the host when the slow query log was generated as a separate field. + in: query + name: includeReplicaState + schema: + default: false + type: boolean + - description: Whether or not to include the operation type (read/write/command) extracted from the slow query log as a separate field. + in: query + name: includeOpType + schema: + default: false + type: boolean + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PerformanceAdvisorSlowQueryList" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Slow Queries + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listSlowQueries --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListSlowQueriesApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + ListSlowQueriesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/performanceAdvisor/slowQueryLogs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/performanceAdvisor/slowQueryLogs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/listSlowQueries + /api/atlas/v2/groups/{groupId}/processes/{processId}/performanceAdvisor/suggestedIndexes: + get: + description: Returns the indexes that the Performance Advisor suggests. The Performance Advisor monitors queries that MongoDB considers slow and suggests new indexes to improve query performance. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listSuggestedIndexes + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: |- + Length of time expressed during which the query finds suggested indexes among the managed namespaces in the cluster. This parameter expresses its value in milliseconds. + + - If you don't specify the **since** parameter, the endpoint returns data covering the duration before the current time. + - If you specify neither the **duration** nor **since** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: duration + schema: + format: int64 + type: integer + - description: "Namespaces from which to retrieve suggested indexes. A namespace consists of one database and one collection resource written as `.`: `.`. To include multiple namespaces, pass the parameter multiple times delimited with an ampersand (`&`) between each namespace. Omit this parameter to return results for all namespaces." + in: query + name: namespaces + schema: + items: + type: string + type: array + style: form + - description: Maximum number of example queries that benefit from the suggested index. + in: query + name: nExamples + schema: + default: 5 + format: int64 + type: integer + - description: Number that indicates the maximum indexes to suggest. + in: query + name: nIndexes + schema: + format: int64 + type: integer + - description: Combination of host and port that serves the MongoDB process. The host must be the hostname, FQDN, IPv4 address, or IPv6 address of the host that runs the MongoDB process (`mongod` or `mongos`). The port must be the IANA port on which the MongoDB process listens for requests. + in: path + name: processId + required: true + schema: + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-f]{1,4}\:){7}([0-9a-f]{1,4})|(([a-z0-9]+\.){1,10}[a-z]+)?(\:[0-9]{4,5})$ + type: string + - description: |- + Date and time from which the query retrieves the suggested indexes. This parameter expresses its value in the number of milliseconds that have elapsed since the [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time). + + - If you don't specify the **duration** parameter, the endpoint returns data covering from the **since** value and the current time. + - If you specify neither the **duration** nor the **since** parameters, the endpoint returns data from the previous 24 hours. + in: query + name: since + schema: + format: int64 + minimum: 1199145600000 + type: integer + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PerformanceAdvisorResponse" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Suggested Indexes + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listSuggestedIndexes --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListSuggestedIndexesApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + ListSuggestedIndexesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/performanceAdvisor/suggestedIndexes?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/processes/{processId}/performanceAdvisor/suggestedIndexes?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/listSuggestedIndexes + /api/atlas/v2/groups/{groupId}/pushBasedLogExport: + delete: + description: Disables the push-based log export feature by resetting the project level settings to its default configuration. + operationId: deletePushBasedLogConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Disable Push-Based Log Export for One Project + tags: + - Push-Based Log Export + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deletePushBasedLogConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeletePushBasedLogConfigurationApiParams{} + httpResp, err := client.Push - BasedLogExportApi. + DeletePushBasedLogConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pushBasedLogExport" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pushBasedLogExport" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Push-Based-Log-Export/operation/deletePushBasedLogConfiguration + get: + description: Fetches the current project level settings for the push-based log export feature. + operationId: getPushBasedLogConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PushBasedLogExportProject" + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-results-array: Singleton method, mistakenly identified as a List method. + xgen-IPA-110-collections-use-paginated-prefix: Singleton method, mistakenly identified as a List method. + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Push-Based Log Export Configuration for One Project + tags: + - Push-Based Log Export + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPushBasedLogConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPushBasedLogConfigurationApiParams{} + sdkResp, httpResp, err := client.Push - BasedLogExportApi. + GetPushBasedLogConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pushBasedLogExport?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pushBasedLogExport?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Push-Based-Log-Export/operation/getPushBasedLogConfiguration + patch: + description: Updates the project level settings for the push-based log export feature. + operationId: updatePushBasedLogConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PushBasedLogExportProject" + x-xgen-version: 2023-01-01 + description: The project configuration details. The S3 bucket name, IAM role ID, and prefix path fields are the only fields that may be specified. Fields left unspecified will not be modified. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Push-Based Log Export for One Project + tags: + - Push-Based Log Export + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updatePushBasedLogConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdatePushBasedLogConfigurationApiParams{} + sdkResp, httpResp, err := client.Push - BasedLogExportApi. + UpdatePushBasedLogConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pushBasedLogExport" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pushBasedLogExport" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Push-Based-Log-Export/operation/updatePushBasedLogConfiguration + post: + description: Configures the project level settings for the push-based log export feature. + operationId: createPushBasedLogConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CreatePushBasedLogExportProjectRequest" + x-xgen-version: 2023-01-01 + description: The project configuration details. The S3 bucket name, IAM role ID, and prefix path fields are required. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Enable Push-Based Log Export for One Project + tags: + - Push-Based Log Export + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createPushBasedLogConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreatePushBasedLogConfigurationApiParams{} + sdkResp, httpResp, err := client.Push - BasedLogExportApi. + CreatePushBasedLogConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pushBasedLogExport" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/pushBasedLogExport" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Push-Based-Log-Export/operation/createPushBasedLogConfiguration + /api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{name}: + post: + description: Requests loading the MongoDB sample dataset into the specified cluster. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: loadSampleDataset + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster into which you load the sample dataset. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "201": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/SampleDatasetStatus" + x-xgen-version: 2023-01-01 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Load Sample Dataset into One Cluster + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api loadSampleDataset --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.LoadSampleDatasetApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + LoadSampleDatasetWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{name}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{name}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/loadSampleDataset + /api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{sampleDatasetId}: + get: + description: Checks the progress of loading the sample dataset into one cluster. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: getSampleDatasetLoadStatus + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the loaded sample dataset. + in: path + name: sampleDatasetId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/SampleDatasetStatus" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Status of Sample Dataset Load for One Cluster + tags: + - Clusters + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getSampleDatasetLoadStatus --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetSampleDatasetLoadStatusApiParams{} + sdkResp, httpResp, err := client.ClustersApi. + GetSampleDatasetLoadStatusWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{sampleDatasetId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{sampleDatasetId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/getSampleDatasetLoadStatus + /api/atlas/v2/groups/{groupId}/serverless: + get: + description: |- + Returns details for all serverless instances in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This endpoint also lists Flex clusters that were created using the [createServerlessInstance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance) endpoint or former Serverless instances that have been migrated to Flex clusters, until January 2026 after which this endpoint will be sunset. Continuous backups are not supported and serverlessContinuousBackupEnabled will not take effect on these clusters. Please use the listFlexClusters endpoint instead. + externalDocs: + description: listFlexClusters + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/listFlexClusters + operationId: listServerlessInstances + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedServerlessInstanceDescription" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Serverless Instances in One Project + tags: + - Serverless Instances + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listServerlessInstances --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListServerlessInstancesApiParams{} + sdkResp, httpResp, err := client.ServerlessInstancesApi. + ListServerlessInstancesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/listServerlessInstances + post: + description: |- + Update as of Feb 2025: This endpoint now creates a Flex cluster instead. This endpoint will no longer be supported starting January 2026. Continuous backups are not supported and serverlessContinuousBackupEnabled will not take effect. Please use the createFlexCluster endpoint instead. + + Creates one serverless instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + externalDocs: + description: createFlexCluster + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/createFlexCluster + operationId: createServerlessInstance + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessInstanceDescriptionCreate" + description: Create One Serverless Instance in One Project. + required: true + responses: + "201": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessInstanceDescription" + x-xgen-version: 2023-01-01 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Serverless Instance in One Project + tags: + - Serverless Instances + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createServerlessInstance --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateServerlessInstanceApiParams{} + sdkResp, httpResp, err := client.ServerlessInstancesApi. + CreateServerlessInstanceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance + /api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/restoreJobs: + get: + description: |- + Returns all restore jobs for one serverless instance from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + This API can also be used on Flex clusters that were created with the [createServerlessInstance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance) endpoint or Flex clusters that were migrated from Serverless instances. This endpoint will be sunset in January 2026. Please use the listFlexBackupRestoreJobs endpoint instead. + externalDocs: + description: listFlexBackupRestoreJobs + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/listFlexBackupRestoreJobs + operationId: listServerlessBackupRestoreJobs + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the serverless instance. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiAtlasServerlessBackupRestoreJob" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Restore Jobs for One Serverless Instance + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listServerlessBackupRestoreJobs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListServerlessBackupRestoreJobsApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + ListServerlessBackupRestoreJobsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/restoreJobs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/restoreJobs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/listServerlessBackupRestoreJobs + post: + description: |- + Restores one snapshot of one serverless instance from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + This API can also be used on Flex clusters that were created with the [createServerlessInstance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance) endpoint or Flex clusters that were migrated from Serverless instances. This endpoint will be sunset in January 2026. Please use the createFlexBackupRestoreJob endpoint instead. + externalDocs: + description: createFlexBackupRestoreJob + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/createFlexBackupRestoreJob + operationId: createServerlessBackupRestoreJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance whose snapshot you want to restore. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessBackupRestoreJob" + description: Restores one snapshot of one serverless instance from the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessBackupRestoreJob" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Restore One Snapshot of One Serverless Instance + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createServerlessBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateServerlessBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + CreateServerlessBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/restoreJobs" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/restoreJobs" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/createServerlessBackupRestoreJob + /api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/restoreJobs/{restoreJobId}: + get: + description: |- + Returns one restore job for one serverless instance from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + This API can also be used on Flex clusters that were created with the [createServerlessInstance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance) endpoint or Flex clusters that were migrated from Serverless instances. This endpoint will be sunset in January 2026. Please use the getFlexBackupRestoreJob endpoint instead. + externalDocs: + description: getFlexBackupRestoreJob + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Restore-Jobs/operation/getFlexBackupRestoreJob + operationId: getServerlessBackupRestoreJob + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the restore job to return. + in: path + name: restoreJobId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessBackupRestoreJob" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Restore Job for One Serverless Instance + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getServerlessBackupRestoreJob --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetServerlessBackupRestoreJobApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + GetServerlessBackupRestoreJobWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/restoreJobs/{restoreJobId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/restoreJobs/{restoreJobId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/getServerlessBackupRestoreJob + /api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/snapshots: + get: + description: |- + Returns all snapshots of one serverless instance from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This API can also be used on Flex clusters that were created with the [createServerlessInstance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance) endpoint or Flex clusters that were migrated from Serverless instances. This endpoint will be sunset in January 2026. Please use the listFlexBackups endpoint instead. + externalDocs: + description: listFlexBackups + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Snapshots/operation/listFlexBackups + operationId: listServerlessBackups + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the serverless instance. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiAtlasServerlessBackupSnapshot" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Snapshots of One Serverless Instance + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listServerlessBackups --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListServerlessBackupsApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + ListServerlessBackupsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/snapshots?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/snapshots?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/listServerlessBackups + /api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/snapshots/{snapshotId}: + get: + description: |- + Returns one snapshot of one serverless instance from the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This endpoint can also be used on Flex clusters that were created with the [createServerlessInstance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance) API or Flex clusters that were migrated from Serverless instances. This endpoint will be sunset in January 2026. Please use the getFlexBackup endpoint instead. + externalDocs: + description: getFlexBackup + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Snapshots/operation/getFlexBackup + operationId: getServerlessBackup + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the desired snapshot. + in: path + name: snapshotId + required: true + schema: + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessBackupSnapshot" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Snapshot of One Serverless Instance + tags: + - Cloud Backups + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getServerlessBackup --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetServerlessBackupApiParams{} + sdkResp, httpResp, err := client.CloudBackupsApi. + GetServerlessBackupWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/snapshots/{snapshotId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/snapshots/{snapshotId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Backups/operation/getServerlessBackup + /api/atlas/v2/groups/{groupId}/serverless/{clusterName}/performanceAdvisor/autoIndexing: + get: + description: Get whether the Serverless Auto Indexing feature is enabled. This endpoint returns a value for Flex clusters that were created with the createServerlessInstance endpoint or Flex clusters that were migrated from Serverless instances. However, the value returned is not indicative of the Auto Indexing state as Auto Indexing is unavailable for Flex clusters. This endpoint will be sunset in January 2026. + externalDocs: + description: createServerlessInstance + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance + operationId: getServerlessAutoIndexing + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + type: boolean + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Serverless Auto-Indexing Status + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getServerlessAutoIndexing --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetServerlessAutoIndexingApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + GetServerlessAutoIndexingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/performanceAdvisor/autoIndexing?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/performanceAdvisor/autoIndexing?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/getServerlessAutoIndexing + post: + description: Set whether the Serverless Auto Indexing feature is enabled. This endpoint sets a value for Flex clusters that were created with the createServerlessInstance endpoint or Flex clusters that were migrated from Serverless instances. However, the value returned is not indicative of the Auto Indexing state as Auto Indexing is unavailable for Flex clusters. This endpoint will be sunset in January 2026. + externalDocs: + description: createServerlessInstance + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance + operationId: setServerlessAutoIndexing + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the cluster. + in: path + name: clusterName + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + - description: Value that we want to set for the Serverless Auto Indexing toggle. + in: query + name: enable + required: true + schema: + type: boolean + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Set Serverless Auto-Indexing Status + tags: + - Performance Advisor + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api setServerlessAutoIndexing --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.SetServerlessAutoIndexingApiParams{} + sdkResp, httpResp, err := client.PerformanceAdvisorApi. + SetServerlessAutoIndexingWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/performanceAdvisor/autoIndexing" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/performanceAdvisor/autoIndexing" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Performance-Advisor/operation/setServerlessAutoIndexing + /api/atlas/v2/groups/{groupId}/serverless/{name}: + delete: + description: |- + Removes one serverless instance from the specified project. The serverless instance must have termination protection disabled in order to be deleted. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + This API can also be used on Flex clusters that were created with the [createServerlessInstance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance) endpoint or Flex clusters that were migrated from Serverless instances. This endpoint will be sunset in January 2026. Please use the deleteFlexCluster endpoint instead. + externalDocs: + description: deleteFlexCluster + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/deleteFlexCluster + operationId: deleteServerlessInstance + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/RequestAccepted" + x-xgen-version: 2023-01-01 + description: Accepted + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Serverless Instance from One Project + tags: + - Serverless Instances + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteServerlessInstance --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteServerlessInstanceApiParams{} + httpResp, err := client.ServerlessInstancesApi. + DeleteServerlessInstanceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{name}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{name}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/deleteServerlessInstance + get: + description: |- + Returns details for one serverless instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + This API can also be used on Flex clusters that were created with the [createServerlessInstance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance) endpoint or Flex clusters that were migrated from Serverless instances. Continuous backups are not supported and serverlessContinuousBackupEnabled will not take effect on these clusters. This endpoint will be sunset in January 2026. Please use the getFlexCluster endpoint instead. + externalDocs: + description: getFlexCluster + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/getFlexCluster + operationId: getServerlessInstance + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessInstanceDescription" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Serverless Instance from One Project + tags: + - Serverless Instances + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getServerlessInstance --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetServerlessInstanceApiParams{} + sdkResp, httpResp, err := client.ServerlessInstancesApi. + GetServerlessInstanceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{name}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{name}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/getServerlessInstance + patch: + description: |- + Updates one serverless instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + This API can also be used on Flex clusters that were created with the [createServerlessInstance](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/createServerlessInstance) endpoint or Flex clusters that were migrated from Serverless instances. This endpoint will be sunset in January 2026. Continuous backups are not supported and serverlessContinuousBackupEnabled will not take effect on these clusters. Please use the updateFlexCluster endpoint instead. + externalDocs: + description: updateFlexCluster + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Flex-Clusters/operation/updateFlexCluster + operationId: updateServerlessInstance + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the serverless instance. + in: path + name: name + required: true + schema: + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessInstanceDescriptionUpdate" + description: Update One Serverless Instance in One Project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ServerlessInstanceDescription" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + summary: Update One Serverless Instance in One Project + tags: + - Serverless Instances + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateServerlessInstance --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateServerlessInstanceApiParams{} + sdkResp, httpResp, err := client.ServerlessInstancesApi. + UpdateServerlessInstanceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{name}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serverless/{name}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Serverless-Instances/operation/updateServerlessInstance + /api/atlas/v2/groups/{groupId}/serviceAccounts: + get: + description: Returns all Service Accounts for the specified Project. + operationId: listProjectServiceAccounts + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedGroupServiceAccounts" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Project Service Accounts + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjectServiceAccounts --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectServiceAccountsApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + ListProjectServiceAccountsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/listProjectServiceAccounts + post: + description: Creates one Service Account for the specified Project. The Service Account will automatically be added as an Organization Member to the Organization that the specified Project is a part of. + operationId: createProjectServiceAccount + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccountRequest" + x-xgen-version: 2024-08-05 + description: Details of the new Service Account. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Project Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createProjectServiceAccount --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateProjectServiceAccountApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + CreateProjectServiceAccountWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createProjectServiceAccount + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}: + delete: + description: Removes the specified Service Account from the specified project. The Service Account will still be a part of the Organization it was created in, and the credentials will remain active until expired or manually revoked. + operationId: deleteProjectServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + x-xgen-version: 2024-08-05 + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Project Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteProjectServiceAccount --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteProjectServiceAccountApiParams{} + httpResp, err := client.ServiceAccountsApi. + DeleteProjectServiceAccountWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteProjectServiceAccount + get: + description: Returns one Service Account in the specified Project. + operationId: getProjectServiceAccount + parameters: + - $ref: "#/components/parameters/groupId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Project Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectServiceAccount --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectServiceAccountApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + GetProjectServiceAccountWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/getProjectServiceAccount + patch: + description: Updates one Service Account in the specified Project. + operationId: updateProjectServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccountUpdateRequest" + description: The new details for the Service Account. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Project Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateProjectServiceAccount --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateProjectServiceAccountApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + UpdateProjectServiceAccountWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/updateProjectServiceAccount + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList: + get: + description: Returns all access list entries that you configured for the specified Service Account for the project. + operationId: listProjectServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pageNum" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntry" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Access List Entries for One Project Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjectServiceAccountAccessList --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectServiceAccountAccessListApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + ListProjectServiceAccountAccessListWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/listProjectServiceAccountAccessList + post: + description: Add Access List Entries for the specified Service Account for the project. Resources require all API requests to originate from IP addresses on the API access list. + operationId: createProjectServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/pageNum" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + items: + $ref: "#/components/schemas/ServiceAccountIPAccessListEntry" + maxItems: 200 + type: array + x-xgen-version: 2024-08-05 + description: A list of access list entries to add to the access list of the specified Service Account for the project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntry" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add Access List Entries for One Project Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createProjectServiceAccountAccessList --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateProjectServiceAccountAccessListApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + CreateProjectServiceAccountAccessListWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createProjectServiceAccountAccessList + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress}: + delete: + description: Removes the specified access list entry from the specified Service Account for the project. You can't remove the requesting IP address from the access list. + operationId: deleteProjectServiceAccountAccessListEntry + parameters: + - $ref: "#/components/parameters/groupId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - description: One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + in: path + name: ipAddress + required: true + schema: + example: 192.0.2.0%2F24 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$ + type: string + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Access List Entry from One Project Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteProjectServiceAccountAccessListEntry --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteProjectServiceAccountAccessListEntryApiParams{} + httpResp, err := client.ServiceAccountsApi. + DeleteProjectServiceAccountAccessListEntryWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/accessList/{ipAddress}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteProjectServiceAccountAccessListEntry + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets: + post: + description: Create a secret for the specified Service Account in the specified Project. + operationId: createProjectServiceAccountSecret + parameters: + - $ref: "#/components/parameters/groupId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecretRequest" + description: Details for the new secret. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecret" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Project Service Account Secret + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createProjectServiceAccountSecret --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateProjectServiceAccountSecretApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + CreateProjectServiceAccountSecretWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createProjectServiceAccountSecret + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId}: + delete: + description: Deletes the specified Service Account secret. + operationId: deleteProjectServiceAccountSecret + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the secret. + in: path + name: secretId + required: true + schema: + type: string + - $ref: "#/components/parameters/groupId" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Project Service Account Secret + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteProjectServiceAccountSecret --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteProjectServiceAccountSecretApiParams{} + httpResp, err := client.ServiceAccountsApi. + DeleteProjectServiceAccountSecretWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}/secrets/{secretId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteProjectServiceAccountSecret + /api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite: + post: + description: Assigns the specified Service Account to the specified Project. + operationId: addProjectServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccountRoleAssignment" + x-xgen-version: 2024-08-05 + description: The Project permissions for the Service Account in the specified Project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/GroupServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Assign One Service Account to One Project + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api addProjectServiceAccount --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AddProjectServiceAccountApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + AddProjectServiceAccountWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/serviceAccounts/{clientId}:invite" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/addProjectServiceAccount + /api/atlas/v2/groups/{groupId}/settings: + get: + description: Returns details about the specified project's settings. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getProjectSettings + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupSettings" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Project Settings + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectSettings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectSettingsApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + GetProjectSettingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/settings?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/settings?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/getProjectSettings + patch: + description: Updates the settings of the specified project. You can update any of the options available. MongoDB cloud only updates the options provided in the request. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: updateProjectSettings + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupSettings" + description: Settings to update. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/GroupSettings" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Project Settings + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateProjectSettings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateProjectSettingsApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + UpdateProjectSettingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/settings" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/settings" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/updateProjectSettings + /api/atlas/v2/groups/{groupId}/streams: + get: + description: Returns all stream instances for the specified project. + operationId: listStreamInstances + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiStreamsTenant" + x-xgen-version: 2023-02-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Stream Instances in One Project + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listStreamInstances --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListStreamInstancesApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + ListStreamInstancesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams?pretty=true" + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/listStreamInstances + post: + description: Creates one stream instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role, Project Owner role or Project Stream Processing Owner role. + operationId: createStreamInstance + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsTenant" + description: Details to create one streams instance in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsTenant" + x-xgen-version: 2023-02-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Stream Instance + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createStreamInstance --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateStreamInstanceApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + CreateStreamInstanceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams" \ + -d '{ }' + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createStreamInstance + /api/atlas/v2/groups/{groupId}/streams/{tenantName}: + delete: + description: Delete one stream instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role, Project Owner role or Project Stream Processing Owner role. + operationId: deleteStreamInstance + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance to delete. + in: path + name: tenantName + required: true + schema: + type: string + responses: + "202": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Stream Instance + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteStreamInstance --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteStreamInstanceApiParams{} + httpResp, err := client.StreamsApi. + DeleteStreamInstanceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}" + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/deleteStreamInstance + get: + description: Returns the details of one stream instance within the specified project. To use this resource, the requesting Service Account or API Key must have the Project Data Access roles, Project Owner role or Project Stream Processing Owner role. + operationId: getStreamInstance + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance to return. + in: path + name: tenantName + required: true + schema: + type: string + - description: Flag to indicate whether connections information should be included in the stream instance. + in: query + name: includeConnections + schema: + type: boolean + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsTenant" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-02-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Stream Instance + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getStreamInstance --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetStreamInstanceApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + GetStreamInstanceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}?pretty=true" + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getStreamInstance + patch: + description: Update one stream instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role, Project Owner role or Project Stream Processing Owner role. + operationId: updateStreamInstance + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance to update. + in: path + name: tenantName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsDataProcessRegion" + description: Details of the new data process region to update in the streams instance. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsTenant" + x-xgen-version: 2023-02-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Stream Instance + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateStreamInstance --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateStreamInstanceApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + UpdateStreamInstanceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}" \ + -d '{ }' + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/updateStreamInstance + /api/atlas/v2/groups/{groupId}/streams/{tenantName}/auditLogs: + get: + description: 'Downloads the audit logs for the specified Atlas Streams Processing instance. By default, logs cover periods of 30 days. To use this resource, the requesting Service Account or API Key must have the Project Data Access roles, Project Owner role or Project Stream Processing Owner role. The API does not support direct calls with the json response schema. You must request a gzip response schema using an accept header of the format: "Accept: application/vnd.atlas.YYYY-MM-DD+gzip".' + operationId: downloadStreamTenantAuditLogs + parameters: + - $ref: "#/components/parameters/groupId" + - description: Timestamp that specifies the end point for the range of log messages to download. MongoDB Cloud expresses this timestamp in the number of seconds that have elapsed since the UNIX epoch. + in: query + name: endDate + schema: + example: 1636481348 + format: int64 + pattern: "1199145600" + type: integer + - description: Timestamp that specifies the starting point for the range of log messages to download. MongoDB Cloud expresses this timestamp in the number of seconds that have elapsed since the UNIX epoch. + in: query + name: startDate + schema: + example: 1636466948 + format: int64 + pattern: "1199145600" + type: integer + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-02-01+gzip: + schema: + description: Compressed archive labeled `auditLogs.gz` downloads + format: binary + type: string + x-xgen-version: 2023-02-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Download Audit Logs for One Atlas Stream Processing Instance + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api downloadStreamTenantAuditLogs --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DownloadStreamTenantAuditLogsApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + DownloadStreamTenantAuditLogsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/auditLogs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/auditLogs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/downloadStreamTenantAuditLogs + /api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections: + get: + description: Returns all connections of the stream instance for the specified project.To use this resource, the requesting Service Account or API Key must have the Project Data Access roles, Project Owner role or Project Stream Processing Owner role. + operationId: listStreamConnections + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiStreamsConnection" + x-xgen-version: 2023-02-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Connections of the Stream Instances + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listStreamConnections --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListStreamConnectionsApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + ListStreamConnectionsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections?pretty=true" + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/listStreamConnections + post: + description: Creates one connection for a stream instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Stream Processing Owner role. + operationId: createStreamConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsConnection" + description: Details to create one connection for a streams instance in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsConnection" + x-xgen-version: 2023-02-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Stream Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createStreamConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateStreamConnectionApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + CreateStreamConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections" \ + -d '{ }' + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createStreamConnection + /api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName}: + delete: + description: Delete one connection of the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: deleteStreamConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream connection. + in: path + name: connectionName + required: true + schema: + type: string + responses: + "202": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Stream Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteStreamConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteStreamConnectionApiParams{} + httpResp, err := client.StreamsApi. + DeleteStreamConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName}" + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/deleteStreamConnection + get: + description: Returns the details of one stream connection within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getStreamConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance to return. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream connection to return. + in: path + name: connectionName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsConnection" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-02-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Stream Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getStreamConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetStreamConnectionApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + GetStreamConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName}?pretty=true" + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getStreamConnection + patch: + description: Update one connection for the specified stream instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: updateStreamConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream connection. + in: path + name: connectionName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsConnection" + description: Details to update one connection for a streams instance in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsConnection" + x-xgen-version: 2023-02-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Stream Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateStreamConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateStreamConnectionApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + UpdateStreamConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName}" \ + -d '{ }' + x-xgen-changelog: + 2023-09-11: The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/updateStreamConnection + /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor: + post: + description: Create one Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: createStreamProcessor + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsProcessor" + description: Details to create an Atlas Streams Processor. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsProcessor" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Stream Processor + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createStreamProcessor --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateStreamProcessorApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + CreateStreamProcessorWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createStreamProcessor + /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}: + delete: + description: Delete a Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: deleteStreamProcessor + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream processor. + in: path + name: processorName + required: true + schema: + type: string + responses: + "204": + content: + application/vnd.atlas.2024-05-30+json: + x-xgen-version: 2024-05-30 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Stream Processor + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteStreamProcessor --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteStreamProcessorApiParams{} + httpResp, err := client.StreamsApi. + DeleteStreamProcessorWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/deleteStreamProcessor + get: + description: Get one Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: getStreamProcessor + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream processor. + in: path + name: processorName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsProcessorWithStats" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Stream Processor + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getStreamProcessor --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetStreamProcessorApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + GetStreamProcessorWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getStreamProcessor + patch: + description: Modify one existing Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: modifyStreamProcessor + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream processor. + in: path + name: processorName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsModifyStreamProcessor" + description: Modifications to apply to the stream processor. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/StreamsProcessorWithStats" + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Stream Processor + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api modifyStreamProcessor --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ModifyStreamProcessorApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + ModifyStreamProcessorWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/modifyStreamProcessor + /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:start: + post: + description: Start a Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: startStreamProcessor + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream processor. + in: path + name: processorName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + x-xgen-version: 2024-05-30 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Start One Stream Processor + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api startStreamProcessor --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.StartStreamProcessorApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + StartStreamProcessorWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:start" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:start" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/startStreamProcessor + /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:startWith: + post: + description: Start a Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: startStreamProcessorWith + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream processor. + in: path + name: processorName + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2025-03-12+json: + schema: + $ref: "#/components/schemas/StreamsStartStreamProcessorWith" + x-xgen-version: 2025-03-12 + description: Options for starting a stream processor. + responses: + "200": + content: + application/vnd.atlas.2025-03-12+json: + x-xgen-version: 2025-03-12 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Start One Stream Processor With Options + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api startStreamProcessorWith --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.StartStreamProcessorWithApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + StartStreamProcessorWithWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:startWith" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:startWith" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/startStreamProcessorWith + /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:stop: + post: + description: Stop a Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: stopStreamProcessor + parameters: + - $ref: "#/components/parameters/groupId" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + - description: Human-readable label that identifies the stream processor. + in: path + name: processorName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + x-xgen-version: 2024-05-30 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Stop One Stream Processor + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api stopStreamProcessor --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.StopStreamProcessorApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + StopStreamProcessorWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:stop" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{processorName}:stop" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/stopStreamProcessor + /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processors: + get: + description: Returns all Stream Processors within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + operationId: listStreamProcessors + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/includeCount" + - description: Human-readable label that identifies the stream instance. + in: path + name: tenantName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/PaginatedApiStreamsStreamProcessorWithStats" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + xgen-IPA-104-get-method-returns-single-resource: API predates IPA validation + x-xgen-version: 2024-05-30 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Stream Processors in One Stream Instance + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listStreamProcessors --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListStreamProcessorsApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + ListStreamProcessorsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processors?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processors?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/listStreamProcessors + /api/atlas/v2/groups/{groupId}/streams/accountDetails: + get: + description: Returns the Account ID, and the VPC ID for the group and region specified. + operationId: getAccountDetails + parameters: + - $ref: "#/components/parameters/groupId" + - description: One of "aws", "azure" or "gcp". + in: query + name: cloudProvider + required: true + schema: + type: string + - description: The cloud provider specific region name, i.e. "US_EAST_1" for cloud provider "aws". + in: query + name: regionName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + schema: + $ref: "#/components/schemas/AccountDetails" + x-xgen-version: 2024-11-13 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Account ID and VPC ID for One Project and Region + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getAccountDetails --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetAccountDetailsApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + GetAccountDetailsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/accountDetails?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/accountDetails?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getAccountDetails + /api/atlas/v2/groups/{groupId}/streams/activeVpcPeeringConnections: + get: + description: Returns a list of active incoming VPC Peering Connections. + operationId: getActiveVpcPeeringConnections + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2024-11-13+json: + x-xgen-version: 2024-11-13 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Active Incoming VPC Peering Connections + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getActiveVpcPeeringConnections --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetActiveVpcPeeringConnectionsApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + GetActiveVpcPeeringConnectionsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/activeVpcPeeringConnections?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/activeVpcPeeringConnections?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getActiveVpcPeeringConnections + /api/atlas/v2/groups/{groupId}/streams/privateLinkConnections: + get: + description: Returns all Private Link connections for the specified project.To use this resource, the requesting Service Account or API Key must have the Project Data Access roles, Project Owner role or Project Stream Processing Owner role. + operationId: listPrivateLinkConnections + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiStreamsPrivateLink" + x-xgen-version: 2023-02-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Private Link Connections + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPrivateLinkConnections --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPrivateLinkConnectionsApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + ListPrivateLinkConnectionsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/privateLinkConnections?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/privateLinkConnections?pretty=true" + x-xgen-changelog: + 2024-10-02: The MongoDB Atlas Streams Processing Private Link API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/listPrivateLinkConnections + post: + description: Creates one Private Link in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Stream Processing Owner role. + operationId: createPrivateLinkConnection + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsPrivateLinkConnection" + description: Details to create one Private Link connection for a project. project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsPrivateLinkConnection" + x-xgen-version: 2023-02-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/unauthorized" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Private Link Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createPrivateLinkConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreatePrivateLinkConnectionApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + CreatePrivateLinkConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/privateLinkConnections" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/privateLinkConnections" \ + -d '{ }' + x-xgen-changelog: + 2024-10-02: The MongoDB Atlas Streams Processing Private Link API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createPrivateLinkConnection + /api/atlas/v2/groups/{groupId}/streams/privateLinkConnections/{connectionId}: + delete: + description: Deletes one Private Link in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Stream Processing Owner role. + operationId: deletePrivateLinkConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique ID that identifies the Private Link connection. + in: path + name: connectionId + required: true + schema: + type: string + responses: + "202": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Private Link Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deletePrivateLinkConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeletePrivateLinkConnectionApiParams{} + httpResp, err := client.StreamsApi. + DeletePrivateLinkConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/privateLinkConnections/{connectionId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/privateLinkConnections/{connectionId}" + x-xgen-changelog: + 2024-10-02: The MongoDB Atlas Streams Processing Private Link API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/deletePrivateLinkConnection + get: + description: Returns the details of one Private Link connection within the project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getPrivateLinkConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique ID that identifies the Private Link connection. + in: path + name: connectionId + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/StreamsPrivateLinkConnection" + x-xgen-version: 2023-02-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Private Link Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getPrivateLinkConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetPrivateLinkConnectionApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + GetPrivateLinkConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/privateLinkConnections/{connectionId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/privateLinkConnections/{connectionId}?pretty=true" + x-xgen-changelog: + 2024-10-02: The MongoDB Atlas Streams Processing Private Link API is now exposed as part of private preview, but is subject to change until GA. + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getPrivateLinkConnection + /api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections: + get: + description: Returns a list of incoming VPC Peering Connections. + operationId: getVpcPeeringConnections + parameters: + - description: The Account ID of the VPC Peering connection/s. + in: query + name: requesterAccountId + required: true + schema: + type: string + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All VPC Peering Connections + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getVpcPeeringConnections --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetVpcPeeringConnectionsApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + GetVpcPeeringConnectionsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/getVpcPeeringConnections + /api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}: + delete: + description: Deletes an incoming VPC Peering connection. + operationId: deleteVpcPeeringConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: The VPC Peering Connection id. + in: path + name: id + required: true + schema: + type: string + responses: + "202": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One VPC Peering Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteVpcPeeringConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteVpcPeeringConnectionApiParams{} + httpResp, err := client.StreamsApi. + DeleteVpcPeeringConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/deleteVpcPeeringConnection + /api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}:accept: + post: + description: Requests the acceptance of an incoming VPC Peering connection. + operationId: acceptVpcPeeringConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: The VPC Peering Connection id. + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/vnd.atlas.2023-02-01+json: + schema: + $ref: "#/components/schemas/VPCPeeringActionChallenge" + description: Challenge values for VPC Peering requester account ID, and requester VPC ID. + required: true + responses: + "202": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Accept One Incoming VPC Peering Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api acceptVpcPeeringConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AcceptVpcPeeringConnectionApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + AcceptVpcPeeringConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}:accept" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}:accept" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/acceptVpcPeeringConnection + /api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}:reject: + post: + description: Requests the rejection of an incoming VPC Peering connection. + operationId: rejectVpcPeeringConnection + parameters: + - $ref: "#/components/parameters/groupId" + - description: The VPC Peering Connection id. + in: path + name: id + required: true + schema: + type: string + responses: + "202": + content: + application/vnd.atlas.2023-02-01+json: + x-xgen-version: 2023-02-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Reject One Incoming VPC Peering Connection + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api rejectVpcPeeringConnection --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RejectVpcPeeringConnectionApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + RejectVpcPeeringConnectionWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}:reject" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams/vpcPeeringConnections/{id}:reject" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/rejectVpcPeeringConnection + /api/atlas/v2/groups/{groupId}/streams:withSampleConnections: + post: + description: Creates one stream instance in the specified project with sample connections. To use this resource the requesting Service Account or API Key must have the Project Data Access Admin role, Project Owner role or Project Stream Processing Owner role. + operationId: createStreamInstanceWithSampleConnections + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/TenantWithSampleConnections" + description: Details to create one streams instance in the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/StreamsTenant" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Stream Instance with Sample Connections + tags: + - Streams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createStreamInstanceWithSampleConnections --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateStreamInstanceWithSampleConnectionsApiParams{} + sdkResp, httpResp, err := client.StreamsApi. + CreateStreamInstanceWithSampleConnectionsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams:withSampleConnections" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/streams:withSampleConnections" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Streams/operation/createStreamInstanceWithSampleConnections + /api/atlas/v2/groups/{groupId}/teams: + get: + description: Returns all teams to which the authenticated user has access in the project specified using its unique 24-hexadecimal digit identifier. All members of the team share the same project access. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: listProjectTeams + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedTeamRole" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Teams in One Project + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjectTeams --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectTeamsApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + ListProjectTeamsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/listProjectTeams + post: + description: Adds one team to the specified project. All members of the team share the same project access. MongoDB Cloud limits the number of users to a maximum of 100 teams per project and a maximum of 250 teams per organization. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: addAllTeamsToProject + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/TeamRole" + type: array + description: Team to add to the specified project. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedTeamRole" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One Team to One Project + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api addAllTeamsToProject --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AddAllTeamsToProjectApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + AddAllTeamsToProjectWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/addAllTeamsToProject + /api/atlas/v2/groups/{groupId}/teams/{teamId}: + delete: + description: Removes one team specified using its unique 24-hexadecimal digit identifier from the project specified using its unique 24-hexadecimal digit identifier. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: removeProjectTeam + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the team that you want to remove from the specified project. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Team from One Project + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api removeProjectTeam --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RemoveProjectTeamApiParams{} + httpResp, err := client.TeamsApi. + RemoveProjectTeamWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams/{teamId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams/{teamId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/removeProjectTeam + get: + description: Returns one team to which the authenticated user has access in the project specified using its unique 24-hexadecimal digit identifier. All members of the team share the same project access. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getProjectTeam + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the team for which you want to get. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TeamRole" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Team in One Project + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectTeam --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectTeamApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + GetProjectTeamWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams/{teamId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams/{teamId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/getProjectTeam + patch: + description: Updates the project roles assigned to the specified team. You can grant team roles for specific projects and grant project access roles to users in the team. All members of the team share the same project access. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: updateTeamRoles + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the team for which you want to update roles. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TeamRole" + description: The project roles assigned to the specified team. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedTeamRole" + x-xgen-IPA-exception: + xgen-IPA-107-update-method-response-is-get-method-response: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Team Roles in One Project + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateTeamRoles --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateTeamRolesApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + UpdateTeamRolesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams/{teamId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/teams/{teamId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/updateTeamRoles + /api/atlas/v2/groups/{groupId}/userSecurity: + get: + description: Returns the current LDAP configuration for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: getLdapConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserSecurity" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-response-has-no-input-fields: Content predates IPA validation + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return LDAP or X.509 Configuration + tags: + - LDAP Configuration + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getLdapConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetLdapConfigurationApiParams{} + sdkResp, httpResp, err := client.LDAPConfigurationApi. + GetLdapConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/LDAP-Configuration/operation/getLdapConfiguration + patch: + description: |- + Edits the LDAP configuration for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + Updating this configuration triggers a rolling restart of the database. + operationId: saveLdapConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserSecurity" + description: Updates the LDAP configuration for the specified project. + required: true + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserSecurity" + x-xgen-version: 2023-01-01 + description: Accepted + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update LDAP or X.509 Configuration + tags: + - LDAP Configuration + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api saveLdapConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.SaveLdapConfigurationApiParams{} + sdkResp, httpResp, err := client.LDAPConfigurationApi. + SaveLdapConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/LDAP-Configuration/operation/saveLdapConfiguration + /api/atlas/v2/groups/{groupId}/userSecurity/customerX509: + delete: + description: |- + Clears the customer-managed X.509 settings on a project, including the uploaded Certificate Authority, which disables self-managed X.509. + + Updating this configuration triggers a rolling restart of the database. You must have the Project Owner role to use this endpoint. + operationId: disableCustomerManagedX509 + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserSecurity" + x-xgen-version: 2023-01-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Disable Customer-Managed X.509 + tags: + - X.509 Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api disableCustomerManagedX509 --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DisableCustomerManagedX509ApiParams{} + httpResp, err := client.X509AuthenticationApi. + DisableCustomerManagedX509WithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/customerX509" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/customerX509" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/X.509-Authentication/operation/disableCustomerManagedX509 + /api/atlas/v2/groups/{groupId}/userSecurity/ldap/userToDNMapping: + delete: + description: Removes the current LDAP Distinguished Name mapping captured in the ``userToDNMapping`` document from the LDAP configuration for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: deleteLdapConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserSecurity" + x-xgen-version: 2023-01-01 + description: Accepted + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove LDAP User to DN Mapping + tags: + - LDAP Configuration + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteLdapConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteLdapConfigurationApiParams{} + httpResp, err := client.LDAPConfigurationApi. + DeleteLdapConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/ldap/userToDNMapping" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/ldap/userToDNMapping" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/LDAP-Configuration/operation/deleteLdapConfiguration + /api/atlas/v2/groups/{groupId}/userSecurity/ldap/verify: + post: + description: Verifies the LDAP configuration for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: verifyLdapConfiguration + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/LDAPVerifyConnectivityJobRequestParams" + description: The LDAP configuration for the specified project that you want to verify. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/LDAPVerifyConnectivityJobRequest" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Verify LDAP Configuration in One Project + tags: + - LDAP Configuration + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api verifyLdapConfiguration --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.VerifyLdapConfigurationApiParams{} + sdkResp, httpResp, err := client.LDAPConfigurationApi. + VerifyLdapConfigurationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/ldap/verify" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/ldap/verify" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/LDAP-Configuration/operation/verifyLdapConfiguration + /api/atlas/v2/groups/{groupId}/userSecurity/ldap/verify/{requestId}: + get: + description: Returns the status of one request to verify one LDAP configuration for the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + operationId: getLdapConfigurationStatus + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique string that identifies the request to verify an Lightweight Directory Access Protocol (LDAP) configuration. + in: path + name: requestId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/LDAPVerifyConnectivityJobRequest" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Status of LDAP Configuration Verification in One Project + tags: + - LDAP Configuration + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getLdapConfigurationStatus --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetLdapConfigurationStatusApiParams{} + sdkResp, httpResp, err := client.LDAPConfigurationApi. + GetLdapConfigurationStatusWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/ldap/verify/{requestId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/userSecurity/ldap/verify/{requestId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/LDAP-Configuration/operation/getLdapConfigurationStatus + /api/atlas/v2/groups/{groupId}/users: + get: + description: |- + Returns details about the pending and active MongoDB Cloud users associated with the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + **Note**: This resource cannot be used to view details about users invited via the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + + **Note**: To return both pending and active users, use v2-{2025-02-19} or later. If using a deprecated version, only active users will be returned. Deprecated versions: v2-{2023-01-01} + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: listProjectUsers + parameters: + - $ref: "#/components/parameters/groupId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: 'Flag that indicates whether the returned list should include users who belong to a team with a role in this project. You might not have assigned the individual users a role in this project. If `"flattenTeams" : false`, this resource returns only users with a role in the project. If `"flattenTeams" : true`, this resource returns both users with roles in the project and users who belong to teams with roles in the project.' + in: query + name: flattenTeams + schema: + default: false + type: boolean + - description: 'Flag that indicates whether the returned list should include users with implicit access to the project, the Organization Owner or Organization Read Only role. You might not have assigned the individual users a role in this project. If `"includeOrgUsers": false`, this resource returns only users with a role in the project. If `"includeOrgUsers": true`, this resource returns both users with roles in the project and users who have implicit access to the project through their organization role.' + in: query + name: includeOrgUsers + schema: + default: false + type: boolean + - description: Flag that indicates whether to filter the returned list by users organization membership status. If you exclude this parameter, this resource returns both pending and active users. Not supported in deprecated versions. + in: query + name: orgMembershipStatus + schema: + example: ACTIVE + type: string + - description: Email address to filter users by. Not supported in deprecated versions. + in: query + name: username + schema: + format: email + type: string + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/PaginatedGroupUser" + x-xgen-version: 2025-02-19 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All MongoDB Cloud Users in One Project + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listProjectUsers --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListProjectUsersApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + ListProjectUsersWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/listProjectUsers + post: + description: | + Adds one MongoDB Cloud user to one project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + - If the user has a pending invitation to join the project's organization, MongoDB Cloud modifies it and grants project access. + - If the user doesn't have an invitation to join the organization, MongoDB Cloud sends a new invitation that grants the user organization and project access. + - If the user is already active in the project's organization, MongoDB Cloud grants access to the project. + operationId: addProjectUser + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/GroupUserRequest" + description: The active or pending MongoDB Cloud user that you want to add to the specified project. + required: true + responses: + "201": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/GroupUserResponse" + x-xgen-version: 2025-02-19 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One MongoDB Cloud User to One Project + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api addProjectUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AddProjectUserApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + AddProjectUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/addProjectUser + /api/atlas/v2/groups/{groupId}/users/{userId}: + delete: + description: |- + Removes one MongoDB Cloud user from the specified project. You can remove an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + **Note**: This resource cannot be used to remove pending users invited via the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + + **Note**: To remove pending or active users, use v2-{2025-02-19} or later. If using a deprecated version, only active users can be removed. Deprecated versions: v2-{2023-01-01} + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: removeProjectUser + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the pending or active user in the project. If you need to lookup a user's userId or verify a user's status in the organization, use the [Return All MongoDB Cloud Users in One Project](#tag/MongoDB-Cloud-Users/operation/listProjectUsers) resource and filter by username. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + responses: + "204": + content: + application/vnd.atlas.2025-02-19+json: + x-xgen-version: 2025-02-19 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One MongoDB Cloud User from One Project + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api removeProjectUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RemoveProjectUserApiParams{} + httpResp, err := client.MongoDBCloudUsersApi. + RemoveProjectUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/removeProjectUser + get: + description: |- + Returns information about the specified MongoDB Cloud user within the context of the specified project. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + + **Note**: You can only use this resource to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + + **Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: getProjectUser + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the pending or active user in the project. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Project resource and filter by username. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/GroupUserResponse" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One MongoDB Cloud User in One Project + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectUserApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + GetProjectUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/getProjectUser + /api/atlas/v2/groups/{groupId}/users/{userId}/roles: + put: + deprecated: true + description: Updates the roles of the specified user in the specified project. To specify the user to update, provide the unique 24-hexadecimal digit string that identifies the user in the specified project. To use this resource, the requesting Service Account or API Key must have the Group User Admin role. + operationId: updateProjectRoles + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the user to modify. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UpdateGroupRolesForUser" + description: Roles to update for the specified user. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UpdateGroupRolesForUser" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Project Roles for One MongoDB Cloud User + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateProjectRoles --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateProjectRolesApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + UpdateProjectRolesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}/roles" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}/roles" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/updateProjectRoles + /api/atlas/v2/groups/{groupId}/users/{userId}:addRole: + post: + description: |- + Adds one project-level role to the MongoDB Cloud user. You can add a role to an active user or a user that has been invited to join the project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + **Note**: This resource cannot be used to add a role to users invited using the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: addProjectRole + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the pending or active user in the project. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Project resource and filter by username. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/AddOrRemoveGroupRole" + description: Project-level role to assign to the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One Project Role to One MongoDB Cloud User + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api addProjectRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AddProjectRoleApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + AddProjectRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}:addRole" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}:addRole" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/addProjectRole + /api/atlas/v2/groups/{groupId}/users/{userId}:removeRole: + post: + description: |- + Removes one project-level role from the MongoDB Cloud user. You can remove a role from an active user or a user that has been invited to join the project. To replace a user's only role, add the new role before removing the old role. A user must have at least one role at all times. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + + **Note**: This resource cannot be used to remove a role from users invited using the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: removeProjectRole + parameters: + - $ref: "#/components/parameters/groupId" + - description: Unique 24-hexadecimal digit string that identifies the pending or active user in the project. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Project resource and filter by username. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/AddOrRemoveGroupRole" + description: Project-level role to remove from the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Project Role from One MongoDB Cloud User + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api removeProjectRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RemoveProjectRoleApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + RemoveProjectRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}:removeRole" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/users/{userId}:removeRole" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/removeProjectRole + /api/atlas/v2/groups/{groupId}:migrate: + post: + description: Migrates a project from its current organization to another organization. All project users and their roles will be copied to the same project in the destination organization. You must include an organization API key with the Organization Owner role for the destination organization to verify access to the destination organization when you authenticate with Programmatic API Keys. Otherwise, the requesting user must have the Organization Owner role in both organizations. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + operationId: migrateProjectToAnotherOrg + parameters: + - $ref: "#/components/parameters/groupId" + requestBody: + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/GroupMigrationRequest" + description: Migrates a project from its current organization to another organization. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-05-30+json: + schema: + $ref: "#/components/schemas/Group" + x-xgen-version: 2024-05-30 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Migrate One Project to Another Organization + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api migrateProjectToAnotherOrg --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.MigrateProjectToAnotherOrgApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + MigrateProjectToAnotherOrgWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}:migrate" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}:migrate" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/migrateProjectToAnotherOrg + /api/atlas/v2/groups/byName/{groupName}: + get: + description: Returns details about the specified project. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. To use this resource, the requesting Service Account or API Key must have the Project Read Only role. + operationId: getProjectByName + parameters: + - description: Human-readable label that identifies this project. + in: path + name: groupName + required: true + schema: + maxLength: 64 + minLength: 1 + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/Group" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Project by Name + tags: + - Projects + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getProjectByName --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetProjectByNameApiParams{} + sdkResp, httpResp, err := client.ProjectsApi. + GetProjectByNameWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/byName/{groupName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/groups/byName/{groupName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/getProjectByName + /api/atlas/v2/orgs: + get: + description: Returns all organizations to which the requesting Service Account or API Key has access. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + operationId: listOrganizations + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label of the organization to use to filter the returned list. Performs a case-insensitive search for an organization that starts with the specified name. + in: query + name: name + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedOrganization" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Organizations + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listOrganizations --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListOrganizationsApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + ListOrganizationsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/listOrganizations + post: + description: Creates one organization in MongoDB Cloud and links it to the requesting Service Account's or API Key's organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. The requesting Service Account's or API Key's organization must be a paying organization. To learn more, see Configure a Paying Organization in the MongoDB Atlas documentation. + externalDocs: + description: Configure a Paying Organization + url: https://www.mongodb.com/docs/atlas/billing/#configure-a-paying-organization + operationId: createOrganization + parameters: [] + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CreateOrganizationRequest" + description: Organization that you want to create. + required: true + responses: + "201": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CreateOrganizationResponse" + x-xgen-IPA-exception: + xgen-IPA-106-create-method-response-is-get-method-response: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Organization + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createOrganization --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateOrganizationApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + CreateOrganizationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/createOrganization + /api/atlas/v2/orgs/{orgId}: + delete: + description: |- + Removes one specified organization. MongoDB Cloud imposes the following limits on this resource: + + - Organizations with active projects cannot be removed. + - All projects in the organization must be removed before you can remove the organization. + To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + operationId: deleteOrganization + parameters: + - $ref: "#/components/parameters/orgId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "402": + $ref: "#/components/responses/paymentRequired" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Organization + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteOrganization --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteOrganizationApiParams{} + httpResp, err := client.OrganizationsApi. + DeleteOrganizationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/deleteOrganization + get: + description: Returns one organization to which the requesting Service Account or API Key has access. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + operationId: getOrganization + parameters: + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AtlasOrganization" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Organization + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getOrganization --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetOrganizationApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + GetOrganizationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/getOrganization + patch: + description: Updates one organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + operationId: updateOrganization + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AtlasOrganization" + description: Details to update on the specified organization. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/AtlasOrganization" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Organization + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateOrganization --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateOrganizationApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + UpdateOrganizationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/updateOrganization + /api/atlas/v2/orgs/{orgId}/apiKeys: + get: + description: Returns all organization API keys for the specified organization. The organization API keys grant programmatic access to an organization. You can't use the API key to log into MongoDB Cloud through the console. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + externalDocs: + description: Programmatic API Keys + url: https://docs.atlas.mongodb.com/configure-api-access/#std-label-atlas-prog-api-key + operationId: listApiKeys + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiApiUser" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Organization API Keys + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listApiKeys --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListApiKeysApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + ListApiKeysWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/listApiKeys + post: + description: Creates one API key for the specified organization. An organization API key grants programmatic access to an organization. You can't use the API key to log into the console. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + externalDocs: + description: Programmatic API Keys + url: https://docs.atlas.mongodb.com/configure-api-access/#std-label-atlas-prog-api-key + operationId: createApiKey + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CreateAtlasOrganizationApiKey" + description: Organization API Key to be created. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiKeyUserDetails" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Organization API Key + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createApiKey --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateApiKeyApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + CreateApiKeyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createApiKey + /api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}: + delete: + description: Removes one organization API key from the specified organization. When you remove an API key from an organization, MongoDB Cloud also removes that key from any projects that use that key. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + externalDocs: + description: Configure Atlas API Access + url: https://docs.atlas.mongodb.com/configure-api-access/#std-label-enable-api-access-list + operationId: deleteApiKey + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies this organization API key. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Organization API Key + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteApiKey --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteApiKeyApiParams{} + httpResp, err := client.ProgrammaticAPIKeysApi. + DeleteApiKeyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/deleteApiKey + get: + description: Returns one organization API key. The organization API keys grant programmatic access to an organization. You can't use the API key to log into MongoDB Cloud through the user interface. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + externalDocs: + description: Programmatic API Keys + url: https://docs.atlas.mongodb.com/configure-api-access/#std-label-atlas-prog-api-key + operationId: getApiKey + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies this organization API key that you want to update. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiKeyUserDetails" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Organization API Key + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getApiKey --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetApiKeyApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + GetApiKeyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/getApiKey + patch: + description: Updates one organization API key in the specified organization. The organization API keys grant programmatic access to an organization. To use this resource, the requesting API Key must have the Organization Owner role. + externalDocs: + description: Programmatic API Keys + url: https://docs.atlas.mongodb.com/configure-api-access/#std-label-atlas-prog-api-key + operationId: updateApiKey + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies this organization API key you want to update. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UpdateAtlasOrganizationApiKey" + description: Organization API key to be updated. This request requires a minimum of one of the two body parameters. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/ApiKeyUserDetails" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Organization API Key + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateApiKey --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateApiKeyApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + UpdateApiKeyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/updateApiKey + /api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList: + get: + description: Returns all access list entries that you configured for the specified organization API key. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + externalDocs: + description: Programmatic API Keys + url: https://docs.atlas.mongodb.com/configure-api-access/#view-the-details-of-one-api-key-in-one-organization + operationId: listApiKeyAccessListsEntries + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: Unique 24-hexadecimal digit string that identifies this organization API key for which you want to return access list entries. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiUserAccessListResponse" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Access List Entries for One Organization API Key + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listApiKeyAccessListsEntries --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListApiKeyAccessListsEntriesApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + ListApiKeyAccessListsEntriesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/listApiKeyAccessListsEntries + post: + description: Creates the access list entries for the specified organization API key. Resources require all API requests originate from IP addresses on the API access list. To use this resource, the requesting Service Account or API Key must have the Read Write role. + operationId: createApiKeyAccessList + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: Unique 24-hexadecimal digit string that identifies this organization API key for which you want to create a new access list entry. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/UserAccessListRequest" + type: array + description: Access list entries to be created for the specified organization API key. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiUserAccessListResponse" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Access List Entry for One Organization API Key + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createApiKeyAccessList --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateApiKeyAccessListApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + CreateApiKeyAccessListWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/createApiKeyAccessList + /api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList/{ipAddress}: + delete: + description: Removes the specified access list entry from the specified organization API key. Resources require all API requests originate from the IP addresses on the API access list. To use this resource, the requesting Service Account or API Key must have the Read Write role. In addition, you cannot remove the requesting IP address from the requesting organization API key. + externalDocs: + description: Configure Atlas API Access + url: https://docs.atlas.mongodb.com/configure-api-access/#std-label-enable-api-access-list + operationId: deleteApiKeyAccessListEntry + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies this organization API key for which you want to remove access list entries. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: One IP address or multiple IP addresses represented as one CIDR block to limit requests to API resources in the specified organization. When adding a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + in: path + name: ipAddress + required: true + schema: + example: 192.0.2.0%2F24 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Access List Entry for One Organization API Key + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteApiKeyAccessListEntry --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteApiKeyAccessListEntryApiParams{} + httpResp, err := client.ProgrammaticAPIKeysApi. + DeleteApiKeyAccessListEntryWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList/{ipAddress}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList/{ipAddress}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/deleteApiKeyAccessListEntry + get: + description: Returns one access list entry for the specified organization API key. Resources require all API requests originate from IP addresses on the API access list. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + externalDocs: + description: Configure Atlas API Access + url: https://docs.atlas.mongodb.com/configure-api-access/#std-label-enable-api-access-list + operationId: getApiKeyAccessList + parameters: + - $ref: "#/components/parameters/orgId" + - description: One IP address or multiple IP addresses represented as one CIDR block to limit requests to API resources in the specified organization. When adding a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + in: path + name: ipAddress + required: true + schema: + example: 192.0.2.0%2F24 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$ + type: string + - description: Unique 24-hexadecimal digit string that identifies this organization API key for which you want to return access list entries. + in: path + name: apiUserId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UserAccessListResponse" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Access List Entry for One Organization API Key + tags: + - Programmatic API Keys + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getApiKeyAccessList --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetApiKeyAccessListApiParams{} + sdkResp, httpResp, err := client.ProgrammaticAPIKeysApi. + GetApiKeyAccessListWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList/{ipAddress}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/apiKeys/{apiUserId}/accessList/{ipAddress}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/getApiKeyAccessList + /api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage: + post: + description: Creates a query process within the Cost Explorer for the given parameters. A token is returned that can be used to poll the status of the query and eventually retrieve the results. + operationId: createCostExplorerQueryProcess + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CostExplorerFilterRequestBody" + description: Filter parameters for the Cost Explorer query. + required: true + responses: + "202": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CostExplorerFilterResponse" + x-xgen-version: 2023-01-01 + description: Accepted + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Cost Explorer Query Process + tags: + - Invoices + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createCostExplorerQueryProcess --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateCostExplorerQueryProcessApiParams{} + sdkResp, httpResp, err := client.InvoicesApi. + CreateCostExplorerQueryProcessWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Invoices/operation/createCostExplorerQueryProcess + /api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage/{token}: + get: + description: Returns the usage details for a Cost Explorer query, if the query is finished and the data is ready to be viewed. If the data is not ready, a 'processing' response willindicate that another request should be sent later to view the data. + operationId: getCostExplorerQueryProcess + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 64 digit string that identifies the Cost Explorer query. + in: path + name: token + required: true + schema: + example: 4ABBE973862346D40F3AE859D4BE96E0F895764EB14EAB039E7B82F9D638C05C + maxLength: 64 + minLength: 64 + type: string + responses: + "102": + description: Processing + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CostExplorerQueryResult" + x-xgen-version: 2023-01-01 + application/vnd.atlas.2023-01-01+csv: + example: | + Billed Date,666acb8787ba90706905dcae, + Invoice Id,"June 1, 2024 - July 1, 2024", + Organization Name,Test 2, + Organization ID,666acb8787ba90706905dcae, + Project Name,666acb8787ba90706905dcae, + Project Id,666acb8787ba90706905dcae, + Cluster Name,TestCluster + Cluster Unique Id,666acb8787ba90706905dcae + Usage Amount, 1018.39 + schema: + type: string + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return results from a given Cost Explorer query, or notify that the results are not ready yet. + tags: + - Invoices + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getCostExplorerQueryProcess --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetCostExplorerQueryProcessApiParams{} + sdkResp, httpResp, err := client.InvoicesApi. + GetCostExplorerQueryProcessWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage/{token}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/billing/costExplorer/usage/{token}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Invoices/operation/getCostExplorerQueryProcess + /api/atlas/v2/orgs/{orgId}/events: + get: + description: |- + Returns events for the specified organization. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + + This resource remains under revision and may change. + operationId: listOrganizationEvents + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: |- + Category of incident recorded at this moment in time. + + **IMPORTANT**: The complete list of event type values changes frequently. + in: query + name: eventType + schema: + items: + $ref: "#/components/schemas/EventTypeForOrg" + type: array + - description: Flag that indicates whether to include the raw document in the output. The raw document contains additional meta information about the event. + in: query + name: includeRaw + schema: + default: false + type: boolean + - description: Date and time from when MongoDB Cloud stops returning events. This parameter uses the ISO 8601 timestamp format in UTC. + in: query + name: maxDate + schema: + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + type: string + - description: Date and time from when MongoDB Cloud starts returning events. This parameter uses the ISO 8601 timestamp format in UTC. + in: query + name: minDate + schema: + externalDocs: + description: ISO 8601 + url: https://en.wikipedia.org/wiki/ISO_8601 + format: date-time + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrgPaginatedEvent" + x-xgen-IPA-exception: + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Events from One Organization + tags: + - Events + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listOrganizationEvents --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListOrganizationEventsApiParams{} + sdkResp, httpResp, err := client.EventsApi. + ListOrganizationEventsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/events?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/events?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Events/operation/listOrganizationEvents + /api/atlas/v2/orgs/{orgId}/events/{eventId}: + get: + description: |- + Returns one event for the specified organization. Events identify significant database, billing, or security activities or status changes. To use this resource, the requesting Service Account or API Key must have the Organization Member role. Use the Return Events from One Organization endpoint to retrieve all events to which the authenticated user has access. + + This resource remains under revision and may change. + externalDocs: + description: Return Events from One Organization + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Events/operation/listOrganizationEvents + operationId: getOrganizationEvent + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the event that you want to return. + in: path + name: eventId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: Flag that indicates whether to include the raw document in the output. The raw document contains additional meta information about the event. + in: query + name: includeRaw + schema: + default: false + type: boolean + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/EventViewForOrg" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Event from One Organization + tags: + - Events + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getOrganizationEvent --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetOrganizationEventApiParams{} + sdkResp, httpResp, err := client.EventsApi. + GetOrganizationEventWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/events/{eventId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/events/{eventId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Events/operation/getOrganizationEvent + /api/atlas/v2/orgs/{orgId}/federationSettings: + get: + description: Returns information about the federation settings for the specified organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role in the connected org. + operationId: getFederationSettings + parameters: + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrgFederationSettings" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Federation Settings for One Organization + tags: + - Federated Authentication + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getFederationSettings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetFederationSettingsApiParams{} + sdkResp, httpResp, err := client.FederatedAuthenticationApi. + GetFederationSettingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/federationSettings?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/federationSettings?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Federated-Authentication/operation/getFederationSettings + /api/atlas/v2/orgs/{orgId}/groups: + get: + description: |- + Returns multiple projects in the specified organization. Each organization can have multiple projects. Use projects to: + + - Isolate different environments, such as development, test, or production environments, from each other. + - Associate different MongoDB Cloud users or teams with different environments, or give different permission to MongoDB Cloud users in different environments. + - Maintain separate cluster security configurations. + - Create different alert settings. + + To use this resource, the requesting Service Account or API Key must have the Organization Member role. + operationId: listOrganizationProjects + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: Human-readable label of the project to use to filter the returned list. Performs a case-insensitive search for a project within the organization which is prefixed by the specified name. + in: query + name: name + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedAtlasGroup" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-response-has-no-input-fields: Content predates IPA validation + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + xgen-IPA-104-get-method-returns-single-resource: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Projects in One Organization + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listOrganizationProjects --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListOrganizationProjectsApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + ListOrganizationProjectsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/groups?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/groups?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/listOrganizationProjects + /api/atlas/v2/orgs/{orgId}/invites: + get: + deprecated: true + description: |- + Returns all pending invitations to the specified organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: Invitation management APIs are deprecated. Use Return All MongoDB Cloud Users in One Organization and filter by `orgMembershipStatus` to return all pending users. + externalDocs: + description: Return All MongoDB Cloud Users in One Organization + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/listOrganizationUsers + operationId: listOrganizationInvitations + parameters: + - $ref: "#/components/parameters/orgId" + - description: Email address of the user account invited to this organization. If you exclude this parameter, this resource returns all pending invitations. + in: query + name: username + schema: + format: email + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/OrganizationInvitation" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Organization Invitations + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listOrganizationInvitations --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListOrganizationInvitationsApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + ListOrganizationInvitationsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites?pretty=true" + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/listOrganizationInvitations + patch: + deprecated: true + description: |- + Updates the details of one pending invitation to the specified organization. To specify which invitation, provide the username of the invited user. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: Invitation management are deprecated. Use Update One MongoDB Cloud User in One Organization to update a pending user. + externalDocs: + description: Update One MongoDB Cloud User in One Organization + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/updateOrganizationUser + operationId: updateOrganizationInvitation + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationInvitationRequest" + description: Updates the details of one pending invitation to the specified organization. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationInvitation" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Organization Invitation + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateOrganizationInvitation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateOrganizationInvitationApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + UpdateOrganizationInvitationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/updateOrganizationInvitation + post: + deprecated: true + description: |- + Invites one MongoDB Cloud user to join the specified organization. The user must accept the invitation to access information within the specified organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: Invitation management APIs are deprecated. Use Add One MongoDB Cloud User to One Organization to invite a user. + externalDocs: + description: Add One MongoDB Cloud User to One + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/createOrganizationUser + operationId: createOrganizationInvitation + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationInvitationRequest" + description: Invites one MongoDB Cloud user to join the specified organization. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationInvitation" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Invite One MongoDB Cloud User to One Atlas Organization + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createOrganizationInvitation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateOrganizationInvitationApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + CreateOrganizationInvitationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/createOrganizationInvitation + /api/atlas/v2/orgs/{orgId}/invites/{invitationId}: + delete: + deprecated: true + description: |- + Cancels one pending invitation sent to the specified MongoDB Cloud user to join an organization. You can't cancel an invitation that the user accepted. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: Invitation management APIs are deprecated. Use Remove One MongoDB Cloud User From One Organization to remove a pending user. + externalDocs: + description: Remove One MongoDB Cloud User in One Organization + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/removeOrganizationUser + operationId: deleteOrganizationInvitation + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the invitation. + in: path + name: invitationId + required: true + schema: + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Organization Invitation + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteOrganizationInvitation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteOrganizationInvitationApiParams{} + httpResp, err := client.OrganizationsApi. + DeleteOrganizationInvitationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites/{invitationId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites/{invitationId}" + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/deleteOrganizationInvitation + get: + deprecated: true + description: |- + Returns the details of one pending invitation to the specified organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: Invitation management APIs are deprecated. Use Return One MongoDB Cloud User in One Organization to return a pending user. + externalDocs: + description: Return One MongoDB Cloud User in One Organization + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/getOrganizationUser + operationId: getOrganizationInvitation + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the invitation. + in: path + name: invitationId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationInvitation" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Organization Invitation + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getOrganizationInvitation --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetOrganizationInvitationApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + GetOrganizationInvitationWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites/{invitationId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites/{invitationId}?pretty=true" + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/getOrganizationInvitation + patch: + deprecated: true + description: |- + Updates the details of one pending invitation to the specified organization. To specify which invitation, provide the unique identification string for that invitation. Use the Return All Organization Invitations endpoint to retrieve IDs for all pending organization invitations. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: Invitation management APIs are deprecated. Use Update One MongoDB Cloud User in One Organization to update a pending user. + externalDocs: + description: Update One MongoDB Cloud User in One Organization + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/updateOrganizationUser + operationId: updateOrganizationInvitationById + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the invitation. + in: path + name: invitationId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationInvitationUpdateRequest" + description: Updates the details of one pending invitation to the specified organization. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationInvitation" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Organization Invitation by Invitation ID + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateOrganizationInvitationById --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateOrganizationInvitationByIdApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + UpdateOrganizationInvitationByIdWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites/{invitationId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invites/{invitationId}" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/updateOrganizationInvitationById + /api/atlas/v2/orgs/{orgId}/invoices: + get: + description: |- + Returns all invoices that MongoDB issued to the specified organization. This list includes all invoices regardless of invoice status. To use this resource, the requesting Service Account or API Key must have the Organization Billing Viewer, Organization Billing Admin, or Organization Owner role. If you have a cross-organization setup, you can view linked invoices if you have the Organization Billing Admin or Organization Owner role. + To compute the total owed amount of the invoices - sum up total owed of each invoice. It could be computed as a sum of owed amount of each payment included into the invoice. To compute payment's owed amount - use formula *totalBilledCents* * *unitPrice* + *salesTax* - *startingBalanceCents*. + operationId: listInvoices + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: Flag that indicates whether to return linked invoices in the linkedInvoices field. + in: query + name: viewLinkedInvoices + schema: + default: true + type: boolean + - description: Statuses of the invoice to be retrieved. Omit to return invoices of all statuses. + in: query + name: statusNames + schema: + items: + type: string + type: array + uniqueItems: true + - description: Retrieve the invoices the startDates of which are greater than or equal to the fromDate. If omit, the invoices return will go back to earliest startDate. + in: query + name: fromDate + schema: + example: 2023-01-01 + format: date + type: string + - description: Retrieve the invoices the endDates of which are smaller than or equal to the toDate. If omit, the invoices return will go further to latest endDate. + in: query + name: toDate + schema: + example: 2023-01-01 + format: date + type: string + - description: Field used to sort the returned invoices by. Use in combination with orderBy parameter to control the order of the result. + in: query + name: sortBy + schema: + default: END_DATE + type: string + - description: Field used to order the returned invoices by. Use in combination of sortBy parameter to control the order of the result. + example: desc + in: query + name: orderBy + schema: + default: desc + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiInvoiceMetadata" + x-xgen-IPA-exception: + xgen-IPA-105-list-method-response-is-get-method-response: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Invoices for One Organization + tags: + - Invoices + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listInvoices --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListInvoicesApiParams{} + sdkResp, httpResp, err := client.InvoicesApi. + ListInvoicesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Invoices/operation/listInvoices + /api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}: + get: + description: |- + Returns one invoice that MongoDB issued to the specified organization. A unique 24-hexadecimal digit string identifies the invoice. You can choose to receive this invoice in JSON or CSV format. To use this resource, the requesting Service Account or API Key must have the Organization Billing Viewer, Organization Billing Admin, or Organization Owner role. If you have a cross-organization setup, you can query for a linked invoice if you have the Organization Billing Admin or Organization Owner role. + To compute the total owed amount of the invoice - sum up total owed amount of each payment included into the invoice. To compute payment's owed amount - use formula *totalBilledCents* * *unitPrice* + *salesTax* - *startingBalanceCents*. + operationId: getInvoice + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the invoice submitted to the specified organization. Charges typically post the next day. + in: path + name: invoiceId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/BillingInvoice" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + application/vnd.atlas.2023-01-01+csv: + example: | + Invoice Number,666acb8787ba43606905dcae, + Billing Period,"June 1, 2024 - July 1, 2024", + Organization Name,Test 2, + Organization ID,666acb8787ba43606905dcac, + + Date,Usage Date,Description,Note,Organization Name,Organization ID,Project,Project ID,SKU,Region,Cluster,Replica Set,Config Server,Application,Unit,Unit Price,Quantity,Discount Percent,Amount + schema: + type: string + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Invoice for One Organization + tags: + - Invoices + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getInvoice --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetInvoiceApiParams{} + sdkResp, httpResp, err := client.InvoicesApi. + GetInvoiceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Invoices/operation/getInvoice + /api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}/csv: + get: + description: |- + Returns one invoice that MongoDB issued to the specified organization in CSV format. A unique 24-hexadecimal digit string identifies the invoice. To use this resource, the requesting Service Account or API Key have at least the Organization Billing Viewer, Organization Billing Admin, or Organization Owner role. If you have a cross-organization setup, you can query for a linked invoice if you have the Organization Billing Admin or Organization Owner Role. + To compute the total owed amount of the invoice - sum up total owed amount of each payment included into the invoice. To compute payment's owed amount - use formula *totalBilledCents* * *unitPrice* + *salesTax* - *startingBalanceCents*. + operationId: downloadInvoiceCsv + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the invoice submitted to the specified organization. Charges typically post the next day. + in: path + name: invoiceId + required: true + schema: + pattern: "[0-9a-f]+" + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+csv: + example: | + Invoice Number,666acb8787ba43606905dcae, + Billing Period,"June 1, 2024 - July 1, 2024", + Organization Name,Test 2, + Organization ID,666acb8787ba43606905dcac, + + Date,Usage Date,Description,Note,Organization Name,Organization ID,Project,Project ID,SKU,Region,Cluster,Replica Set,Config Server,Application,Unit,Unit Price,Quantity,Discount Percent,Amount + schema: + type: string + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Invoice as CSV for One Organization + tags: + - Invoices + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api downloadInvoiceCsv --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DownloadInvoiceCsvApiParams{} + sdkResp, httpResp, err := client.InvoicesApi. + DownloadInvoiceCsvWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}/csv?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}/csv?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Invoices/operation/downloadInvoiceCsv + /api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}/lineItems:search: + get: + description: Query the lineItems of the specified invoice and return the result JSON. A unique 24-hexadecimal digit string identifies the invoice. + operationId: queryLineItemsFromSingleInvoice + parameters: + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the invoice submitted to the specified organization. Charges typically post the next day. + in: path + name: invoiceId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiPublicUsageDetailsQueryRequest" + description: Filter parameters for the lineItems query. Send a request with an empty JSON body to retrieve all line items for a given invoiceID without applying any filters. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedPublicApiUsageDetailsLineItem" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Line Items for One Invoice by Invoice ID + tags: + - Invoices + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api queryLineItemsFromSingleInvoice --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.QueryLineItemsFromSingleInvoiceApiParams{} + sdkResp, httpResp, err := client.InvoicesApi. + QueryLineItemsFromSingleInvoiceWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}/lineItems:search?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/{invoiceId}/lineItems:search?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Invoices/operation/queryLineItemsFromSingleInvoice + /api/atlas/v2/orgs/{orgId}/invoices/pending: + get: + description: Returns all invoices accruing charges for the current billing cycle for the specified organization. To use this resource, the requesting Service Account or API Key must have the Organization Billing Viewer, Organization Billing Admin, or Organization Owner role. If you have a cross-organization setup, you can view linked invoices if you have the Organization Billing Admin or Organization Owner Role. + operationId: listPendingInvoices + parameters: + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiInvoice" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Pending Invoices for One Organization + tags: + - Invoices + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listPendingInvoices --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListPendingInvoicesApiParams{} + sdkResp, httpResp, err := client.InvoicesApi. + ListPendingInvoicesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/pending?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/invoices/pending?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Invoices/operation/listPendingInvoices + /api/atlas/v2/orgs/{orgId}/liveMigrations/availableProjects: + get: + description: Return all projects that you can migrate to the specified organization. + operationId: listSourceProjects + parameters: + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/LiveImportAvailableProject" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Projects Available for Migration + tags: + - Cloud Migration Service + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listSourceProjects --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListSourceProjectsApiParams{} + sdkResp, httpResp, err := client.CloudMigrationServiceApi. + ListSourceProjectsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/availableProjects?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/availableProjects?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Migration-Service/operation/listSourceProjects + /api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens: + delete: + description: Remove one organization link and its associated public API key. MongoDB Atlas uses the link-token for push live migrations only. Live migrations (push) let you securely push data from Cloud Manager or Ops Manager into MongoDB Atlas. Your API Key must have the Organization Owner role to successfully call this resource. + operationId: deleteLinkToken + parameters: + - $ref: "#/components/parameters/orgId" + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Link-Token + tags: + - Cloud Migration Service + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteLinkToken --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteLinkTokenApiParams{} + httpResp, err := client.CloudMigrationServiceApi. + DeleteLinkTokenWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Migration-Service/operation/deleteLinkToken + post: + description: Create one link-token that contains all the information required to complete the link. MongoDB Atlas uses the link-token for push live migrations only. Live migration (push) allows you to securely push data from Cloud Manager or Ops Manager into MongoDB Atlas. Your API Key must have the Organization Owner role to successfully call this resource. + operationId: createLinkToken + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TargetOrgRequest" + description: IP address access list entries associated with the migration. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TargetOrg" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Link-Token + tags: + - Cloud Migration Service + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createLinkToken --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateLinkTokenApiParams{} + sdkResp, httpResp, err := client.CloudMigrationServiceApi. + CreateLinkTokenWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/liveMigrations/linkTokens" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Cloud-Migration-Service/operation/createLinkToken + /api/atlas/v2/orgs/{orgId}/nonCompliantResources: + get: + description: Return all non-compliant resources for an org. + externalDocs: + description: Atlas Resource Policies + url: https://dochub.mongodb.org/core/atlas-resource-policies + operationId: getResourcesNonCompliant + parameters: + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + items: + $ref: "#/components/schemas/ApiAtlasNonCompliantResource" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + xgen-IPA-104-get-method-returns-single-resource: API predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Non-Compliant Resources + tags: + - Resource Policies + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getResourcesNonCompliant --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetResourcesNonCompliantApiParams{} + sdkResp, httpResp, err := client.ResourcePoliciesApi. + GetResourcesNonCompliantWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/nonCompliantResources?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/nonCompliantResources?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/getResourcesNonCompliant + /api/atlas/v2/orgs/{orgId}/resourcePolicies: + get: + description: Return all Atlas Resource Policies for the org. + externalDocs: + description: Atlas Resource Policies + url: https://dochub.mongodb.org/core/atlas-resource-policies + operationId: listOrgResourcePolicies + parameters: + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + items: + $ref: "#/components/schemas/ApiAtlasResourcePolicy" + type: array + x-xgen-IPA-exception: + xgen-IPA-124-array-max-items: Schema predates IPA validation + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Atlas Resource Policies + tags: + - Resource Policies + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listOrgResourcePolicies --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListOrgResourcePoliciesApiParams{} + sdkResp, httpResp, err := client.ResourcePoliciesApi. + ListOrgResourcePoliciesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/listOrgResourcePolicies + post: + description: Create one Atlas Resource Policy for an org. + externalDocs: + description: Atlas Resource Policies + url: https://dochub.mongodb.org/core/atlas-resource-policies + operationId: createOrgResourcePolicy + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicyCreate" + x-xgen-version: 2024-08-05 + description: Atlas Resource Policy to create. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicy" + x-xgen-version: 2024-08-05 + description: Created + "400": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasInvalidResourcePolicyCreateError" + x-xgen-version: 2024-08-05 + description: Bad request. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Atlas Resource Policy + tags: + - Resource Policies + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createOrgResourcePolicy --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateOrgResourcePolicyApiParams{} + sdkResp, httpResp, err := client.ResourcePoliciesApi. + CreateOrgResourcePolicyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/createOrgResourcePolicy + /api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId}: + delete: + description: Delete one Atlas Resource Policy for an org. + externalDocs: + description: Atlas Resource Policies + url: https://dochub.mongodb.org/core/atlas-resource-policies + operationId: deleteOrgResourcePolicy + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies an atlas resource policy. + in: path + name: resourcePolicyId + required: true + schema: + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Atlas Resource Policy + tags: + - Resource Policies + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteOrgResourcePolicy --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteOrgResourcePolicyApiParams{} + httpResp, err := client.ResourcePoliciesApi. + DeleteOrgResourcePolicyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/deleteOrgResourcePolicy + get: + description: Return one Atlas Resource Policy for an org. + externalDocs: + description: Atlas Resource Policies + url: https://dochub.mongodb.org/core/atlas-resource-policies + operationId: getOrgResourcePolicy + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies an atlas resource policy. + in: path + name: resourcePolicyId + required: true + schema: + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicy" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Atlas Resource Policy + tags: + - Resource Policies + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getOrgResourcePolicy --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetOrgResourcePolicyApiParams{} + sdkResp, httpResp, err := client.ResourcePoliciesApi. + GetOrgResourcePolicyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/getOrgResourcePolicy + patch: + description: Update one Atlas Resource Policy for an org. + externalDocs: + description: Atlas Resource Policies + url: https://dochub.mongodb.org/core/atlas-resource-policies + operationId: updateOrgResourcePolicy + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies an atlas resource policy. + in: path + name: resourcePolicyId + required: true + schema: + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicyEdit" + x-xgen-version: 2024-08-05 + description: Atlas Resource Policy to update. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicy" + x-xgen-version: 2024-08-05 + description: Ok + "400": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasInvalidResourcePolicyCreateError" + x-xgen-version: 2024-08-05 + description: Bad request. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Atlas Resource Policy + tags: + - Resource Policies + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateOrgResourcePolicy --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateOrgResourcePolicyApiParams{} + sdkResp, httpResp, err := client.ResourcePoliciesApi. + UpdateOrgResourcePolicyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies/{resourcePolicyId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/updateOrgResourcePolicy + /api/atlas/v2/orgs/{orgId}/resourcePolicies:validate: + post: + description: Validate one Atlas Resource Policy for an org. + externalDocs: + description: Atlas Resource Policies + url: https://dochub.mongodb.org/core/atlas-resource-policies + operationId: validateAtlasResourcePolicy + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicyCreate" + x-xgen-version: 2024-08-05 + description: Atlas Resource Policy to create. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasResourcePolicy" + x-xgen-version: 2024-08-05 + description: Ok + "400": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ApiAtlasInvalidResourcePolicyCreateError" + x-xgen-version: 2024-08-05 + description: Bad request. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Validate One Atlas Resource Policy + tags: + - Resource Policies + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api validateAtlasResourcePolicy --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ValidateAtlasResourcePolicyApiParams{} + sdkResp, httpResp, err := client.ResourcePoliciesApi. + ValidateAtlasResourcePolicyWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies:validate" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/resourcePolicies:validate" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Resource-Policies/operation/validateAtlasResourcePolicy + /api/atlas/v2/orgs/{orgId}/serviceAccounts: + get: + description: Returns all Service Accounts for the specified Organization. + operationId: listServiceAccounts + parameters: + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedOrgServiceAccounts" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Organization Service Accounts + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listServiceAccounts --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListServiceAccountsApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + ListServiceAccountsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/listServiceAccounts + post: + description: Creates one Service Account for the specified Organization. + operationId: createServiceAccount + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccountRequest" + description: Details of the new Service Account. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccount" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Organization Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createServiceAccount --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateServiceAccountApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + CreateServiceAccountWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createServiceAccount + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}: + delete: + description: Deletes the specified Service Account. + operationId: deleteServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - $ref: "#/components/parameters/orgId" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Organization Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteServiceAccount --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteServiceAccountApiParams{} + httpResp, err := client.ServiceAccountsApi. + DeleteServiceAccountWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteServiceAccount + get: + description: Returns the specified Service Account. + operationId: getServiceAccount + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccount" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Organization Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getServiceAccount --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetServiceAccountApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + GetServiceAccountWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/getServiceAccount + patch: + description: Updates the specified Service Account in the specified Organization. + operationId: updateServiceAccount + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccountUpdateRequest" + description: The new details for the Service Account. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/OrgServiceAccount" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One Organization Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateServiceAccount --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateServiceAccountApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + UpdateServiceAccountWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/updateServiceAccount + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList: + get: + description: Returns all access list entries that you configured for the specified Service Account for the organization. + operationId: listServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntry" + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Access List Entries for One Organization Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listServiceAccountAccessList --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListServiceAccountAccessListApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + ListServiceAccountAccessListWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/listServiceAccountAccessList + post: + description: Add Access List Entries for the specified Service Account for the organization. Resources require all API requests to originate from IP addresses on the API access list. + operationId: createServiceAccountAccessList + parameters: + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + items: + $ref: "#/components/schemas/ServiceAccountIPAccessListEntry" + maxItems: 200 + type: array + x-xgen-version: 2024-08-05 + description: A list of access list entries to add to the access list of the specified Service Account for the organization. + required: true + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountIPAccessEntry" + x-xgen-version: 2024-08-05 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add Access List Entries for One Organization Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createServiceAccountAccessList --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateServiceAccountAccessListApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + CreateServiceAccountAccessListWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createServiceAccountAccessList + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress}: + delete: + description: Removes the specified access list entry from the specified Service Account for the organization. You can't remove the requesting IP address from the access list. + operationId: deleteServiceAccountAccessListEntry + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - description: One IP address or multiple IP addresses represented as one CIDR block. When specifying a CIDR block with a subnet mask, such as 192.0.2.0/24, use the URL-encoded value %2F for the forward slash /. + in: path + name: ipAddress + required: true + schema: + example: 192.0.2.0%2F24 + pattern: ^([0-9]{1,3}\.){3}[0-9]{1,3}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){7}[0-9a-f]{1,4}(%2[fF][0-9]{1,3})?|([0-9a-f]{1,4}\:){1,6}\:(%2[fF][0-9]{1,3})?$ + type: string + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Access List Entry from One Organization Service Account + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteServiceAccountAccessListEntry --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteServiceAccountAccessListEntryApiParams{} + httpResp, err := client.ServiceAccountsApi. + DeleteServiceAccountAccessListEntryWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/accessList/{ipAddress}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteServiceAccountAccessListEntry + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups: + get: + description: Returns a list of all projects the specified Service Account is a part of. + operationId: listServiceAccountProjects + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + responses: + "200": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/PaginatedServiceAccountGroup" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + xgen-IPA-104-get-method-returns-single-resource: API predates IPA validation + x-xgen-version: 2024-08-05 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Service Account Project Assignments + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listServiceAccountProjects --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListServiceAccountProjectsApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + ListServiceAccountProjectsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/groups?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/listServiceAccountProjects + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets: + post: + description: Create a secret for the specified Service Account. + operationId: createServiceAccountSecret + parameters: + - $ref: "#/components/parameters/orgId" + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + requestBody: + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecretRequest" + description: Details for the new secret. + required: true + responses: + "201": + content: + application/vnd.atlas.2024-08-05+json: + schema: + $ref: "#/components/schemas/ServiceAccountSecret" + x-xgen-version: 2024-08-05 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Organization Service Account Secret + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createServiceAccountSecret --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateServiceAccountSecretApiParams{} + sdkResp, httpResp, err := client.ServiceAccountsApi. + CreateServiceAccountSecretWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/createServiceAccountSecret + /api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId}: + delete: + description: Deletes the specified Service Account secret. + operationId: deleteServiceAccountSecret + parameters: + - description: The Client ID of the Service Account. + in: path + name: clientId + required: true + schema: + example: mdb_sa_id_1234567890abcdef12345678 + pattern: ^mdb_sa_id_[a-fA-F\d]{24}$ + type: string + - description: Unique 24-hexadecimal digit string that identifies the secret. + in: path + name: secretId + required: true + schema: + type: string + - $ref: "#/components/parameters/orgId" + responses: + "204": + content: + application/vnd.atlas.2024-08-05+json: + x-xgen-version: 2024-08-05 + description: This endpoint does not return a response body. + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Delete One Organization Service Account Secret + tags: + - Service Accounts + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteServiceAccountSecret --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteServiceAccountSecretApiParams{} + httpResp, err := client.ServiceAccountsApi. + DeleteServiceAccountSecretWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/serviceAccounts/{clientId}/secrets/{secretId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Service-Accounts/operation/deleteServiceAccountSecret + /api/atlas/v2/orgs/{orgId}/settings: + get: + description: Returns details about the specified organization's settings. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + operationId: getOrganizationSettings + parameters: + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationSettings" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return Settings for One Organization + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getOrganizationSettings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetOrganizationSettingsApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + GetOrganizationSettingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/settings?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/settings?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/getOrganizationSettings + patch: + description: Updates the organization's settings. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + operationId: updateOrganizationSettings + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationSettings" + description: Details to update on the specified organization's settings. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/OrganizationSettings" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "429": + $ref: "#/components/responses/tooManyRequests" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Settings for One Organization + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateOrganizationSettings --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateOrganizationSettingsApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + UpdateOrganizationSettingsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/settings" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/settings" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/updateOrganizationSettings + /api/atlas/v2/orgs/{orgId}/teams: + get: + description: Returns all teams that belong to the specified organization. Teams enable you to grant project access roles to MongoDB Cloud users. MongoDB Cloud only returns teams for which you have access. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: listOrganizationTeams + parameters: + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/pageNum" + - $ref: "#/components/parameters/orgId" + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedTeam" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All Teams in One Organization + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listOrganizationTeams --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListOrganizationTeamsApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + ListOrganizationTeamsWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/listOrganizationTeams + post: + description: Creates one team in the specified organization. Teams enable you to grant project access roles to MongoDB Cloud users. MongoDB Cloud limits the number of teams to a maximum of 250 teams per organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: createTeam + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/Team" + description: Team that you want to create in the specified organization. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/Team" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One Team in One Organization + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createTeam --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateTeamApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + CreateTeamWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/createTeam + /api/atlas/v2/orgs/{orgId}/teams/{teamId}: + delete: + description: Removes one team specified using its unique 24-hexadecimal digit identifier from the organization specified using its unique 24-hexadecimal digit identifier. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: deleteTeam + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the team that you want to delete. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Team from One Organization + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api deleteTeam --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.DeleteTeamApiParams{} + httpResp, err := client.TeamsApi. + DeleteTeamWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/deleteTeam + get: + description: Returns one team that you identified using its unique 24-hexadecimal digit ID. This team belongs to one organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: getTeamById + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the team whose information you want to return. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TeamResponse" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Team by ID + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getTeamById --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetTeamByIdApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + GetTeamByIdWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/getTeamById + patch: + description: Renames one team in the specified organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: renameTeam + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the team that you want to rename. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TeamUpdate" + description: Details to update on the specified team. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TeamResponse" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Rename One Team + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api renameTeam --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RenameTeamApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + RenameTeamWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/renameTeam + /api/atlas/v2/orgs/{orgId}/teams/{teamId}/users: + get: + description: |- + Returns details about the pending and active MongoDB Cloud users associated with the specified team in the organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + + **Note**: This resource cannot be used to view details about users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + + **Note**: To return both pending and active users, use v2-{2025-02-19} or later. If using a deprecated version, only active users will be returned. Deprecated versions: v2-{2023-01-01} + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: listTeamUsers + parameters: + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/pageNum" + - description: Unique 24-hexadecimal digit string that identifies the team whose application users you want to return. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: Email address to filter users by. Not supported in deprecated versions. + in: query + name: username + schema: + format: email + type: string + - description: Organization membership status to filter users by. If you exclude this parameter, this resource returns both pending and active users. Not supported in deprecated versions. + in: query + name: orgMembershipStatus + schema: + example: ACTIVE + type: string + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/PaginatedOrgUser" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All MongoDB Cloud Users Assigned to One Team + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listTeamUsers --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListTeamUsersApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + ListTeamUsersWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}/users?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}/users?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/listTeamUsers + post: + deprecated: true + description: |- + Adds one or more MongoDB Cloud users from the specified organization to the specified team. Teams enable you to grant project access roles to MongoDB Cloud users. You can assign up to 250 MongoDB Cloud users from one organization to one team. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: This endpoint is deprecated. Use [Add One MongoDB Cloud User to One Team](#tag/MongoDB-Cloud-Users/operation/addUserToTeam) to add an active or pending user to a team. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: addTeamUser + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal character string that identifies the team to which you want to add MongoDB Cloud users. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + items: + $ref: "#/components/schemas/AddUserToTeam" + type: array + description: One or more MongoDB Cloud users that you want to add to the specified team. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/PaginatedApiAppUser" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Assign MongoDB Cloud Users in One Organization to One Team + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api addTeamUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AddTeamUserApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + AddTeamUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}/users" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}/users" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/addTeamUser + /api/atlas/v2/orgs/{orgId}/teams/{teamId}/users/{userId}: + delete: + deprecated: true + description: |- + Removes one MongoDB Cloud user from the specified team. This team belongs to one organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: This endpoint is deprecated. Use [Remove One MongoDB Cloud User from One Team](#tag/MongoDB-Cloud-Users/operation/removeUserFromTeam) to remove an active or pending user from a team. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: removeTeamUser + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the team from which you want to remove one database application user. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + - description: Unique 24-hexadecimal digit string that identifies MongoDB Cloud user that you want to remove from the specified team. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "204": + content: + application/vnd.atlas.2023-01-01+json: + x-xgen-version: 2023-01-01 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One MongoDB Cloud User from One Team + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api removeTeamUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RemoveTeamUserApiParams{} + httpResp, err := client.TeamsApi. + RemoveTeamUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}/users/{userId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}/users/{userId}" + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/removeTeamUser + /api/atlas/v2/orgs/{orgId}/teams/{teamId}:addUser: + post: + description: |- + Adds one MongoDB Cloud user to one team. You can add an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: This resource cannot be used to add a user invited via the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project endpoint" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/updateProjectInvitation + operationId: addUserToTeam + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the team to add the MongoDB Cloud user to. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/AddOrRemoveUserFromTeam" + description: The active or pending MongoDB Cloud user that you want to add to the specified team. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One MongoDB Cloud User to One Team + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api addUserToTeam --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AddUserToTeamApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + AddUserToTeamWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}:addUser" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}:addUser" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/addUserToTeam + /api/atlas/v2/orgs/{orgId}/teams/{teamId}:removeUser: + post: + description: |- + Removes one MongoDB Cloud user from one team. You can remove an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: This resource cannot be used to remove a user invited via the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: removeUserFromTeam + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the team to remove the MongoDB user from. + in: path + name: teamId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/AddOrRemoveUserFromTeam" + description: The id of the active or pending MongoDB Cloud user that you want to remove from the specified team. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One MongoDB Cloud User from One Team + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api removeUserFromTeam --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RemoveUserFromTeamApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + RemoveUserFromTeamWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}:removeUser" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/{teamId}:removeUser" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/removeUserFromTeam + /api/atlas/v2/orgs/{orgId}/teams/byName/{teamName}: + get: + description: Returns one team that you identified using its human-readable name. This team belongs to one organization. Teams enable you to grant project access roles to MongoDB Cloud users. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + externalDocs: + description: Manage Organization Teams + url: https://docs.atlas.mongodb.com/access/manage-teams-in-orgs/#std-label-manage-teams + operationId: getTeamByName + parameters: + - $ref: "#/components/parameters/orgId" + - description: Name of the team whose information you want to return. + in: path + name: teamName + required: true + schema: + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/TeamResponse" + x-xgen-version: 2023-01-01 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One Team by Name + tags: + - Teams + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getTeamByName --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetTeamByNameApiParams{} + sdkResp, httpResp, err := client.TeamsApi. + GetTeamByNameWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/byName/{teamName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/teams/byName/{teamName}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Teams/operation/getTeamByName + /api/atlas/v2/orgs/{orgId}/users: + get: + description: |- + Returns details about the pending and active MongoDB Cloud users associated with the specified organization. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + + **Note**: This resource cannot be used to view details about users invited via the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + + **Note**: To return both pending and active users, use v2-{2025-02-19} or later. If using a deprecated version, only active users will be returned. Deprecated versions: v2-{2023-01-01} + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: listOrganizationUsers + parameters: + - $ref: "#/components/parameters/orgId" + - $ref: "#/components/parameters/includeCount" + - $ref: "#/components/parameters/itemsPerPage" + - $ref: "#/components/parameters/pageNum" + - description: Email address to filter users by. Not supported in deprecated versions. + in: query + name: username + schema: + format: email + type: string + - description: Organization membership status to filter users by. If you exclude this parameter, this resource returns both pending and active users. Not supported in deprecated versions. + in: query + name: orgMembershipStatus + schema: + example: ACTIVE + type: string + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/PaginatedOrgUser" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return All MongoDB Cloud Users in One Organization + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api listOrganizationUsers --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ListOrganizationUsersApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + ListOrganizationUsersWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/listOrganizationUsers + post: + description: |- + Invites one new or existing MongoDB Cloud user to join the organization. The invitation to join the organization will be sent to the username provided and must be accepted within 30 days. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: If the user does not have an existing MongoDB Cloud account, they will be prompted to finish setting up an account upon accepting the invitation. If the user already has an account, they will still receive an invitation to access the organization. + operationId: createOrganizationUser + parameters: + - $ref: "#/components/parameters/orgId" + requestBody: + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserRequest" + description: Represents the MongoDB Cloud user to be created within the organization. + required: true + responses: + "201": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-02-19 + description: Created + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One MongoDB Cloud User to One Organization + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createOrganizationUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateOrganizationUserApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + CreateOrganizationUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/createOrganizationUser + /api/atlas/v2/orgs/{orgId}/users/{userId}: + delete: + description: |- + Removes one MongoDB Cloud user in the specified organization. You can remove an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: This resource cannot be used to remove pending users invited via the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + + **Note**: To remove pending or active users, use v2-{2025-02-19} or later. If using a deprecated version, only active users can be removed. Deprecated versions: v2-{2023-01-01} + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: removeOrganizationUser + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the [Return All MongoDB Cloud Users in One Organization](#tag/MongoDB-Cloud-Users/operation/listOrganizationUsers) resource and filter by username. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + x-xgen-IPA-exception: + xgen-IPA-117-description-should-not-use-inline-links: Parameters don't support externalDocs + responses: + "204": + content: + application/vnd.atlas.2025-02-19+json: + x-xgen-version: 2025-02-19 + description: This endpoint does not return a response body. + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One MongoDB Cloud User from One Organization + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api removeOrganizationUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RemoveOrganizationUserApiParams{} + httpResp, err := client.MongoDBCloudUsersApi. + RemoveOrganizationUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X DELETE "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/removeOrganizationUser + get: + description: |- + Returns information about the specified MongoDB Cloud user within the context of the specified organization. To use this resource, the requesting Service Account or API Key must have the Organization Member role. + + **Note**: This resource can only be used to fetch information about MongoDB Cloud human users. To return information about an API Key, use the [Return One Organization API Key](#tag/Programmatic-API-Keys/operation/getApiKey) endpoint. + + **Note**: This resource does not return information about pending users invited via the deprecated [Invite One MongoDB Cloud User to Join One Project](#tag/Projects/operation/createProjectInvitation) endpoint. + operationId: getOrganizationUser + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One MongoDB Cloud User in One Organization + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getOrganizationUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetOrganizationUserApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + GetOrganizationUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/getOrganizationUser + patch: + description: |- + Updates one MongoDB Cloud user in the specified organization. You can update an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: Only include the fields you wish to update in the request body. Supplying a field with an empty value will reset that field on the user. + + **Note**: This resource cannot be used to update pending users invited via the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: updateOrganizationUser + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserUpdateRequest" + description: Represents the roles and teams to assign the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update One MongoDB Cloud User in One Organization + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateOrganizationUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateOrganizationUserApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + UpdateOrganizationUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PATCH "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/updateOrganizationUser + /api/atlas/v2/orgs/{orgId}/users/{userId}/roles: + put: + deprecated: true + description: Updates the roles of the specified user in the specified organization. To specify the user to update, provide the unique 24-hexadecimal digit string that identifies the user in the specified organization. To use this resource, the requesting Service Account or API Key must have the Organization User Admin role. + operationId: updateOrganizationRoles + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the user to modify. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UpdateOrgRolesForUser" + description: Roles to update for the specified user. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/UpdateOrgRolesForUser" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Update Organization Roles for One MongoDB Cloud User + tags: + - Organizations + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api updateOrganizationRoles --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.UpdateOrganizationRolesApiParams{} + sdkResp, httpResp, err := client.OrganizationsApi. + UpdateOrganizationRolesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}/roles" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X PUT "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}/roles" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Organizations/operation/updateOrganizationRoles + /api/atlas/v2/orgs/{orgId}/users/{userId}:addRole: + post: + description: |- + Adds one organization-level role to the MongoDB Cloud user. You can add a role to an active user or a user that has not yet accepted the invitation to join the organization. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: This operation is atomic. + + **Note**: This resource cannot be used to add a role to users invited using the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + externalDocs: + description: "Deprecated: Invite One MongoDB Cloud User to Join One Project" + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: addOrganizationRole + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/AddOrRemoveOrgRole" + description: Organization-level role to assign to the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "409": + $ref: "#/components/responses/conflict" + "500": + $ref: "#/components/responses/internalServerError" + summary: Add One Organization Role to One MongoDB Cloud User + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api addOrganizationRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.AddOrganizationRoleApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + AddOrganizationRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}:addRole" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}:addRole" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/addOrganizationRole + /api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole: + post: + description: |- + Removes one organization-level role from the MongoDB Cloud user. You can remove a role from an active user or a user that has not yet accepted the invitation to join the organization. To replace a user's only role, add the new role before removing the old role. A user must have at least one role at all times. To use this resource, the requesting Service Account or API Key must have the Organization Owner role. + + **Note**: This operation is atomic. + + **Note**: This resource cannot be used to remove a role from users invited using the deprecated Invite One MongoDB Cloud User to Join One Project endpoint. + externalDocs: + description: Invite One MongoDB Cloud User to Join One Project + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Projects/operation/createProjectInvitation + operationId: removeOrganizationRole + parameters: + - $ref: "#/components/parameters/orgId" + - description: Unique 24-hexadecimal digit string that identifies the pending or active user in the organization. If you need to lookup a user's userId or verify a user's status in the organization, use the Return All MongoDB Cloud Users in One Organization resource and filter by username. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + requestBody: + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/AddOrRemoveOrgRole" + description: Organization-level role to remove from the MongoDB Cloud user. + required: true + responses: + "200": + content: + application/vnd.atlas.2025-02-19+json: + schema: + $ref: "#/components/schemas/OrgUserResponse" + x-xgen-version: 2025-02-19 + description: OK + "400": + $ref: "#/components/responses/badRequest" + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Remove One Organization Role from One MongoDB Cloud User + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api removeOrganizationRole --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.RemoveOrganizationRoleApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + RemoveOrganizationRoleWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/orgs/{orgId}/users/{userId}:removeRole" \ + -d '{ }' + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/removeOrganizationRole + /api/atlas/v2/unauth/controlPlaneIPAddresses: + get: + description: Returns all control plane IP addresses. + operationId: returnAllControlPlaneIpAddresses + parameters: [] + responses: + "200": + content: + application/vnd.atlas.2023-11-15+json: + schema: + $ref: "#/components/schemas/ControlPlaneIPAddresses" + x-xgen-version: 2023-11-15 + description: OK + "500": + $ref: "#/components/responses/internalServerError" + security: [] + summary: Return All Control Plane IP Addresses + tags: + - Root + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api returnAllControlPlaneIpAddresses --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.ReturnAllControlPlaneIpAddressesApiParams{} + sdkResp, httpResp, err := client.RootApi. + ReturnAllControlPlaneIpAddressesWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/unauth/controlPlaneIPAddresses?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/unauth/controlPlaneIPAddresses?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Root/operation/returnAllControlPlaneIpAddresses + /api/atlas/v2/users: + post: + deprecated: true + description: |- + Creates one MongoDB Cloud user account. A MongoDB Cloud user account grants access to only the MongoDB Cloud application. To grant database access, create a database user. MongoDB Cloud sends an email to the users you specify, inviting them to join the project. Invited users don't have access to the project until they accept the invitation. Invitations expire after 30 days. + + MongoDB Cloud limits MongoDB Cloud user membership to a maximum of 250 MongoDB Cloud users per team. MongoDB Cloud limits MongoDB Cloud user membership to 500 MongoDB Cloud users per project and 500 MongoDB Cloud users per organization, which includes the combined membership of all projects in the organization. MongoDB Cloud raises an error if an operation exceeds these limits. For example, if you have an organization with five projects, and each project has 100 MongoDB Cloud users, and each MongoDB Cloud user belongs to only one project, you can't add any MongoDB Cloud users to this organization without first removing existing MongoDB Cloud users from the organization. + + To use this resource, the requesting Service Account or API Key can have any role. + operationId: createUser + parameters: [] + requestBody: + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudAppUser" + description: MongoDB Cloud user account to create. + required: true + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudAppUser" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Create One MongoDB Cloud User + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api createUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.CreateUserApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + CreateUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/users" \ + -d '{ }' + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + --header "Content-Type: application/json" \ + -X POST "https://cloud.mongodb.com/api/atlas/v2/users" \ + -d '{ }' + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/createUser + /api/atlas/v2/users/{userId}: + get: + deprecated: true + description: Returns the details for one MongoDB Cloud user account with the specified unique identifier for the user. You can't use this endpoint to return information on an API Key. To return information about an API Key, use the Return One Organization API Key endpoint. You can always retrieve your own user account. If you are the owner of a MongoDB Cloud organization or project, you can also retrieve the user profile for any user with membership in that organization or project. To use this resource, the requesting Service Account or API Key can have any role. + externalDocs: + description: Return One Organization API Key + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/getApiKey + operationId: getUser + parameters: + - description: Unique 24-hexadecimal digit string that identifies this user. + in: path + name: userId + required: true + schema: + pattern: ^([a-f0-9]{24})$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudAppUser" + x-xgen-IPA-exception: + xgen-IPA-104-get-method-returns-response-suffixed-object: API predates IPA validation + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One MongoDB Cloud User by ID + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getUser --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetUserApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + GetUserWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/users/{userId}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/users/{userId}?pretty=true" + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/getUser + /api/atlas/v2/users/byName/{userName}: + get: + deprecated: true + description: Returns the details for one MongoDB Cloud user account with the specified username. You can't use this endpoint to return information about an API Key. To return information about an API Key, use the Return One Organization API Key endpoint. To use this resource, the requesting Service Account or API Key can have any role. + externalDocs: + description: Return One Organization API Key + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Programmatic-API-Keys/operation/getApiKey + operationId: getUserByUsername + parameters: + - description: Email address that belongs to the MongoDB Cloud user account. You cannot modify this address after creating the user. + in: path + name: userName + required: true + schema: + pattern: ^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$ + type: string + responses: + "200": + content: + application/vnd.atlas.2023-01-01+json: + schema: + $ref: "#/components/schemas/CloudAppUser" + x-xgen-version: 2023-01-01 + description: OK + "401": + $ref: "#/components/responses/unauthorized" + "403": + $ref: "#/components/responses/forbidden" + "404": + $ref: "#/components/responses/notFound" + "500": + $ref: "#/components/responses/internalServerError" + summary: Return One MongoDB Cloud User by Username + tags: + - MongoDB Cloud Users + x-codeSamples: + - label: Atlas CLI + lang: cURL + source: atlas api getUserByUsername --help + - label: Go + lang: go + source: | + import ( + "os" + "context" + "log" + sdk "go.mongodb.org/atlas-sdk/v20250312001/admin" + ) + + func main() { + ctx := context.Background() + clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID") + clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET") + + // See https://dochub.mongodb.org/core/atlas-go-sdk-oauth + client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret)) + + if err != nil { + log.Fatalf("Error: %v", err) + } + + params = &sdk.GetUserByUsernameApiParams{} + sdkResp, httpResp, err := client.MongoDBCloudUsersApi. + GetUserByUsernameWithParams(ctx, params). + Execute() + } + - label: curl (Service Accounts) + lang: cURL + source: |- + curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/users/byName/{userName}?pretty=true" + - label: curl (Digest) + lang: cURL + source: |- + curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \ + --digest \ + --header "Accept: application/vnd.atlas.2025-03-12+json" \ + -X GET "https://cloud.mongodb.com/api/atlas/v2/users/byName/{userName}?pretty=true" + x-sunset: 2026-07-31 + x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/MongoDB-Cloud-Users/operation/getUserByUsername +security: + - ServiceAccounts: [] + - DigestAuth: [] +servers: + - url: https://cloud.mongodb.com +tags: + - description: Returns access logs for authentication attempts made to Atlas database deployments. To view database access history, you must have either the Project Owner or Organization Owner role. + name: Access Tracking + - description: Returns and edits the conditions that trigger alerts and how MongoDB Cloud notifies users. This collection remains under revision and may change. + name: Alert Configurations + - description: Returns and acknowledges alerts that MongoDB Cloud triggers based on the alert conditions that you define. This collection remains under revision and may change. + name: Alerts + - description: Returns, adds, edits, and removes Atlas Search indexes for the specified cluster. Also returns and updates user-defined analyzers for the specified cluster. + name: Atlas Search + - description: Returns and edits database auditing settings for MongoDB Cloud projects. + name: Auditing + - description: Returns and edits custom DNS configurations for MongoDB Cloud database deployments on AWS. The resource requires your Project ID. If you use the VPC peering on AWS and you use your own DNS servers instead of Amazon Route 53, enable custom DNS. Before 31 March 2020, applications deployed within AWS using custom DNS services and VPC-peered with MongoDB Cloud couldn't connect over private IP addresses. Custom DNS resolved to public IP addresses. AWS internal DNS resolved to private IP addresses. Applications deployed with custom DNS services in AWS should use Private IP for Peering connection strings. + name: AWS Clusters DNS + - description: Manages Cloud Backup snapshots, snapshot export buckets, restore jobs, and schedules. This resource applies only to clusters that use Cloud Backups. + name: Cloud Backups + - description: Manages the Cloud Migration Service. Source organizations, projects, and MongoDB clusters reside on Cloud Manager or Ops Manager. Destination organizations, projects, and MongoDB clusters reside on MongoDB Cloud. Source databases can't use any authentication except SCRAM-SHA. + name: Cloud Migration Service + - description: Returns, adds, authorizes, and removes AWS IAM roles in Atlas. + name: Cloud Provider Access + - description: Returns, starts, or ends a cluster outage simulation. + name: Cluster Outage Simulation + - description: Returns, adds, edits, and removes database deployments. Changes to cluster configurations can affect costs. This resource requires your Project ID. + name: Clusters + - description: Returns, adds, and edits pinned namespaces for the specified cluster or process. Also returns collection level latency metric data. + name: Collection Level Metrics + - description: Returns, adds, edits, and removes custom database user privilege roles. Use custom roles to specify custom sets of actions that the MongoDB Cloud built-in roles can't describe. You define custom roles at the project level, for all clusters in the project. This resource supports a subset of MongoDB privilege actions. You can create a subset of custom role actions. To create a wider list of custom role actions, use the MongoDB Cloud user interface. Custom roles must include actions that all project's clusters support, and that are compatible with each MongoDB version that your project's clusters use. For example, if your project has MongoDB 4.2 clusters, you can't create custom roles that use actions introduced in MongoDB 4.4. + name: Custom Database Roles + - description: Returns, adds, edits, and removes Federated Database Instances. This resource requires your project ID. Changes to federated database instance configurations can affect costs. + name: Data Federation + - description: Returns, edits, and removes Atlas Data Lake Pipelines and associated runs. + externalDocs: + description: Data Lake Pipelines are deprecated. Please see Data Lake Deprecation Guide. + url: https://dochub.mongodb.org/core/data-lake-deprecation + name: Data Lake Pipelines + - description: Returns, adds, edits, and removes database users. + name: Database Users + - description: Returns and edits the Encryption at Rest using Customer Key Management configuration. MongoDB Cloud encrypts all storage whether or not you use your own key management. + name: Encryption at Rest using Customer Key Management + - description: Returns events. This collection remains under revision and may change. + name: Events + - description: Returns, adds, edits, and removes federation-related features such as role mappings and connected organization configurations. + name: Federated Authentication + - description: Returns, adds, edits, and removes flex clusters. + name: Flex Clusters + - description: Returns and adds restore jobs for flex database deployments. + name: Flex Restore Jobs + - description: Returns and requests to download flex database deployment snapshots. + name: Flex Snapshots + - description: |- + Returns, adds, and removes Global Cluster managed namespaces and custom zone mappings. Each collection in a Global Cluster is associated with a managed namespace. When you create a managed namespace for a Global Cluster, MongoDB Cloud creates an empty collection for that namespace. Creating a managed namespace doesn't populate a collection with data. Similarly, deleting a managed namespace doesn't delete the associated collection. + MongoDB Cloud shards the empty collection using the required location field and a custom shard key. For example, if your custom shard key is `city`, the compound shard key is `location, city`. Each Global Cluster is also associated with one or more Global Writes Zones. When a user creates a Global Cluster, MongoDB Cloud automatically maps each location code to the closest geographical zone. Custom zone mappings allow administrators to override these automatic mappings. For example, a use case might require mapping a location code to a geographically distant zone. Administrators can manage custom zone mappings with the APIs below and the **Global Cluster Configuration** pane when you create or modify your Global Cluster. + name: Global Clusters + - description: Returns invoices. + name: Invoices + - description: Returns, edits, verifies, and removes LDAP configurations. An LDAP configuration defines settings for MongoDB Cloud to connect to your LDAP server over TLS for user authentication and authorization. Your LDAP server must be visible to the internet or connected to your MongoDB Cloud cluster with VPC Peering. Also, your LDAP server must use TLS. You must have the MongoDB Cloud admin user privilege to use these endpoints. Also, to configure user authentication and authorization with LDAPS, your cluster must run MongoDB 3.6 or higher. Groups for which you have configured LDAPS can't create a cluster using a version of MongoDB 3.6 or lower. + name: LDAP Configuration + - description: Manages Legacy Backup snapshots, restore jobs, schedules and checkpoints. + name: Legacy Backup + - description: Returns, edits, and removes maintenance windows. The maintenance procedure that MongoDB Cloud performs requires at least one replica set election during the maintenance window per replica set. You can defer a scheduled maintenance event for a project up to two times. Deferred maintenance events occur during your preferred maintenance window exactly one week after the previously scheduled date and time. + name: Maintenance Windows + - description: Returns, adds, and edits MongoDB Cloud users. + name: MongoDB Cloud Users + - description: Returns database deployment monitoring and logging data. + name: Monitoring and Logs + - description: |- + Returns, adds, edits, and removes network peering containers and peering connections. + When you deploy an M10+ dedicated cluster, Atlas creates a VPC for the selected provider and region or regions if no existing VPC or VPC peering connection exists for that provider and region. Atlas assigns the VPC a Classless Inter-Domain Routing (CIDR) block. + name: Network Peering + - description: Returns, adds, edits, or removes an online archive. + name: Online Archive + - description: Returns, adds, and edits organizational units in MongoDB Cloud. + name: Organizations + - description: Returns suggested indexes and slow query data for a database deployment. Also enables or disables MongoDB Cloud-managed slow operation thresholds. To view field values in a sample query, you must have the Project Data Access Read Only role or higher. Otherwise, MongoDB Cloud returns redacted data rather than the field values. + name: Performance Advisor + - description: Returns, adds, edits, and removes private endpoint services. + name: Private Endpoint Services + - description: Returns, adds, edits, and removes access tokens to use the MongoDB Cloud API. MongoDB Cloud applies these keys to organizations. These resources can return, assign, or revoke use of these keys within a specified project. + name: Programmatic API Keys + - description: Returns, adds, edits, and removes network access limits to database deployments in Atlas. This resource replaces the whitelist resource. Atlas removed whitelists in July 2021. Update your applications to use this new resource. This resource manages a project's IP Access List and supports creating temporary Access List entries that automatically expire within a user-configurable 7-day period. + name: Project IP Access List + - description: Returns, adds, and edits collections of clusters and users in MongoDB Cloud. + name: Projects + - description: You can continually push logs from mongod, mongos, and audit logs to an AWS S3 bucket. Atlas exports logs every 5 minutes. + name: Push-Based Log Export + - description: Configure and manage Atlas Resource Policies within your organization. + name: Resource Policies + - description: Creates one index to a database deployment in a rolling manner. You can't create a rolling index on an `M0` free cluster or `M2/M5` shared cluster. + name: Rolling Index + - description: Returns details that describe the MongoDB Cloud build and the access token that requests this resource. This starts the MongoDB Cloud API. + name: Root + - description: Returns, adds, edits, and removes serverless instances. + name: Serverless Instances + - description: Returns, adds, edits, and removes private endpoints for serverless instances. To learn more, see the Atlas Administration API tab on the following tutorial. + externalDocs: + description: Set Up a Private Endpoint for a Serverless Instance Tutorial + url: https://dochub.mongodb.org/core/serverless-private-endpoint + name: Serverless Private Endpoints + - description: Endpoints for managing Service Accounts and secrets. Service Accounts are used for programmatic access to the Atlas Admin API through the OAuth 2.0 Client Credentials flow. + externalDocs: + description: Get Started with the Atlas Administration API + url: https://www.mongodb.com/docs/atlas/configure-api-access/ + name: Service Accounts + - description: Returns and adds restore jobs for shared-tier database deployments. + name: Shared-Tier Restore Jobs + - description: Returns and requests to download shared-tier database deployment snapshots. + name: Shared-Tier Snapshots + - description: Returns, adds, edits, and removes Streams Instances. This resource requires your project ID. + name: Streams + - description: Returns, adds, edits, or removes teams. + name: Teams + - description: |- + Returns, adds, edits, and removes third-party service integration configurations. MongoDB Cloud sends alerts to each third-party service that you configure. + + **IMPORTANT**: Each project can only have one configuration per integrationType. + name: Third-Party Integrations + - description: Returns, edits, and removes user-managed X.509 configurations. Also returns and generates MongoDB Cloud-managed X.509 certificates for database users. The following resources help manage database users who authenticate using X.509 certificates. You can manage these X.509 certificates or let MongoDB Cloud do it for you. If MongoDB Cloud manages your certificates, it also manages your Certificate Authority and can generate certificates for your database users. No additional X.509 configuration is required. If you manage your certificates, you must provide a Certificate Authority and generate certificates for your database users. + externalDocs: + description: Self-Managed X.509 Certificates + url: https://www.mongodb.com/docs/atlas/security-self-managed-x509/ + name: X.509 Authentication +x-externalLinks: + - label: Back to Atlas Docs + url: https://www.mongodb.com/docs/atlas/ + - label: API Changelog + url: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/changelog/ diff --git a/tools/codegen/openapi/parser.go b/tools/codegen/openapi/parser.go new file mode 100644 index 0000000000..c6908de2d3 --- /dev/null +++ b/tools/codegen/openapi/parser.go @@ -0,0 +1,58 @@ +package openapi + +import ( + "context" + "fmt" + "io" + "net/http" + "os" + "time" + + "github.com/pb33f/libopenapi" + v3 "github.com/pb33f/libopenapi/datamodel/high/v3" +) + +func ParseAtlasAdminAPI(filePath string) (*libopenapi.DocumentModel[v3.Document], error) { + atlasAPISpec, _ := os.ReadFile(filePath) + document, err := libopenapi.NewDocument(atlasAPISpec) + if err != nil { + return nil, fmt.Errorf("cannot create new document: %e", err) + } + docModel, errors := document.BuildV3Model() + if len(errors) > 0 { + for i := range errors { + fmt.Printf("error: %e\n", errors[i]) + } + return nil, fmt.Errorf("cannot create v3 model from document: %d errors reported", len(errors)) + } + + return docModel, nil +} + +func DownloadOpenAPISpec(url, specFilePath string) (err error) { + ctx, cancel := context.WithTimeout(context.Background(), time.Second*5) + defer cancel() + + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, http.NoBody) + if err != nil { + return err + } + + client := http.Client{} + res, getErr := client.Do(req) + if getErr != nil { + return getErr + } + + if res.Body != nil { + defer res.Body.Close() + } + + body, readErr := io.ReadAll(res.Body) + if readErr != nil { + return readErr + } + + err = os.WriteFile(specFilePath, body, 0o600) + return err +} diff --git a/tools/codegen/stringcase/string_case.go b/tools/codegen/stringcase/string_case.go new file mode 100644 index 0000000000..584fb10053 --- /dev/null +++ b/tools/codegen/stringcase/string_case.go @@ -0,0 +1,48 @@ +package stringcase + +import ( + "fmt" + "regexp" + "strings" + + "github.com/huandu/xstrings" +) + +var ( + camelCase = regexp.MustCompile(`([a-z])[A-Z]`) + unsupportedCharacters = regexp.MustCompile(`[^a-zA-Z0-9_]+`) +) + +type SnakeCaseString string + +func (snake SnakeCaseString) SnakeCase() string { + return string(snake) +} + +func (snake SnakeCaseString) PascalCase() string { + return xstrings.ToPascalCase(string(snake)) +} + +func (snake SnakeCaseString) CamelCase() string { + return xstrings.ToCamelCase(string(snake)) +} + +func (snake SnakeCaseString) LowerCaseNoUnderscore() string { + return strings.ReplaceAll(string(snake), "_", "") +} + +func FromCamelCase(input string) SnakeCaseString { + if input == "" { + return SnakeCaseString(input) + } + + removedUnsupported := unsupportedCharacters.ReplaceAllString(input, "") + + insertedUnderscores := camelCase.ReplaceAllStringFunc(removedUnsupported, func(s string) string { + firstChar := s[0] + restOfString := s[1:] + return fmt.Sprintf("%c_%s", firstChar, strings.ToLower(restOfString)) + }) + + return SnakeCaseString(strings.ToLower(insertedUnderscores)) +} From 4f41bf807bb7ece146fd456111759c707cc021d6 Mon Sep 17 00:00:00 2001 From: Andrea Angiolillo Date: Sat, 5 Jul 2025 22:04:11 +0100 Subject: [PATCH 2/5] go mod --- tools/codegen/go.mod | 3 +-- tools/codegen/go.sum | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/codegen/go.mod b/tools/codegen/go.mod index a7c6e81929..4737f30a8d 100644 --- a/tools/codegen/go.mod +++ b/tools/codegen/go.mod @@ -5,7 +5,6 @@ go 1.24.0 require ( github.com/getkin/kin-openapi v0.132.0 github.com/huandu/xstrings v1.5.0 - github.com/oasdiff/oasdiff v1.11.4 github.com/pb33f/libopenapi v0.23.0 github.com/stretchr/testify v1.10.0 gopkg.in/yaml.v3 v3.0.1 @@ -26,6 +25,6 @@ require ( github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/speakeasy-api/jsonpath v0.6.2 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240815153524-6ea36470d1bd // indirect - github.com/yargevad/filepathx v1.0.0 // indirect ) diff --git a/tools/codegen/go.sum b/tools/codegen/go.sum index 2595b93ad7..3148552e67 100644 --- a/tools/codegen/go.sum +++ b/tools/codegen/go.sum @@ -24,8 +24,6 @@ github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4 github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/oasdiff/oasdiff v1.11.4 h1:FgThY78WNwOhWCLIhMk7AsKoHpVZZggRpKEGfd+IOIs= -github.com/oasdiff/oasdiff v1.11.4/go.mod h1:+bDxqI7wMl30OJ97hBfHR5loUsKCctk9UZOujHl8Gtk= github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037 h1:G7ERwszslrBzRxj//JalHPu/3yz+De2J+4aLtSRlHiY= github.com/oasdiff/yaml v0.0.0-20250309154309-f31be36b4037/go.mod h1:2bpvgLBZEtENV5scfDFEtB/5+1M4hkQhDQrccEJ/qGw= github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 h1:bQx3WeLcUWy+RletIKwUIt4x3t8n2SxavmoclizMb8c= @@ -46,8 +44,6 @@ github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4d github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240815153524-6ea36470d1bd h1:dLuIF2kX9c+KknGJUdJi1Il1SDiTSK158/BB9kdgAew= github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240815153524-6ea36470d1bd/go.mod h1:DbzwytT4g/odXquuOCqroKvtxxldI4nb3nuesHF/Exo= -github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc= -github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= From 8c4cbdf42bd86a881d6371f1b03e7ec89d65fedc Mon Sep 17 00:00:00 2001 From: Andrea Angiolillo Date: Sat, 5 Jul 2025 22:38:00 +0100 Subject: [PATCH 3/5] add openapi-schema --- tools/codegen/codegen.yaml | 1692 +++++++++++------ .../codespec/api_to_provider_spec_mapper.go | 20 +- tools/codegen/codespec/model.go | 3 +- 3 files changed, 1113 insertions(+), 602 deletions(-) diff --git a/tools/codegen/codegen.yaml b/tools/codegen/codegen.yaml index aab520b1ae..15cfdde597 100644 --- a/tools/codegen/codegen.yaml +++ b/tools/codegen/codegen.yaml @@ -1,56 +1,65 @@ resources: - - name: custom_db_role_api + - name: push_based_log_export_api operations: create: + wait: + stateProperty: state + pendingStates: + - INITIATING + - BUCKET_VERIFIED + targetStates: + - ACTIVE + timeoutSeconds: 900 + minTimeoutSeconds: 60 + delaySeconds: 10 httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport read: httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport update: + wait: + stateProperty: state + pendingStates: + - INITIATING + - BUCKET_VERIFIED + targetStates: + - ACTIVE + timeoutSeconds: 900 + minTimeoutSeconds: 60 + delaySeconds: 10 httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport delete: + wait: + stateProperty: state + pendingStates: + - ACTIVE + - INITIATING + - BUCKET_VERIFIED + targetStates: + - UNCONFIGURED + - DELETED + timeoutSeconds: 900 + minTimeoutSeconds: 60 + delaySeconds: 10 httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport versionheader: application/vnd.atlas.2023-01-01+json schema: - description: Creates one custom role in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Stream Processing Owner role, or the Project Database Access Admin role. + description: Configures the project level settings for the push-based log export feature. attributes: - - listNested: + - string: default: null - nestedobject: - attributes: - - string: - default: null - description: Human-readable label that identifies the privilege action. - computedOptionalRequired: required - name: action - - listNested: - default: null - nestedobject: - attributes: - - bool: - default: null - description: Flag that indicates whether to grant the action on the cluster resource. If `true`, MongoDB Cloud ignores the **actions.resources.collection** and **actions.resources.db** parameters. - computedOptionalRequired: required - name: cluster - - string: - default: null - description: 'Human-readable label that identifies the collection on which you grant the action to one MongoDB user. If you don''t set this parameter, you grant the action to all collections in the database specified in the **actions.resources.db** parameter. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' - computedOptionalRequired: required - name: collection - - string: - default: null - description: 'Human-readable label that identifies the database on which you grant the action to one MongoDB user. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' - computedOptionalRequired: required - name: db - description: List of resources on which you grant the action. - computedOptionalRequired: optional - name: resources - description: List of the individual privilege actions that the role grants. - computedOptionalRequired: optional - name: actions + description: The name of the bucket to which the agent will send the logs to. + computedOptionalRequired: required + name: bucket_name + - string: + default: null + description: Date and time that this feature was enabled on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + computedOptionalRequired: computed + name: create_date + reqBodyUsage: 3 - string: default: null description: |- @@ -60,75 +69,74 @@ resources: computedOptionalRequired: required name: group_id reqBodyUsage: 3 - - setNested: + - string: default: null - nestedobject: - attributes: - - string: - default: null - description: Human-readable label that identifies the database on which someone grants the action to one MongoDB user. - computedOptionalRequired: required - name: db - - string: - default: null - description: Human-readable label that identifies the role inherited. Set this value to `admin` for every role except `read` or `readWrite`. - computedOptionalRequired: required - name: role - description: List of the built-in roles that this custom role inherits. - computedOptionalRequired: optional - name: inherited_roles + description: ID of the AWS IAM role that will be used to write to the S3 bucket. + computedOptionalRequired: required + name: iam_role_id - string: default: null - description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. + description: S3 directory in which vector will write to in order to store the logs. An empty string denotes the root directory. computedOptionalRequired: required - name: role_name - reqBodyUsage: 1 - openapi-schema: - content: - application/vnd.atlas.2023-01-01+json: - schema: - $ref: "#/components/schemas/UserCustomDBRole" - x-xgen-version: 2023-01-01 - description: OK - - name: database_user_api + name: prefix_path + - string: + default: null + description: Describes whether or not the feature is enabled and what status it is in. + computedOptionalRequired: computed + name: state + reqBodyUsage: 3 + openapi-schema: null + - name: stream_processor_api operations: create: + wait: + stateProperty: state + pendingStates: + - INIT + - CREATING + targetStates: + - CREATED + timeoutSeconds: 300 + minTimeoutSeconds: 10 + delaySeconds: 10 httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/databaseUsers + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor read: httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} update: + wait: + stateProperty: state + pendingStates: + - INIT + - CREATING + targetStates: + - CREATED + timeoutSeconds: 300 + minTimeoutSeconds: 10 + delaySeconds: 10 httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} delete: + wait: + stateProperty: state + pendingStates: + - INIT + - CREATING + - CREATED + - STARTED + - STOPPED + targetStates: + - DELETED + timeoutSeconds: 300 + minTimeoutSeconds: 10 + delaySeconds: 10 httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} - versionheader: application/vnd.atlas.2023-01-01+json + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} + versionheader: application/vnd.atlas.2024-05-30+json schema: - description: Creates one database user in the specified project. This MongoDB Cloud supports a maximum of 100 database users per project. If you require more than 100 database users on a project, contact Support. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Charts Admin role, Project Stream Processing Owner role, or the Project Database Access Admin role. + description: Create one Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. attributes: - - string: - default: NONE - description: Human-readable label that indicates whether the new database user authenticates with the Amazon Web Services (AWS) Identity and Access Management (IAM) credentials associated with the user or the user's role. - computedOptionalRequired: computed_optional - name: aws_iamtype - - string: - default: admin - description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. - computedOptionalRequired: computed_optional - name: database_name - - string: - default: null - description: Date and time when MongoDB Cloud deletes the user. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. You must specify a future date that falls within one week of making the Application Programming Interface (API) request. - computedOptionalRequired: optional - name: delete_after_date - - string: - default: null - description: Description of this database user. - computedOptionalRequired: optional - name: description - reqBodyUsage: 2 - string: default: null description: |- @@ -137,114 +145,296 @@ resources: **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. computedOptionalRequired: required name: group_id - - listNested: + reqBodyUsage: 3 + - string: + default: null + description: Human-readable name of the stream processor. + computedOptionalRequired: optional + name: name + - singleNested: default: null nestedobject: attributes: - - string: + - singleNested: default: null - description: Key applied to tag and categorize this component. + nestedobject: + attributes: + - string: + default: null + description: Name of the collection to use for the DLQ. + computedOptionalRequired: optional + name: coll + - string: + default: null + description: Name of the connection to write DLQ messages to. Must be an Atlas connection. + computedOptionalRequired: optional + name: connection_name + - string: + default: null + description: Name of the database to use for the DLQ. + computedOptionalRequired: optional + name: db + description: Dead letter queue for the stream processor. computedOptionalRequired: optional - name: key - - string: + name: dlq + - bool: default: null - description: Value set to the Key applied to tag and categorize this component. + description: When true, the modified stream processor resumes from its last checkpoint. computedOptionalRequired: optional - name: value - description: List that contains the key-value pairs for tagging and categorizing the MongoDB database user. The labels that you define do not appear in the console. + name: resume_from_checkpoint + description: Optional configuration for the stream processor. + computedOptionalRequired: computed_optional + name: options + - list: + default: null + elementtype: 5 + description: Stream aggregation pipeline you want to apply to your streaming data. computedOptionalRequired: optional - name: labels + name: pipeline - string: - default: NONE - description: Part of the Lightweight Directory Access Protocol (LDAP) record that the database uses to authenticate this database user on the LDAP host. - computedOptionalRequired: computed_optional - name: ldap_auth_type + default: null + description: The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. + computedOptionalRequired: computed + name: state + reqBodyUsage: 3 - string: - default: NONE - description: Human-readable label that indicates whether the new database user or group authenticates with OIDC federated authentication. To create a federated authentication user, specify the value of USER in this field. To create a federated authentication group, specify the value of IDP_GROUP in this field. - computedOptionalRequired: computed_optional - name: oidc_auth_type + default: null + description: The stats associated with the stream processor. + customType: + model: jsontypes.Normalized + schema: jsontypes.NormalizedType{} + computedOptionalRequired: computed + name: stats + reqBodyUsage: 3 - string: default: null - description: Alphanumeric string that authenticates this database user against the database specified in `databaseName`. To authenticate with SCRAM-SHA, you must specify this parameter. This parameter doesn't appear in this response. + description: Human-readable label that identifies the stream instance. + computedOptionalRequired: required + name: tenant_name + reqBodyUsage: 3 + openapi-schema: + description: An atlas stream processor with optional stats. + properties: + _id: + description: Unique 24-hexadecimal character string that identifies the stream processor. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable name of the stream processor. + readOnly: true + type: string + options: + $ref: "#/components/schemas/StreamsOptions" + pipeline: + description: Stream aggregation pipeline you want to apply to your streaming data. + items: + readOnly: true + type: object + readOnly: true + type: array + state: + description: The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. + readOnly: true + type: string + stats: + description: The stats associated with the stream processor. + externalDocs: + url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/manage-stream-processor/#view-statistics-of-a-stream-processor + readOnly: true + type: object + required: + - _id + - name + - pipeline + - state + type: object + - name: auditing_api + operations: + create: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/auditLog + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/auditLog + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/auditLog + delete: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/auditLog + staticRequestBody: '{"enabled": "false"}' + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Updates the auditing configuration for the specified project. The auditing configuration defines the events that MongoDB Cloud records in the audit log. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature isn't available for `M0`, `M2`, `M5`, or serverless clusters. + attributes: + - bool: + default: false + description: 'Flag that indicates whether someone set auditing to track successful authentications. This only applies to the `"atype" : "authCheck"` audit filter. Setting this parameter to `true` degrades cluster performance.' + computedOptionalRequired: computed_optional + name: audit_authorization_success + - string: + default: null + description: JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (`\`). computedOptionalRequired: optional - name: password - sensitive: true + name: audit_filter + - string: + default: null + description: Human-readable label that displays how to configure the audit filter. + computedOptionalRequired: computed + name: configuration_type + reqBodyUsage: 3 + - bool: + default: false + description: Flag that indicates whether someone enabled database auditing for the specified project. + computedOptionalRequired: computed_optional + name: enabled + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + openapi-schema: + properties: + auditAuthorizationSuccess: + default: false + description: 'Flag that indicates whether someone set auditing to track successful authentications. This only applies to the `"atype" : "authCheck"` audit filter. Setting this parameter to `true` degrades cluster performance.' + externalDocs: + description: System Auditing Messages + url: https://docs.mongodb.com/manual/reference/audit-message/#audit-event-actions-details-and-results + type: boolean + auditFilter: + description: JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (`\`). + externalDocs: + description: Custom Auditing Filter + url: https://docs.atlas.mongodb.com/tutorial/auditing-custom-filter/ + type: string + configurationType: + description: Human-readable label that displays how to configure the audit filter. + readOnly: true + type: string + enabled: + default: false + description: Flag that indicates whether someone enabled database auditing for the specified project. + type: boolean + type: object + - name: custom_db_role_api + operations: + create: + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + delete: + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Creates one custom role in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Stream Processing Owner role, or the Project Database Access Admin role. + attributes: - listNested: default: null nestedobject: attributes: - string: default: null - description: Collection on which this role applies. - computedOptionalRequired: optional - name: collection_name - - string: - default: null - description: Database to which the user is granted access privileges. + description: Human-readable label that identifies the privilege action. computedOptionalRequired: required - name: database_name - - string: + name: action + - listNested: default: null - description: Human-readable label that identifies a group of privileges assigned to a database user. This value can either be a built-in role or a custom role. - computedOptionalRequired: required - name: role_name - description: List that provides the pairings of one role with one applicable database. + nestedobject: + attributes: + - bool: + default: null + description: Flag that indicates whether to grant the action on the cluster resource. If `true`, MongoDB Cloud ignores the **actions.resources.collection** and **actions.resources.db** parameters. + computedOptionalRequired: required + name: cluster + - string: + default: null + description: 'Human-readable label that identifies the collection on which you grant the action to one MongoDB user. If you don''t set this parameter, you grant the action to all collections in the database specified in the **actions.resources.db** parameter. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' + computedOptionalRequired: required + name: collection + - string: + default: null + description: 'Human-readable label that identifies the database on which you grant the action to one MongoDB user. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' + computedOptionalRequired: required + name: db + description: List of resources on which you grant the action. + computedOptionalRequired: optional + name: resources + description: List of the individual privilege actions that the role grants. computedOptionalRequired: optional - name: roles - - listNested: + name: actions + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - setNested: default: null nestedobject: attributes: - string: default: null - description: Human-readable label that identifies the cluster or MongoDB Atlas Data Lake that this database user can access. + description: Human-readable label that identifies the database on which someone grants the action to one MongoDB user. computedOptionalRequired: required - name: name + name: db - string: default: null - description: Category of resource that this database user can access. + description: Human-readable label that identifies the role inherited. Set this value to `admin` for every role except `read` or `readWrite`. computedOptionalRequired: required - name: type - description: List that contains clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances that this database user can access. If omitted, MongoDB Cloud grants the database user access to all the clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances in the project. + name: role + description: List of the built-in roles that this custom role inherits. computedOptionalRequired: optional - name: scopes + name: inherited_roles - string: default: null - description: | - Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: - - | Authentication Method | Parameter Needed | Parameter Value | username Format | - |---|---|---|---| - | AWS IAM | awsIAMType | ROLE | ARN | - | AWS IAM | awsIAMType | USER | ARN | - | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | - | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | - | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | + description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. computedOptionalRequired: required - name: username - - string: - default: NONE - description: |- - X.509 method that MongoDB Cloud uses to authenticate the database user. - - - For application-managed X.509, specify `MANAGED`. - - For self-managed X.509, specify `CUSTOMER`. - - Users created with the `CUSTOMER` method require a Common Name (CN) in the **username** parameter. You must create externally authenticated users on the `$external` database. - computedOptionalRequired: computed_optional - name: x509type + name: role_name + reqBodyUsage: 1 openapi-schema: - content: - application/vnd.atlas.2023-01-01+json: - schema: - $ref: "#/components/schemas/CloudDatabaseUser" - x-xgen-version: 2023-01-01 - description: OK + properties: + actions: + description: List of the individual privilege actions that the role grants. + items: + $ref: "#/components/schemas/DatabasePrivilegeAction" + type: array + inheritedRoles: + description: List of the built-in roles that this custom role inherits. + items: + $ref: "#/components/schemas/DatabaseInheritedRole" + type: array + uniqueItems: true + roleName: + description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. + type: string + required: + - roleName + type: object - name: maintenance_window_api operations: create: @@ -330,116 +520,267 @@ resources: computedOptionalRequired: computed name: time_zone_id reqBodyUsage: 3 - openapi-schema: - content: - application/vnd.atlas.2023-01-01+json: - x-xgen-version: 2023-01-01 - description: OK - - name: resource_policy_api + openapi-schema: null + - name: project_api operations: create: httpMethod: POST - path: /api/atlas/v2/orgs/{orgId}/resourcePolicies + path: /api/atlas/v2/groups read: httpMethod: GET - path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + path: /api/atlas/v2/groups/{id} update: httpMethod: PATCH - path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + path: /api/atlas/v2/groups/{id} delete: httpMethod: DELETE - path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} - versionheader: application/vnd.atlas.2024-08-05+json + path: /api/atlas/v2/groups/{id} + versionheader: application/vnd.atlas.2023-01-01+json schema: - description: Create one Atlas Resource Policy for an org. + description: Creates one project. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. To use this resource, the requesting Service Account or API Key must have the Read Write role. attributes: - - singleNested: + - int64: default: null - nestedobject: - attributes: - - string: - default: null - description: Unique 24-hexadecimal character string that identifies a user. - computedOptionalRequired: computed - name: id - reqBodyUsage: 3 - - string: - default: null - description: Human-readable label that describes a user. - computedOptionalRequired: computed - name: name - reqBodyUsage: 3 - description: The user that last updated the atlas resource policy. + description: Quantity of MongoDB Cloud clusters deployed in this project. computedOptionalRequired: computed - name: created_by_user + name: cluster_count reqBodyUsage: 3 - string: default: null - description: Date and time in UTC when the atlas resource policy was created. + description: Date and time when MongoDB Cloud created this project. This parameter expresses its value in the ISO 8601 timestamp format in UTC. computedOptionalRequired: computed - name: created_date + name: created reqBodyUsage: 3 - string: default: null - description: Description of the atlas resource policy. - computedOptionalRequired: optional - name: description - - string: - default: null - description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud project. computedOptionalRequired: computed name: id reqBodyUsage: 3 - - singleNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: Unique 24-hexadecimal character string that identifies a user. - computedOptionalRequired: computed - name: id - reqBodyUsage: 3 - - string: - default: null - description: Human-readable label that describes a user. - computedOptionalRequired: computed - name: name - reqBodyUsage: 3 - description: The user that last updated the atlas resource policy. - computedOptionalRequired: computed - name: last_updated_by_user - reqBodyUsage: 3 - string: default: null - description: Date and time in UTC when the atlas resource policy was last updated. - computedOptionalRequired: computed - name: last_updated_date - reqBodyUsage: 3 - - string: - default: null - description: Human-readable label that describes the atlas resource policy. + description: Human-readable label that identifies the project included in the MongoDB Cloud organization. computedOptionalRequired: required name: name - string: default: null - description: Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud organization to which the project belongs. computedOptionalRequired: required name: org_id - reqBodyUsage: 3 - - listNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. - computedOptionalRequired: required - name: body - - string: - default: null - description: Unique 24-hexadecimal character string that identifies the policy. - computedOptionalRequired: computed + reqBodyUsage: 1 + - string: + default: COMMERCIAL_FEDRAMP_REGIONS_ONLY + description: |- + Applies to Atlas for Government only. + + In Commercial Atlas, this field will be rejected in requests and missing in responses. + + This field sets restrictions on available regions in the project. + + `COMMERCIAL_FEDRAMP_REGIONS_ONLY`: Only allows deployments in FedRAMP Moderate regions. + + `GOV_REGIONS_ONLY`: Only allows deployments in GovCloud regions. + computedOptionalRequired: computed_optional + name: region_usage_restrictions + reqBodyUsage: 1 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: 'Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag.' + computedOptionalRequired: required + name: key + - string: + default: null + description: 'Variable that belongs to the set of the tag. For example, `production` in the `environment : production` tag.' + computedOptionalRequired: required + name: value + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the project. + computedOptionalRequired: optional + name: tags + - bool: + default: true + description: Flag that indicates whether to create the project with default alert settings. + computedOptionalRequired: computed_optional + name: with_default_alerts_settings + reqBodyUsage: 1 + openapi-schema: + properties: + clusterCount: + description: Quantity of MongoDB Cloud clusters deployed in this project. + format: int64 + readOnly: true + type: integer + created: + description: Date and time when MongoDB Cloud created this project. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the project included in the MongoDB Cloud organization. + pattern: ^[\p{L}\p{N}\-_.(),:&@+']{1,64}$ + type: string + orgId: + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud organization to which the project belongs. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + type: string + regionUsageRestrictions: + default: COMMERCIAL_FEDRAMP_REGIONS_ONLY + description: |- + Applies to Atlas for Government only. + + In Commercial Atlas, this field will be rejected in requests and missing in responses. + + This field sets restrictions on available regions in the project. + + `COMMERCIAL_FEDRAMP_REGIONS_ONLY`: Only allows deployments in FedRAMP Moderate regions. + + `GOV_REGIONS_ONLY`: Only allows deployments in GovCloud regions. + externalDocs: + url: https://www.mongodb.com/docs/atlas/government/overview/supported-regions/#supported-cloud-providers-and-regions + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the project. + externalDocs: + description: Resource Tags + url: https://www.mongodb.com/docs/atlas/tags + items: + $ref: "#/components/schemas/ResourceTag" + type: array + withDefaultAlertsSettings: + default: true + description: Flag that indicates whether to create the project with default alert settings. + type: boolean + writeOnly: true + required: + - clusterCount + - created + - name + - orgId + type: object + - name: resource_policy_api + operations: + create: + httpMethod: POST + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies + read: + httpMethod: GET + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + update: + httpMethod: PATCH + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + delete: + httpMethod: DELETE + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + versionheader: application/vnd.atlas.2024-08-05+json + schema: + description: Create one Atlas Resource Policy for an org. + attributes: + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Unique 24-hexadecimal character string that identifies a user. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that describes a user. + computedOptionalRequired: computed + name: name + reqBodyUsage: 3 + description: The user that last updated the atlas resource policy. + computedOptionalRequired: computed + name: created_by_user + reqBodyUsage: 3 + - string: + default: null + description: Date and time in UTC when the atlas resource policy was created. + computedOptionalRequired: computed + name: created_date + reqBodyUsage: 3 + - string: + default: null + description: Description of the atlas resource policy. + computedOptionalRequired: optional + name: description + - string: + default: null + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Unique 24-hexadecimal character string that identifies a user. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that describes a user. + computedOptionalRequired: computed + name: name + reqBodyUsage: 3 + description: The user that last updated the atlas resource policy. + computedOptionalRequired: computed + name: last_updated_by_user + reqBodyUsage: 3 + - string: + default: null + description: Date and time in UTC when the atlas resource policy was last updated. + computedOptionalRequired: computed + name: last_updated_date + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that describes the atlas resource policy. + computedOptionalRequired: required + name: name + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + computedOptionalRequired: required + name: org_id + reqBodyUsage: 3 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. + computedOptionalRequired: required + name: body + - string: + default: null + description: Unique 24-hexadecimal character string that identifies the policy. + computedOptionalRequired: computed name: id reqBodyUsage: 3 description: List of policies that make up the atlas resource policy. @@ -452,12 +793,53 @@ resources: name: version reqBodyUsage: 3 openapi-schema: - content: - application/vnd.atlas.2024-08-05+json: - schema: - $ref: "#/components/schemas/ApiAtlasResourcePolicy" - x-xgen-version: 2024-08-05 - description: Ok + properties: + createdByUser: + $ref: "#/components/schemas/ApiAtlasUserMetadata" + createdDate: + description: Date and time in UTC when the atlas resource policy was created. + format: date-time + readOnly: true + type: string + description: + description: Description of the atlas resource policy. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lastUpdatedByUser: + $ref: "#/components/schemas/ApiAtlasUserMetadata" + lastUpdatedDate: + description: Date and time in UTC when the atlas resource policy was last updated. + format: date-time + readOnly: true + type: string + name: + description: Human-readable label that describes the atlas resource policy. + readOnly: true + type: string + orgId: + description: Unique 24-hexadecimal character string that identifies the organization the atlas resource policy belongs to. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + policies: + description: List of policies that make up the atlas resource policy. + items: + $ref: "#/components/schemas/ApiAtlasPolicy" + readOnly: true + type: array + version: + description: A string that identifies the version of the atlas resource policy. + example: v1 + readOnly: true + type: string + type: object - name: search_deployment_api operations: create: @@ -561,12 +943,37 @@ resources: name: state_name reqBodyUsage: 3 openapi-schema: - content: - application/vnd.atlas.2024-05-30+json: - schema: - $ref: "#/components/schemas/ApiSearchDeploymentResponse" - x-xgen-version: 2024-05-30 - description: OK + properties: + encryptionAtRestProvider: + description: Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster. + externalDocs: + description: Encryption at Rest using Customer Key Management + url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the search deployment. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + specs: + description: List of settings that configure the Search Nodes for your cluster. The configuration will be returned for each region and shard. + items: + $ref: "#/components/schemas/ApiSearchDeploymentSpec" + readOnly: true + type: array + stateName: + description: Human-readable label that indicates the current operating condition of this search deployment. + readOnly: true + type: string + type: object - name: stream_instance_api operations: create: @@ -867,68 +1274,52 @@ resources: name: stream_config reqBodyUsage: 1 openapi-schema: - content: - application/vnd.atlas.2023-02-01+json: - schema: - $ref: "#/components/schemas/StreamsTenant" - x-xgen-version: 2023-02-01 - description: OK - - name: auditing_api - operations: - create: - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/auditLog - read: - httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/auditLog - update: - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/auditLog - delete: - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/auditLog - staticRequestBody: '{"enabled": "false"}' - versionheader: application/vnd.atlas.2023-01-01+json - schema: - description: Updates the auditing configuration for the specified project. The auditing configuration defines the events that MongoDB Cloud records in the audit log. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature isn't available for `M0`, `M2`, `M5`, or serverless clusters. - attributes: - - bool: - default: false - description: 'Flag that indicates whether someone set auditing to track successful authentications. This only applies to the `"atype" : "authCheck"` audit filter. Setting this parameter to `true` degrades cluster performance.' - computedOptionalRequired: computed_optional - name: audit_authorization_success - - string: - default: null - description: JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (`\`). - computedOptionalRequired: optional - name: audit_filter - - string: - default: null - description: Human-readable label that displays how to configure the audit filter. - computedOptionalRequired: computed - name: configuration_type - reqBodyUsage: 3 - - bool: - default: false - description: Flag that indicates whether someone enabled database auditing for the specified project. - computedOptionalRequired: computed_optional - name: enabled - - string: - default: null - description: |- - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - computedOptionalRequired: required - name: group_id - reqBodyUsage: 3 - openapi-schema: - content: - application/vnd.atlas.2023-01-01+json: - schema: - $ref: "#/components/schemas/AuditLog" - x-xgen-version: 2023-01-01 - description: OK + properties: + _id: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + connections: + description: List of connections configured in the stream instance. + items: + $ref: "#/components/schemas/StreamsConnection" + readOnly: true + type: array + dataProcessRegion: + $ref: "#/components/schemas/StreamsDataProcessRegion" + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + hostnames: + description: List that contains the hostnames assigned to the stream instance. + items: + description: Unique hostname assigned to the stream instance. + readOnly: true + type: string + readOnly: true + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the stream instance. + type: string + sampleConnections: + $ref: "#/components/schemas/StreamsSampleConnections" + streamConfig: + $ref: "#/components/schemas/StreamConfig" + type: object - name: cluster_api operations: create: @@ -1657,325 +2048,444 @@ resources: computedOptionalRequired: computed_optional name: version_release_system openapi-schema: - content: - application/vnd.atlas.2024-10-23+json: - schema: - $ref: "#/components/schemas/ClusterDescription20240805" - x-xgen-version: 2024-10-23 - description: OK - - name: project_api + properties: + acceptDataRisksAndForceReplicaSetReconfig: + description: If reconfiguration is necessary to regain a primary due to a regional outage, submit this field alongside your topology reconfiguration to request a new regional outage resistant topology. Forced reconfigurations during an outage of the majority of electable nodes carry a risk of data loss if replicated writes (even majority committed writes) have not been replicated to the new primary node. MongoDB Atlas docs contain more information. To proceed with an operation which carries that risk, set **acceptDataRisksAndForceReplicaSetReconfig** to the current date. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + externalDocs: + description: Reconfiguring a Replica Set during a regional outage + url: https://dochub.mongodb.org/core/regional-outage-reconfigure-replica-set + format: date-time + type: string + advancedConfiguration: + $ref: "#/components/schemas/ApiAtlasClusterAdvancedConfiguration" + backupEnabled: + default: false + description: Flag that indicates whether the cluster can perform backups. If set to `true`, the cluster can perform backups. You must set this value to `true` for NVMe clusters. Backup uses Cloud Backups for dedicated clusters and [Shared Cluster Backups](https://docs.atlas.mongodb.com/backup/shared-tier/overview/) for tenant clusters. If set to `false`, the cluster doesn't use backups. + externalDocs: + description: Cloud Backups + url: https://docs.atlas.mongodb.com/backup/cloud-backup/overview/ + type: boolean + biConnector: + $ref: "#/components/schemas/BiConnector" + clusterType: + description: Configuration of nodes that comprise the cluster. + type: string + configServerManagementMode: + default: ATLAS_MANAGED + description: |- + Config Server Management Mode for creating or updating a sharded cluster. + + When configured as ATLAS_MANAGED, atlas may automatically switch the cluster's config server type for optimal performance and savings. + + When configured as FIXED_TO_DEDICATED, the cluster will always use a dedicated config server. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + type: string + configServerType: + description: Describes a sharded cluster's config server type. + externalDocs: + description: MongoDB Sharded Cluster Config Servers + url: https://dochub.mongodb.org/docs/manual/core/sharded-cluster-config-servers + readOnly: true + type: string + connectionStrings: + $ref: "#/components/schemas/ClusterConnectionStrings" + createDate: + description: Date and time when MongoDB Cloud created this cluster. This parameter expresses its value in ISO 8601 format in UTC. + format: date-time + readOnly: true + type: string + diskWarmingMode: + default: FULLY_WARMED + description: Disk warming mode selection. + externalDocs: + description: Reduce Secondary Disk Warming Impact + url: https://docs.atlas.mongodb.com/reference/replica-set-tags/#reduce-secondary-disk-warming-impact + type: string + encryptionAtRestProvider: + description: 'Cloud service provider that manages your customer keys to provide an additional layer of encryption at rest for the cluster. To enable customer key management for encryption at rest, the cluster **replicationSpecs[n].regionConfigs[m].{type}Specs.instanceSize** setting must be `M10` or higher and `"backupEnabled" : false` or omitted entirely.' + externalDocs: + description: Encryption at Rest using Customer Key Management + url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ + type: string + featureCompatibilityVersion: + description: Feature compatibility version of the cluster. This will always appear regardless of whether FCV is pinned. + readOnly: true + type: string + featureCompatibilityVersionExpirationDate: + description: Feature compatibility version expiration date. Will only appear if FCV is pinned. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + format: date-time + readOnly: true + type: string + globalClusterSelfManagedSharding: + description: |- + Set this field to configure the Sharding Management Mode when creating a new Global Cluster. + + When set to false, the management mode is set to Atlas-Managed Sharding. This mode fully manages the sharding of your Global Cluster and is built to provide a seamless deployment experience. + + When set to true, the management mode is set to Self-Managed Sharding. This mode leaves the management of shards in your hands and is built to provide an advanced and flexible deployment experience. + + This setting cannot be changed once the cluster is deployed. + externalDocs: + description: Creating a Global Cluster + url: https://dochub.mongodb.org/core/global-cluster-management + type: boolean + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the cluster. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + labels: + deprecated: true + description: |- + Collection of key-value pairs between 1 to 255 characters in length that tag and categorize the cluster. The MongoDB Cloud console doesn't display your labels. + + Cluster labels are deprecated and will be removed in a future release. We strongly recommend that you use Resource Tags instead. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ComponentLabel" + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + mongoDBEmployeeAccessGrant: + $ref: "#/components/schemas/EmployeeAccessGrant" + mongoDBMajorVersion: + description: "MongoDB major version of the cluster. Set to the binary major version. \n\nOn creation: Choose from the available versions of MongoDB, or leave unspecified for the current recommended default in the MongoDB Cloud platform. The recommended version is a recent Long Term Support version. The default is not guaranteed to be the most recently released version throughout the entire release cycle. For versions available in a specific project, see the linked documentation or use the API endpoint for [project LTS versions endpoint](#tag/Projects/operation/getProjectLtsVersions).\n\n On update: Increase version only by 1 major version at a time. If the cluster is pinned to a MongoDB feature compatibility version exactly one major version below the current MongoDB version, the MongoDB version can be downgraded to the previous major version." + externalDocs: + description: Available MongoDB Versions in Atlas + url: https://www.mongodb.com/docs/atlas/reference/faq/database/#which-versions-of-mongodb-do-service-clusters-use- + type: string + mongoDBVersion: + description: Version of MongoDB that the cluster runs. + pattern: ([\d]+\.[\d]+\.[\d]+) + readOnly: true + type: string + name: + description: Human-readable label that identifies the cluster. + pattern: ^[a-zA-Z0-9][a-zA-Z0-9-]*$ + type: string + paused: + description: Flag that indicates whether the cluster is paused. + type: boolean + pitEnabled: + description: Flag that indicates whether the cluster uses continuous cloud backups. + externalDocs: + description: Continuous Cloud Backups + url: https://docs.atlas.mongodb.com/backup/cloud-backup/overview/ + type: boolean + redactClientLogData: + description: |- + Enable or disable log redaction. + + This setting configures the ``mongod`` or ``mongos`` to redact any document field contents from a message accompanying a given log event before logging. This prevents the program from writing potentially sensitive data stored on the database to the diagnostic log. Metadata such as error or operation codes, line numbers, and source file names are still visible in the logs. + + Use ``redactClientLogData`` in conjunction with Encryption at Rest and TLS/SSL (Transport Encryption) to assist compliance with regulatory requirements. + + *Note*: changing this setting on a cluster will trigger a rolling restart as soon as the cluster is updated. + externalDocs: + description: Log Redaction + url: https://www.mongodb.com/docs/manual/administration/monitoring/#log-redaction + type: boolean + replicaSetScalingStrategy: + default: WORKLOAD_TYPE + description: |- + Set this field to configure the replica set scaling mode for your cluster. + + By default, Atlas scales under WORKLOAD_TYPE. This mode allows Atlas to scale your analytics nodes in parallel to your operational nodes. + + When configured as SEQUENTIAL, Atlas scales all nodes sequentially. This mode is intended for steady-state workloads and applications performing latency-sensitive secondary reads. + + When configured as NODE_TYPE, Atlas scales your electable nodes in parallel with your read-only and analytics nodes. This mode is intended for large, dynamic workloads requiring frequent and timely cluster tier scaling. This is the fastest scaling strategy, but it might impact latency of workloads when performing extensive secondary reads. + externalDocs: + description: Modify the Replica Set Scaling Mode + url: https://dochub.mongodb.org/core/scale-nodes + type: string + replicationSpecs: + description: List of settings that configure your cluster regions. This array has one object per shard representing node configurations in each shard. For replica sets there is only one object representing node configurations. + items: + $ref: "#/components/schemas/ReplicationSpec20240805" + type: array + rootCertType: + default: ISRGROOTX1 + description: Root Certificate Authority that MongoDB Atlas cluster uses. MongoDB Cloud supports Internet Security Research Group. + type: string + stateName: + description: Human-readable label that indicates the current operating condition of this cluster. + readOnly: true + type: string + tags: + description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. + externalDocs: + description: Resource Tags + url: https://dochub.mongodb.org/core/add-cluster-tag-atlas + items: + $ref: "#/components/schemas/ResourceTag" + type: array + terminationProtectionEnabled: + default: false + description: Flag that indicates whether termination protection is enabled on the cluster. If set to `true`, MongoDB Cloud won't delete the cluster. If set to `false`, MongoDB Cloud will delete the cluster. + type: boolean + versionReleaseSystem: + default: LTS + description: Method by which the cluster maintains the MongoDB versions. If value is `CONTINUOUS`, you must not specify **mongoDBMajorVersion**. + type: string + type: object + - name: database_user_api operations: create: httpMethod: POST - path: /api/atlas/v2/groups + path: /api/atlas/v2/groups/{groupId}/databaseUsers read: httpMethod: GET - path: /api/atlas/v2/groups/{id} + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} update: httpMethod: PATCH - path: /api/atlas/v2/groups/{id} + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} delete: httpMethod: DELETE - path: /api/atlas/v2/groups/{id} + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} versionheader: application/vnd.atlas.2023-01-01+json schema: - description: Creates one project. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. To use this resource, the requesting Service Account or API Key must have the Read Write role. + description: Creates one database user in the specified project. This MongoDB Cloud supports a maximum of 100 database users per project. If you require more than 100 database users on a project, contact Support. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Charts Admin role, Project Stream Processing Owner role, or the Project Database Access Admin role. attributes: - - int64: - default: null - description: Quantity of MongoDB Cloud clusters deployed in this project. - computedOptionalRequired: computed - name: cluster_count - reqBodyUsage: 3 - string: - default: null - description: Date and time when MongoDB Cloud created this project. This parameter expresses its value in the ISO 8601 timestamp format in UTC. - computedOptionalRequired: computed - name: created - reqBodyUsage: 3 + default: NONE + description: Human-readable label that indicates whether the new database user authenticates with the Amazon Web Services (AWS) Identity and Access Management (IAM) credentials associated with the user or the user's role. + computedOptionalRequired: computed_optional + name: aws_iamtype - string: - default: null - description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud project. - computedOptionalRequired: computed - name: id - reqBodyUsage: 3 + default: admin + description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. + computedOptionalRequired: computed_optional + name: database_name - string: default: null - description: Human-readable label that identifies the project included in the MongoDB Cloud organization. - computedOptionalRequired: required - name: name + description: Date and time when MongoDB Cloud deletes the user. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. You must specify a future date that falls within one week of making the Application Programming Interface (API) request. + computedOptionalRequired: optional + name: delete_after_date - string: default: null - description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud organization to which the project belongs. - computedOptionalRequired: required - name: org_id - reqBodyUsage: 1 + description: Description of this database user. + computedOptionalRequired: optional + name: description + reqBodyUsage: 2 - string: - default: COMMERCIAL_FEDRAMP_REGIONS_ONLY + default: null description: |- - Applies to Atlas for Government only. - - In Commercial Atlas, this field will be rejected in requests and missing in responses. - - This field sets restrictions on available regions in the project. - - `COMMERCIAL_FEDRAMP_REGIONS_ONLY`: Only allows deployments in FedRAMP Moderate regions. + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - `GOV_REGIONS_ONLY`: Only allows deployments in GovCloud regions. - computedOptionalRequired: computed_optional - name: region_usage_restrictions - reqBodyUsage: 1 + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id - listNested: default: null nestedobject: attributes: - string: default: null - description: 'Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag.' - computedOptionalRequired: required + description: Key applied to tag and categorize this component. + computedOptionalRequired: optional name: key - string: default: null - description: 'Variable that belongs to the set of the tag. For example, `production` in the `environment : production` tag.' - computedOptionalRequired: required + description: Value set to the Key applied to tag and categorize this component. + computedOptionalRequired: optional name: value - description: List that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the project. + description: List that contains the key-value pairs for tagging and categorizing the MongoDB database user. The labels that you define do not appear in the console. computedOptionalRequired: optional - name: tags - - bool: - default: true - description: Flag that indicates whether to create the project with default alert settings. - computedOptionalRequired: computed_optional - name: with_default_alerts_settings - reqBodyUsage: 1 - openapi-schema: - content: - application/vnd.atlas.2023-01-01+json: - schema: - $ref: "#/components/schemas/Group" - x-xgen-version: 2023-01-01 - description: OK - - name: push_based_log_export_api - operations: - create: - wait: - stateProperty: state - pendingStates: - - INITIATING - - BUCKET_VERIFIED - targetStates: - - ACTIVE - timeoutSeconds: 900 - minTimeoutSeconds: 60 - delaySeconds: 10 - httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport - read: - httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport - update: - wait: - stateProperty: state - pendingStates: - - INITIATING - - BUCKET_VERIFIED - targetStates: - - ACTIVE - timeoutSeconds: 900 - minTimeoutSeconds: 60 - delaySeconds: 10 - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport - delete: - wait: - stateProperty: state - pendingStates: - - ACTIVE - - INITIATING - - BUCKET_VERIFIED - targetStates: - - UNCONFIGURED - - DELETED - timeoutSeconds: 900 - minTimeoutSeconds: 60 - delaySeconds: 10 - httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport - versionheader: application/vnd.atlas.2023-01-01+json - schema: - description: Configures the project level settings for the push-based log export feature. - attributes: - - string: - default: null - description: The name of the bucket to which the agent will send the logs to. - computedOptionalRequired: required - name: bucket_name - - string: - default: null - description: Date and time that this feature was enabled on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. - computedOptionalRequired: computed - name: create_date - reqBodyUsage: 3 - - string: - default: null - description: |- - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - computedOptionalRequired: required - name: group_id - reqBodyUsage: 3 - - string: - default: null - description: ID of the AWS IAM role that will be used to write to the S3 bucket. - computedOptionalRequired: required - name: iam_role_id - - string: - default: null - description: S3 directory in which vector will write to in order to store the logs. An empty string denotes the root directory. - computedOptionalRequired: required - name: prefix_path + name: labels - string: - default: null - description: Describes whether or not the feature is enabled and what status it is in. - computedOptionalRequired: computed - name: state - reqBodyUsage: 3 - openapi-schema: - content: - application/vnd.atlas.2023-01-01+json: - x-xgen-version: 2023-01-01 - description: OK - - name: stream_processor_api - operations: - create: - wait: - stateProperty: state - pendingStates: - - INIT - - CREATING - targetStates: - - CREATED - timeoutSeconds: 300 - minTimeoutSeconds: 10 - delaySeconds: 10 - httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor - read: - httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} - update: - wait: - stateProperty: state - pendingStates: - - INIT - - CREATING - targetStates: - - CREATED - timeoutSeconds: 300 - minTimeoutSeconds: 10 - delaySeconds: 10 - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} - delete: - wait: - stateProperty: state - pendingStates: - - INIT - - CREATING - - CREATED - - STARTED - - STOPPED - targetStates: - - DELETED - timeoutSeconds: 300 - minTimeoutSeconds: 10 - delaySeconds: 10 - httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} - versionheader: application/vnd.atlas.2024-05-30+json - schema: - description: Create one Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. - attributes: + default: NONE + description: Part of the Lightweight Directory Access Protocol (LDAP) record that the database uses to authenticate this database user on the LDAP host. + computedOptionalRequired: computed_optional + name: ldap_auth_type - string: - default: null - description: |- - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - computedOptionalRequired: required - name: group_id - reqBodyUsage: 3 + default: NONE + description: Human-readable label that indicates whether the new database user or group authenticates with OIDC federated authentication. To create a federated authentication user, specify the value of USER in this field. To create a federated authentication group, specify the value of IDP_GROUP in this field. + computedOptionalRequired: computed_optional + name: oidc_auth_type - string: default: null - description: Human-readable name of the stream processor. + description: Alphanumeric string that authenticates this database user against the database specified in `databaseName`. To authenticate with SCRAM-SHA, you must specify this parameter. This parameter doesn't appear in this response. computedOptionalRequired: optional - name: name - - singleNested: + name: password + sensitive: true + - listNested: default: null nestedobject: attributes: - - singleNested: + - string: default: null - nestedobject: - attributes: - - string: - default: null - description: Name of the collection to use for the DLQ. - computedOptionalRequired: optional - name: coll - - string: - default: null - description: Name of the connection to write DLQ messages to. Must be an Atlas connection. - computedOptionalRequired: optional - name: connection_name - - string: - default: null - description: Name of the database to use for the DLQ. - computedOptionalRequired: optional - name: db - description: Dead letter queue for the stream processor. + description: Collection on which this role applies. computedOptionalRequired: optional - name: dlq - - bool: + name: collection_name + - string: default: null - description: When true, the modified stream processor resumes from its last checkpoint. - computedOptionalRequired: optional - name: resume_from_checkpoint - description: Optional configuration for the stream processor. - computedOptionalRequired: computed_optional - name: options - - list: - default: null - elementtype: 5 - description: Stream aggregation pipeline you want to apply to your streaming data. + description: Database to which the user is granted access privileges. + computedOptionalRequired: required + name: database_name + - string: + default: null + description: Human-readable label that identifies a group of privileges assigned to a database user. This value can either be a built-in role or a custom role. + computedOptionalRequired: required + name: role_name + description: List that provides the pairings of one role with one applicable database. computedOptionalRequired: optional - name: pipeline - - string: - default: null - description: The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. - computedOptionalRequired: computed - name: state - reqBodyUsage: 3 - - string: + name: roles + - listNested: default: null - description: The stats associated with the stream processor. - customType: - model: jsontypes.Normalized - schema: jsontypes.NormalizedType{} - computedOptionalRequired: computed - name: stats - reqBodyUsage: 3 + nestedobject: + attributes: + - string: + default: null + description: Human-readable label that identifies the cluster or MongoDB Atlas Data Lake that this database user can access. + computedOptionalRequired: required + name: name + - string: + default: null + description: Category of resource that this database user can access. + computedOptionalRequired: required + name: type + description: List that contains clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances that this database user can access. If omitted, MongoDB Cloud grants the database user access to all the clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances in the project. + computedOptionalRequired: optional + name: scopes - string: default: null - description: Human-readable label that identifies the stream instance. + description: | + Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: + + | Authentication Method | Parameter Needed | Parameter Value | username Format | + |---|---|---|---| + | AWS IAM | awsIAMType | ROLE | ARN | + | AWS IAM | awsIAMType | USER | ARN | + | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | + | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | + | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | computedOptionalRequired: required - name: tenant_name - reqBodyUsage: 3 + name: username + - string: + default: NONE + description: |- + X.509 method that MongoDB Cloud uses to authenticate the database user. + + - For application-managed X.509, specify `MANAGED`. + - For self-managed X.509, specify `CUSTOMER`. + + Users created with the `CUSTOMER` method require a Common Name (CN) in the **username** parameter. You must create externally authenticated users on the `$external` database. + computedOptionalRequired: computed_optional + name: x509type openapi-schema: - content: - application/vnd.atlas.2024-05-30+json: - schema: - $ref: "#/components/schemas/StreamsProcessorWithStats" - x-xgen-version: 2024-05-30 - description: OK + properties: + awsIAMType: + default: NONE + description: Human-readable label that indicates whether the new database user authenticates with the Amazon Web Services (AWS) Identity and Access Management (IAM) credentials associated with the user or the user's role. + type: string + databaseName: + default: admin + description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. + type: string + deleteAfterDate: + description: Date and time when MongoDB Cloud deletes the user. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. You must specify a future date that falls within one week of making the Application Programming Interface (API) request. + format: date-time + type: string + description: + description: Description of this database user. + maxLength: 100 + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. + type: string + writeOnly: true + labels: + description: List that contains the key-value pairs for tagging and categorizing the MongoDB database user. The labels that you define do not appear in the console. + items: + $ref: "#/components/schemas/ComponentLabel" + type: array + ldapAuthType: + default: NONE + description: Part of the Lightweight Directory Access Protocol (LDAP) record that the database uses to authenticate this database user on the LDAP host. + type: string + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + oidcAuthType: + default: NONE + description: Human-readable label that indicates whether the new database user or group authenticates with OIDC federated authentication. To create a federated authentication user, specify the value of USER in this field. To create a federated authentication group, specify the value of IDP_GROUP in this field. + type: string + password: + description: Alphanumeric string that authenticates this database user against the database specified in `databaseName`. To authenticate with SCRAM-SHA, you must specify this parameter. This parameter doesn't appear in this response. + externalDocs: + description: SCRAM-SHA + url: https://docs.mongodb.com/manual/core/security-scram/ + minLength: 8 + type: string + writeOnly: true + roles: + description: List that provides the pairings of one role with one applicable database. + items: + $ref: "#/components/schemas/DatabaseUserRole" + type: array + scopes: + description: List that contains clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances that this database user can access. If omitted, MongoDB Cloud grants the database user access to all the clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances in the project. + items: + $ref: "#/components/schemas/UserScope" + type: array + username: + description: | + Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: + + | Authentication Method | Parameter Needed | Parameter Value | username Format | + |---|---|---|---| + | AWS IAM | awsIAMType | ROLE | ARN | + | AWS IAM | awsIAMType | USER | ARN | + | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | + | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | + | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | + maxLength: 1024 + type: string + x509Type: + default: NONE + description: |- + X.509 method that MongoDB Cloud uses to authenticate the database user. + + - For application-managed X.509, specify `MANAGED`. + - For self-managed X.509, specify `CUSTOMER`. + + Users created with the `CUSTOMER` method require a Common Name (CN) in the **username** parameter. You must create externally authenticated users on the `$external` database. + type: string + required: + - databaseName + - groupId + - username + type: object diff --git a/tools/codegen/codespec/api_to_provider_spec_mapper.go b/tools/codegen/codespec/api_to_provider_spec_mapper.go index 67f1209f17..d271304660 100644 --- a/tools/codegen/codespec/api_to_provider_spec_mapper.go +++ b/tools/codegen/codespec/api_to_provider_spec_mapper.go @@ -4,6 +4,8 @@ import ( "errors" "fmt" "github.com/getkin/kin-openapi/openapi3" + "github.com/pb33f/libopenapi" + "github.com/pb33f/libopenapi/datamodel/high/base" "log" "strings" @@ -14,6 +16,7 @@ import ( "github.com/mongodb/openapi/tools/codegen/config" "github.com/mongodb/openapi/tools/codegen/openapi" "github.com/mongodb/openapi/tools/codegen/stringcase" + v3 "github.com/pb33f/libopenapi/datamodel/high/v3" ) func ToCodeSpecModel(atlasAdminAPISpecFilePath, configPath string, resourceName *string) (*Model, error) { @@ -43,13 +46,13 @@ func ToCodeSpecModel(atlasAdminAPISpecFilePath, configPath string, resourceName return nil, fmt.Errorf("unable to get APISpecResource schema: %v", err) } // map OAS resource model to CodeSpecModel - results = append(results, *apiSpecResourceToCodeSpecModel(oasResource, &resourceConfig, stringcase.SnakeCaseString(name))) + results = append(results, *apiSpecResourceToCodeSpecModel(apiSpec, oasResource, &resourceConfig, stringcase.SnakeCaseString(name))) } return &Model{Resources: results}, nil } -func apiSpecResourceToCodeSpecModel(oasResource APISpecResource, resourceConfig *config.Resource, name stringcase.SnakeCaseString) *Resource { +func apiSpecResourceToCodeSpecModel(spec *libopenapi.DocumentModel[v3.Document], oasResource APISpecResource, resourceConfig *config.Resource, name stringcase.SnakeCaseString) *Resource { createOp := oasResource.CreateOp updateOp := oasResource.UpdateOp readOp := oasResource.ReadOp @@ -82,7 +85,7 @@ func apiSpecResourceToCodeSpecModel(oasResource APISpecResource, resourceConfig resource := &Resource{ Name: name, Schema: schema, - OpenApiSchema: findSuccessfulResponse(&oasResource), + OpenApiSchema: findSuccessfulResponse(spec, &oasResource), Operations: operations, } @@ -91,7 +94,7 @@ func apiSpecResourceToCodeSpecModel(oasResource APISpecResource, resourceConfig return resource } -func findSuccessfulResponse(oasResource *APISpecResource) any { +func findSuccessfulResponse(spec *libopenapi.DocumentModel[v3.Document], oasResource *APISpecResource) *base.Schema { if oasResource.UpdateOp == nil { return nil } @@ -101,12 +104,9 @@ func findSuccessfulResponse(oasResource *APISpecResource) any { for _, successCode := range successFulResponses { response := oasResource.UpdateOp.Responses.FindResponseByCode(successCode) if response != nil { - if response.GoLow().IsReference() { - // Use the document's index to find the referenced response. - return "" - } - // If it's not a reference, it's an inline response. - return response + //lowResponse := response.GoLow() + // If it's not a reference, return the inline response + return response.Content.Newest().Value.Schema.Schema() } } return nil diff --git a/tools/codegen/codespec/model.go b/tools/codegen/codespec/model.go index bc06900dc0..c67d810488 100644 --- a/tools/codegen/codespec/model.go +++ b/tools/codegen/codespec/model.go @@ -2,6 +2,7 @@ package codespec import ( "github.com/mongodb/openapi/tools/codegen/stringcase" + "github.com/pb33f/libopenapi/datamodel/high/base" ) type ElemType int @@ -24,7 +25,7 @@ type Resource struct { Name stringcase.SnakeCaseString `yaml:",omitempty"` Operations APIOperations `yaml:"operations"` Schema *Schema `yaml:"schema"` - OpenApiSchema any `yaml:"openapi-schema"` + OpenApiSchema *base.Schema `yaml:"openapi-schema"` } type APIOperations struct { From bea4fcb0e7ee043f827aab9fff82f28ad27e4314 Mon Sep 17 00:00:00 2001 From: Andrea Angiolillo Date: Sat, 5 Jul 2025 22:42:04 +0100 Subject: [PATCH 4/5] fix --- tools/codegen/codegen.yaml | 2466 ++++++++--------- .../codespec/api_to_provider_spec_mapper.go | 23 +- 2 files changed, 1247 insertions(+), 1242 deletions(-) diff --git a/tools/codegen/codegen.yaml b/tools/codegen/codegen.yaml index 15cfdde597..c7d86e5e21 100644 --- a/tools/codegen/codegen.yaml +++ b/tools/codegen/codegen.yaml @@ -1,65 +1,43 @@ resources: - - name: push_based_log_export_api + - name: database_user_api operations: create: - wait: - stateProperty: state - pendingStates: - - INITIATING - - BUCKET_VERIFIED - targetStates: - - ACTIVE - timeoutSeconds: 900 - minTimeoutSeconds: 60 - delaySeconds: 10 httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + path: /api/atlas/v2/groups/{groupId}/databaseUsers read: httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} update: - wait: - stateProperty: state - pendingStates: - - INITIATING - - BUCKET_VERIFIED - targetStates: - - ACTIVE - timeoutSeconds: 900 - minTimeoutSeconds: 60 - delaySeconds: 10 httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} delete: - wait: - stateProperty: state - pendingStates: - - ACTIVE - - INITIATING - - BUCKET_VERIFIED - targetStates: - - UNCONFIGURED - - DELETED - timeoutSeconds: 900 - minTimeoutSeconds: 60 - delaySeconds: 10 httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} versionheader: application/vnd.atlas.2023-01-01+json schema: - description: Configures the project level settings for the push-based log export feature. + description: Creates one database user in the specified project. This MongoDB Cloud supports a maximum of 100 database users per project. If you require more than 100 database users on a project, contact Support. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Charts Admin role, Project Stream Processing Owner role, or the Project Database Access Admin role. attributes: + - string: + default: NONE + description: Human-readable label that indicates whether the new database user authenticates with the Amazon Web Services (AWS) Identity and Access Management (IAM) credentials associated with the user or the user's role. + computedOptionalRequired: computed_optional + name: aws_iamtype + - string: + default: admin + description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. + computedOptionalRequired: computed_optional + name: database_name - string: default: null - description: The name of the bucket to which the agent will send the logs to. - computedOptionalRequired: required - name: bucket_name + description: Date and time when MongoDB Cloud deletes the user. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. You must specify a future date that falls within one week of making the Application Programming Interface (API) request. + computedOptionalRequired: optional + name: delete_after_date - string: default: null - description: Date and time that this feature was enabled on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. - computedOptionalRequired: computed - name: create_date - reqBodyUsage: 3 + description: Description of this database user. + computedOptionalRequired: optional + name: description + reqBodyUsage: 2 - string: default: null description: |- @@ -68,158 +46,137 @@ resources: **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. computedOptionalRequired: required name: group_id - reqBodyUsage: 3 - - string: - default: null - description: ID of the AWS IAM role that will be used to write to the S3 bucket. - computedOptionalRequired: required - name: iam_role_id - - string: + - listNested: default: null - description: S3 directory in which vector will write to in order to store the logs. An empty string denotes the root directory. - computedOptionalRequired: required - name: prefix_path + nestedobject: + attributes: + - string: + default: null + description: Key applied to tag and categorize this component. + computedOptionalRequired: optional + name: key + - string: + default: null + description: Value set to the Key applied to tag and categorize this component. + computedOptionalRequired: optional + name: value + description: List that contains the key-value pairs for tagging and categorizing the MongoDB database user. The labels that you define do not appear in the console. + computedOptionalRequired: optional + name: labels - string: - default: null - description: Describes whether or not the feature is enabled and what status it is in. - computedOptionalRequired: computed - name: state - reqBodyUsage: 3 - openapi-schema: null - - name: stream_processor_api - operations: - create: - wait: - stateProperty: state - pendingStates: - - INIT - - CREATING - targetStates: - - CREATED - timeoutSeconds: 300 - minTimeoutSeconds: 10 - delaySeconds: 10 - httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor - read: - httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} - update: - wait: - stateProperty: state - pendingStates: - - INIT - - CREATING - targetStates: - - CREATED - timeoutSeconds: 300 - minTimeoutSeconds: 10 - delaySeconds: 10 - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} - delete: - wait: - stateProperty: state - pendingStates: - - INIT - - CREATING - - CREATED - - STARTED - - STOPPED - targetStates: - - DELETED - timeoutSeconds: 300 - minTimeoutSeconds: 10 - delaySeconds: 10 - httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} - versionheader: application/vnd.atlas.2024-05-30+json - schema: - description: Create one Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. - attributes: + default: NONE + description: Part of the Lightweight Directory Access Protocol (LDAP) record that the database uses to authenticate this database user on the LDAP host. + computedOptionalRequired: computed_optional + name: ldap_auth_type - string: - default: null - description: |- - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - computedOptionalRequired: required - name: group_id - reqBodyUsage: 3 + default: NONE + description: Human-readable label that indicates whether the new database user or group authenticates with OIDC federated authentication. To create a federated authentication user, specify the value of USER in this field. To create a federated authentication group, specify the value of IDP_GROUP in this field. + computedOptionalRequired: computed_optional + name: oidc_auth_type - string: default: null - description: Human-readable name of the stream processor. + description: Alphanumeric string that authenticates this database user against the database specified in `databaseName`. To authenticate with SCRAM-SHA, you must specify this parameter. This parameter doesn't appear in this response. computedOptionalRequired: optional - name: name - - singleNested: + name: password + sensitive: true + - listNested: default: null nestedobject: attributes: - - singleNested: + - string: default: null - nestedobject: - attributes: - - string: - default: null - description: Name of the collection to use for the DLQ. - computedOptionalRequired: optional - name: coll - - string: - default: null - description: Name of the connection to write DLQ messages to. Must be an Atlas connection. - computedOptionalRequired: optional - name: connection_name - - string: - default: null - description: Name of the database to use for the DLQ. - computedOptionalRequired: optional - name: db - description: Dead letter queue for the stream processor. + description: Collection on which this role applies. computedOptionalRequired: optional - name: dlq - - bool: + name: collection_name + - string: default: null - description: When true, the modified stream processor resumes from its last checkpoint. - computedOptionalRequired: optional - name: resume_from_checkpoint - description: Optional configuration for the stream processor. - computedOptionalRequired: computed_optional - name: options - - list: + description: Database to which the user is granted access privileges. + computedOptionalRequired: required + name: database_name + - string: + default: null + description: Human-readable label that identifies a group of privileges assigned to a database user. This value can either be a built-in role or a custom role. + computedOptionalRequired: required + name: role_name + description: List that provides the pairings of one role with one applicable database. + computedOptionalRequired: optional + name: roles + - listNested: default: null - elementtype: 5 - description: Stream aggregation pipeline you want to apply to your streaming data. + nestedobject: + attributes: + - string: + default: null + description: Human-readable label that identifies the cluster or MongoDB Atlas Data Lake that this database user can access. + computedOptionalRequired: required + name: name + - string: + default: null + description: Category of resource that this database user can access. + computedOptionalRequired: required + name: type + description: List that contains clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances that this database user can access. If omitted, MongoDB Cloud grants the database user access to all the clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances in the project. computedOptionalRequired: optional - name: pipeline + name: scopes - string: default: null - description: The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. - computedOptionalRequired: computed - name: state - reqBodyUsage: 3 + description: | + Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: + + | Authentication Method | Parameter Needed | Parameter Value | username Format | + |---|---|---|---| + | AWS IAM | awsIAMType | ROLE | ARN | + | AWS IAM | awsIAMType | USER | ARN | + | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | + | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | + | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | + computedOptionalRequired: required + name: username - string: - default: null - description: The stats associated with the stream processor. - customType: - model: jsontypes.Normalized - schema: jsontypes.NormalizedType{} - computedOptionalRequired: computed - name: stats - reqBodyUsage: 3 - - string: - default: null - description: Human-readable label that identifies the stream instance. - computedOptionalRequired: required - name: tenant_name - reqBodyUsage: 3 + default: NONE + description: |- + X.509 method that MongoDB Cloud uses to authenticate the database user. + + - For application-managed X.509, specify `MANAGED`. + - For self-managed X.509, specify `CUSTOMER`. + + Users created with the `CUSTOMER` method require a Common Name (CN) in the **username** parameter. You must create externally authenticated users on the `$external` database. + computedOptionalRequired: computed_optional + name: x509type openapi-schema: - description: An atlas stream processor with optional stats. properties: - _id: - description: Unique 24-hexadecimal character string that identifies the stream processor. - example: 32b6e34b3d91647abb20e7b8 - pattern: ^([a-f0-9]{24})$ - readOnly: true + awsIAMType: + default: NONE + description: Human-readable label that indicates whether the new database user authenticates with the Amazon Web Services (AWS) Identity and Access Management (IAM) credentials associated with the user or the user's role. + type: string + databaseName: + default: admin + description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. + type: string + deleteAfterDate: + description: Date and time when MongoDB Cloud deletes the user. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. You must specify a future date that falls within one week of making the Application Programming Interface (API) request. + format: date-time + type: string + description: + description: Description of this database user. + maxLength: 100 + type: string + groupId: + description: Unique 24-hexadecimal digit string that identifies the project. + type: string + writeOnly: true + labels: + description: List that contains the key-value pairs for tagging and categorizing the MongoDB database user. The labels that you define do not appear in the console. + items: + $ref: "#/components/schemas/ComponentLabel" + type: array + ldapAuthType: + default: NONE + description: Part of the Lightweight Directory Access Protocol (LDAP) record that the database uses to authenticate this database user on the LDAP host. type: string links: description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. @@ -230,369 +187,132 @@ resources: $ref: "#/components/schemas/Link" readOnly: true type: array - name: - description: Human-readable name of the stream processor. - readOnly: true + oidcAuthType: + default: NONE + description: Human-readable label that indicates whether the new database user or group authenticates with OIDC federated authentication. To create a federated authentication user, specify the value of USER in this field. To create a federated authentication group, specify the value of IDP_GROUP in this field. type: string - options: - $ref: "#/components/schemas/StreamsOptions" - pipeline: - description: Stream aggregation pipeline you want to apply to your streaming data. + password: + description: Alphanumeric string that authenticates this database user against the database specified in `databaseName`. To authenticate with SCRAM-SHA, you must specify this parameter. This parameter doesn't appear in this response. + externalDocs: + description: SCRAM-SHA + url: https://docs.mongodb.com/manual/core/security-scram/ + minLength: 8 + type: string + writeOnly: true + roles: + description: List that provides the pairings of one role with one applicable database. items: - readOnly: true - type: object - readOnly: true + $ref: "#/components/schemas/DatabaseUserRole" type: array - state: - description: The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. - readOnly: true + scopes: + description: List that contains clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances that this database user can access. If omitted, MongoDB Cloud grants the database user access to all the clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances in the project. + items: + $ref: "#/components/schemas/UserScope" + type: array + username: + description: | + Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: + + | Authentication Method | Parameter Needed | Parameter Value | username Format | + |---|---|---|---| + | AWS IAM | awsIAMType | ROLE | ARN | + | AWS IAM | awsIAMType | USER | ARN | + | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | + | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | + | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | + | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | + maxLength: 1024 + type: string + x509Type: + default: NONE + description: |- + X.509 method that MongoDB Cloud uses to authenticate the database user. + + - For application-managed X.509, specify `MANAGED`. + - For self-managed X.509, specify `CUSTOMER`. + + Users created with the `CUSTOMER` method require a Common Name (CN) in the **username** parameter. You must create externally authenticated users on the `$external` database. type: string - stats: - description: The stats associated with the stream processor. - externalDocs: - url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/manage-stream-processor/#view-statistics-of-a-stream-processor - readOnly: true - type: object required: - - _id - - name - - pipeline - - state + - databaseName + - groupId + - username type: object - - name: auditing_api + - name: project_api operations: create: - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/auditLog + httpMethod: POST + path: /api/atlas/v2/groups read: httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/auditLog + path: /api/atlas/v2/groups/{id} update: httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/auditLog + path: /api/atlas/v2/groups/{id} delete: - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/auditLog - staticRequestBody: '{"enabled": "false"}' + httpMethod: DELETE + path: /api/atlas/v2/groups/{id} versionheader: application/vnd.atlas.2023-01-01+json schema: - description: Updates the auditing configuration for the specified project. The auditing configuration defines the events that MongoDB Cloud records in the audit log. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature isn't available for `M0`, `M2`, `M5`, or serverless clusters. + description: Creates one project. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. To use this resource, the requesting Service Account or API Key must have the Read Write role. attributes: - - bool: - default: false - description: 'Flag that indicates whether someone set auditing to track successful authentications. This only applies to the `"atype" : "authCheck"` audit filter. Setting this parameter to `true` degrades cluster performance.' - computedOptionalRequired: computed_optional - name: audit_authorization_success + - int64: + default: null + description: Quantity of MongoDB Cloud clusters deployed in this project. + computedOptionalRequired: computed + name: cluster_count + reqBodyUsage: 3 - string: default: null - description: JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (`\`). - computedOptionalRequired: optional - name: audit_filter + description: Date and time when MongoDB Cloud created this project. This parameter expresses its value in the ISO 8601 timestamp format in UTC. + computedOptionalRequired: computed + name: created + reqBodyUsage: 3 - string: default: null - description: Human-readable label that displays how to configure the audit filter. + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud project. computedOptionalRequired: computed - name: configuration_type + name: id reqBodyUsage: 3 - - bool: - default: false - description: Flag that indicates whether someone enabled database auditing for the specified project. - computedOptionalRequired: computed_optional - name: enabled - string: default: null + description: Human-readable label that identifies the project included in the MongoDB Cloud organization. + computedOptionalRequired: required + name: name + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud organization to which the project belongs. + computedOptionalRequired: required + name: org_id + reqBodyUsage: 1 + - string: + default: COMMERCIAL_FEDRAMP_REGIONS_ONLY description: |- - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + Applies to Atlas for Government only. - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - computedOptionalRequired: required - name: group_id - reqBodyUsage: 3 - openapi-schema: - properties: - auditAuthorizationSuccess: - default: false - description: 'Flag that indicates whether someone set auditing to track successful authentications. This only applies to the `"atype" : "authCheck"` audit filter. Setting this parameter to `true` degrades cluster performance.' - externalDocs: - description: System Auditing Messages - url: https://docs.mongodb.com/manual/reference/audit-message/#audit-event-actions-details-and-results - type: boolean - auditFilter: - description: JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (`\`). - externalDocs: - description: Custom Auditing Filter - url: https://docs.atlas.mongodb.com/tutorial/auditing-custom-filter/ - type: string - configurationType: - description: Human-readable label that displays how to configure the audit filter. - readOnly: true - type: string - enabled: - default: false - description: Flag that indicates whether someone enabled database auditing for the specified project. - type: boolean - type: object - - name: custom_db_role_api - operations: - create: - httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles - read: - httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} - update: - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} - delete: - httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} - versionheader: application/vnd.atlas.2023-01-01+json - schema: - description: Creates one custom role in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Stream Processing Owner role, or the Project Database Access Admin role. - attributes: + In Commercial Atlas, this field will be rejected in requests and missing in responses. + + This field sets restrictions on available regions in the project. + + `COMMERCIAL_FEDRAMP_REGIONS_ONLY`: Only allows deployments in FedRAMP Moderate regions. + + `GOV_REGIONS_ONLY`: Only allows deployments in GovCloud regions. + computedOptionalRequired: computed_optional + name: region_usage_restrictions + reqBodyUsage: 1 - listNested: default: null nestedobject: attributes: - string: default: null - description: Human-readable label that identifies the privilege action. + description: 'Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag.' computedOptionalRequired: required - name: action - - listNested: - default: null - nestedobject: - attributes: - - bool: - default: null - description: Flag that indicates whether to grant the action on the cluster resource. If `true`, MongoDB Cloud ignores the **actions.resources.collection** and **actions.resources.db** parameters. - computedOptionalRequired: required - name: cluster - - string: - default: null - description: 'Human-readable label that identifies the collection on which you grant the action to one MongoDB user. If you don''t set this parameter, you grant the action to all collections in the database specified in the **actions.resources.db** parameter. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' - computedOptionalRequired: required - name: collection - - string: - default: null - description: 'Human-readable label that identifies the database on which you grant the action to one MongoDB user. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' - computedOptionalRequired: required - name: db - description: List of resources on which you grant the action. - computedOptionalRequired: optional - name: resources - description: List of the individual privilege actions that the role grants. - computedOptionalRequired: optional - name: actions - - string: - default: null - description: |- - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - computedOptionalRequired: required - name: group_id - reqBodyUsage: 3 - - setNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: Human-readable label that identifies the database on which someone grants the action to one MongoDB user. - computedOptionalRequired: required - name: db - - string: - default: null - description: Human-readable label that identifies the role inherited. Set this value to `admin` for every role except `read` or `readWrite`. - computedOptionalRequired: required - name: role - description: List of the built-in roles that this custom role inherits. - computedOptionalRequired: optional - name: inherited_roles - - string: - default: null - description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. - computedOptionalRequired: required - name: role_name - reqBodyUsage: 1 - openapi-schema: - properties: - actions: - description: List of the individual privilege actions that the role grants. - items: - $ref: "#/components/schemas/DatabasePrivilegeAction" - type: array - inheritedRoles: - description: List of the built-in roles that this custom role inherits. - items: - $ref: "#/components/schemas/DatabaseInheritedRole" - type: array - uniqueItems: true - roleName: - description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. - type: string - required: - - roleName - type: object - - name: maintenance_window_api - operations: - create: - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/maintenanceWindow - read: - httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/maintenanceWindow - update: - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/maintenanceWindow - delete: - httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/maintenanceWindow - versionheader: application/vnd.atlas.2023-01-01+json - schema: - description: Updates the maintenance window for the specified project. Urgent maintenance activities such as security patches can't wait for your chosen window. MongoDB Cloud starts those maintenance activities when needed. After you schedule maintenance for your cluster, you can't change your maintenance window until the current maintenance efforts complete. The maintenance procedure that MongoDB Cloud performs requires at least one replica set election during the maintenance window per replica set. Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or unexpected system issues could delay the start time. Updating the maintenance window will reset any maintenance deferrals for this project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. - attributes: - - bool: - default: null - description: Flag that indicates whether MongoDB Cloud should defer all maintenance windows for one week after you enable them. - computedOptionalRequired: computed_optional - name: auto_defer_once_enabled - - int64: - default: null - description: |- - One-based integer that represents the day of the week that the maintenance window starts. - - - `1`: Sunday. - - `2`: Monday. - - `3`: Tuesday. - - `4`: Wednesday. - - `5`: Thursday. - - `6`: Friday. - - `7`: Saturday. - computedOptionalRequired: required - name: day_of_week - - string: - default: null - description: |- - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - computedOptionalRequired: required - name: group_id - reqBodyUsage: 3 - - int64: - default: null - description: Zero-based integer that represents the hour of the of the day that the maintenance window starts according to a 24-hour clock. Use `0` for midnight and `12` for noon. - computedOptionalRequired: required - name: hour_of_day - - int64: - default: null - description: Number of times the current maintenance event for this project has been deferred. - computedOptionalRequired: computed - name: number_of_deferrals - reqBodyUsage: 3 - - singleNested: - default: null - nestedobject: - attributes: - - int64: - default: null - description: Zero-based integer that represents the end hour of the of the day that the maintenance will not begin in. - computedOptionalRequired: optional - name: end_hour_of_day - - int64: - default: null - description: Zero-based integer that represents the beginning hour of the of the day that the maintenance will not begin in. - computedOptionalRequired: optional - name: start_hour_of_day - description: Defines the a window where maintenance will not begin within. - computedOptionalRequired: optional - name: protected_hours - - bool: - default: null - description: Flag that indicates whether MongoDB Cloud starts the maintenance window immediately upon receiving this request. To start the maintenance window immediately for your project, MongoDB Cloud must have maintenance scheduled and you must set a maintenance window. This flag resets to `false` after MongoDB Cloud completes maintenance. - computedOptionalRequired: optional - name: start_asap - - string: - default: null - description: Identifier for the current time zone of the maintenance window. This can only be updated via the Project Settings UI. - computedOptionalRequired: computed - name: time_zone_id - reqBodyUsage: 3 - openapi-schema: null - - name: project_api - operations: - create: - httpMethod: POST - path: /api/atlas/v2/groups - read: - httpMethod: GET - path: /api/atlas/v2/groups/{id} - update: - httpMethod: PATCH - path: /api/atlas/v2/groups/{id} - delete: - httpMethod: DELETE - path: /api/atlas/v2/groups/{id} - versionheader: application/vnd.atlas.2023-01-01+json - schema: - description: Creates one project. Projects group clusters into logical collections that support an application environment, workload, or both. Each project can have its own users, teams, security, tags, and alert settings. To use this resource, the requesting Service Account or API Key must have the Read Write role. - attributes: - - int64: - default: null - description: Quantity of MongoDB Cloud clusters deployed in this project. - computedOptionalRequired: computed - name: cluster_count - reqBodyUsage: 3 - - string: - default: null - description: Date and time when MongoDB Cloud created this project. This parameter expresses its value in the ISO 8601 timestamp format in UTC. - computedOptionalRequired: computed - name: created - reqBodyUsage: 3 - - string: - default: null - description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud project. - computedOptionalRequired: computed - name: id - reqBodyUsage: 3 - - string: - default: null - description: Human-readable label that identifies the project included in the MongoDB Cloud organization. - computedOptionalRequired: required - name: name - - string: - default: null - description: Unique 24-hexadecimal digit string that identifies the MongoDB Cloud organization to which the project belongs. - computedOptionalRequired: required - name: org_id - reqBodyUsage: 1 - - string: - default: COMMERCIAL_FEDRAMP_REGIONS_ONLY - description: |- - Applies to Atlas for Government only. - - In Commercial Atlas, this field will be rejected in requests and missing in responses. - - This field sets restrictions on available regions in the project. - - `COMMERCIAL_FEDRAMP_REGIONS_ONLY`: Only allows deployments in FedRAMP Moderate regions. - - `GOV_REGIONS_ONLY`: Only allows deployments in GovCloud regions. - computedOptionalRequired: computed_optional - name: region_usage_restrictions - reqBodyUsage: 1 - - listNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: 'Constant that defines the set of the tag. For example, `environment` in the `environment : production` tag.' - computedOptionalRequired: required - name: key - - string: + name: key + - string: default: null description: 'Variable that belongs to the set of the tag. For example, `production` in the `environment : production` tag.' computedOptionalRequired: required @@ -676,230 +396,601 @@ resources: - name - orgId type: object - - name: resource_policy_api + - name: stream_instance_api operations: create: httpMethod: POST - path: /api/atlas/v2/orgs/{orgId}/resourcePolicies + path: /api/atlas/v2/groups/{groupId}/streams read: httpMethod: GET - path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + path: /api/atlas/v2/groups/{groupId}/streams/{name} update: httpMethod: PATCH - path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + path: /api/atlas/v2/groups/{groupId}/streams/{name} delete: httpMethod: DELETE - path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} - versionheader: application/vnd.atlas.2024-08-05+json + path: /api/atlas/v2/groups/{groupId}/streams/{name} + versionheader: application/vnd.atlas.2023-02-01+json schema: - description: Create one Atlas Resource Policy for an org. + description: Creates one stream instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role, Project Owner role or Project Stream Processing Owner role. attributes: - - singleNested: + - listNested: default: null nestedobject: attributes: - - string: - default: null - description: Unique 24-hexadecimal character string that identifies a user. - computedOptionalRequired: computed - name: id - reqBodyUsage: 3 - - string: + - singleNested: default: null - description: Human-readable label that describes a user. - computedOptionalRequired: computed - name: name - reqBodyUsage: 3 - description: The user that last updated the atlas resource policy. - computedOptionalRequired: computed - name: created_by_user - reqBodyUsage: 3 + nestedobject: + attributes: + - string: + default: null + description: Style of authentication. Can be one of PLAIN, SCRAM-256, or SCRAM-512. + computedOptionalRequired: computed + name: mechanism + reqBodyUsage: 3 + - string: + default: null + description: Password of the account to connect to the Kafka cluster. + computedOptionalRequired: computed + name: password + reqBodyUsage: 3 + sensitive: true + - string: + default: null + description: SSL certificate for client authentication to Kafka. + computedOptionalRequired: computed + name: ssl_certificate + reqBodyUsage: 3 + - string: + default: null + description: SSL key for client authentication to Kafka. + computedOptionalRequired: computed + name: ssl_key + reqBodyUsage: 3 + - string: + default: null + description: Password for the SSL key, if it is password protected. + computedOptionalRequired: computed + name: ssl_key_password + reqBodyUsage: 3 + - string: + default: null + description: Username of the account to connect to the Kafka cluster. + computedOptionalRequired: computed + name: username + reqBodyUsage: 3 + description: User credentials required to connect to a Kafka Cluster. Includes the authentication type, as well as the parameters for that authentication mode. + computedOptionalRequired: computed + name: authentication + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account. + computedOptionalRequired: computed + name: role_arn + reqBodyUsage: 3 + - string: + default: null + description: The name of an S3 bucket used to check authorization of the passed-in IAM role ARN. + computedOptionalRequired: computed + name: test_bucket + reqBodyUsage: 3 + description: AWS configurations for AWS-based connection types. + computedOptionalRequired: computed + name: aws + reqBodyUsage: 3 + - string: + default: null + description: Comma separated list of server addresses. + computedOptionalRequired: computed + name: bootstrap_servers + reqBodyUsage: 3 + - string: + default: null + description: The id of the group that the cluster belongs to. + computedOptionalRequired: computed + name: cluster_group_id + reqBodyUsage: 3 + - string: + default: null + description: Name of the cluster configured for this connection. + computedOptionalRequired: computed + name: cluster_name + reqBodyUsage: 3 + - map: + default: null + elementtype: 4 + description: A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters. + computedOptionalRequired: computed + name: config + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: The name of the role to use. Can be a built in role or a custom role. + computedOptionalRequired: computed + name: role + reqBodyUsage: 3 + - string: + default: null + description: Type of the DB role. Can be either BuiltIn or Custom. + computedOptionalRequired: computed + name: type + reqBodyUsage: 3 + description: The name of a Built in or Custom DB Role to connect to an Atlas Cluster. + computedOptionalRequired: computed + name: db_role_to_execute + reqBodyUsage: 3 + - map: + default: null + elementtype: 4 + description: A map of key-value pairs that will be passed as headers for the request. + computedOptionalRequired: computed + name: headers + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source. + computedOptionalRequired: computed + name: name + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Reserved. Will be used by PRIVATE_LINK connection type. + computedOptionalRequired: computed + name: connection_id + reqBodyUsage: 3 + - string: + default: null + description: Reserved. Will be used by PRIVATE_LINK connection type. + computedOptionalRequired: computed + name: name + reqBodyUsage: 3 + - string: + default: null + description: Reserved. Will be used by TRANSIT_GATEWAY connection type. + computedOptionalRequired: computed + name: tgw_id + reqBodyUsage: 3 + - string: + default: null + description: Reserved. Will be used by TRANSIT_GATEWAY connection type. + computedOptionalRequired: computed + name: tgw_route_id + reqBodyUsage: 3 + - string: + default: null + description: Selected networking type. Either PUBLIC, VPC, PRIVATE_LINK, or TRANSIT_GATEWAY. Defaults to PUBLIC. For VPC, ensure that VPC peering exists and connectivity has been established between Atlas VPC and the VPC where Kafka cluster is hosted for the connection to function properly. TRANSIT_GATEWAY support is coming soon. + computedOptionalRequired: computed + name: type + reqBodyUsage: 3 + - string: + default: null + description: Reserved. Will be used by TRANSIT_GATEWAY connection type. + computedOptionalRequired: computed + name: vpc_cidr + reqBodyUsage: 3 + description: Information about networking access. + computedOptionalRequired: computed + name: access + reqBodyUsage: 3 + description: Networking configuration for Streams connections. + computedOptionalRequired: computed + name: networking + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: A trusted, public x509 certificate for connecting to Kafka over SSL. + computedOptionalRequired: computed + name: broker_public_certificate + reqBodyUsage: 3 + - string: + default: null + description: Describes the transport type. Can be either SASL_PLAINTEXT, SASL_SSL, or SSL. + computedOptionalRequired: computed + name: protocol + reqBodyUsage: 3 + description: Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. + computedOptionalRequired: computed + name: security + reqBodyUsage: 3 + - string: + default: null + description: Type of the connection. + computedOptionalRequired: computed + name: type + reqBodyUsage: 3 + - string: + default: null + description: The url to be used for the request. + computedOptionalRequired: computed + name: url + reqBodyUsage: 3 + description: List of connections configured in the stream instance. + computedOptionalRequired: computed + name: connections + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Label that identifies the cloud service provider where MongoDB Cloud performs stream processing. Currently, this parameter only supports AWS and AZURE. + computedOptionalRequired: required + name: cloud_provider + - string: + default: null + description: Name of the cloud provider region hosting Atlas Stream Processing. + computedOptionalRequired: required + name: region + description: Information about the cloud provider region in which MongoDB Cloud processes the stream. + computedOptionalRequired: optional + name: data_process_region + reqBodyUsage: 1 - string: default: null - description: Date and time in UTC when the atlas resource policy was created. + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - list: + default: null + elementtype: 4 + description: List that contains the hostnames assigned to the stream instance. computedOptionalRequired: computed - name: created_date + name: hostnames reqBodyUsage: 3 - string: default: null - description: Description of the atlas resource policy. + description: Human-readable label that identifies the stream instance. computedOptionalRequired: optional - name: description + name: name + reqBodyUsage: 1 + - singleNested: + default: null + nestedobject: + attributes: + - bool: + default: false + description: Flag that indicates whether to add a 'sample_stream_solar' connection. + computedOptionalRequired: computed_optional + name: solar + description: Sample connections to add to SPI. + computedOptionalRequired: optional + name: sample_connections + reqBodyUsage: 1 + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Selected tier for the Stream Instance. Configures Memory / VCPU allowances. + computedOptionalRequired: optional + name: tier + description: Configuration options for an Atlas Stream Processing Instance. + computedOptionalRequired: optional + name: stream_config + reqBodyUsage: 1 + openapi-schema: + properties: + _id: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + connections: + description: List of connections configured in the stream instance. + items: + $ref: "#/components/schemas/StreamsConnection" + readOnly: true + type: array + dataProcessRegion: + $ref: "#/components/schemas/StreamsDataProcessRegion" + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + hostnames: + description: List that contains the hostnames assigned to the stream instance. + items: + description: Unique hostname assigned to the stream instance. + readOnly: true + type: string + readOnly: true + type: array + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 + items: + $ref: "#/components/schemas/Link" + readOnly: true + type: array + name: + description: Human-readable label that identifies the stream instance. + type: string + sampleConnections: + $ref: "#/components/schemas/StreamsSampleConnections" + streamConfig: + $ref: "#/components/schemas/StreamConfig" + type: object + - name: custom_db_role_api + operations: + create: + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + delete: + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/customDBRoles/roles/{roleName} + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Creates one custom role in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Owner role, Project Stream Processing Owner role, or the Project Database Access Admin role. + attributes: + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Human-readable label that identifies the privilege action. + computedOptionalRequired: required + name: action + - listNested: + default: null + nestedobject: + attributes: + - bool: + default: null + description: Flag that indicates whether to grant the action on the cluster resource. If `true`, MongoDB Cloud ignores the **actions.resources.collection** and **actions.resources.db** parameters. + computedOptionalRequired: required + name: cluster + - string: + default: null + description: 'Human-readable label that identifies the collection on which you grant the action to one MongoDB user. If you don''t set this parameter, you grant the action to all collections in the database specified in the **actions.resources.db** parameter. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' + computedOptionalRequired: required + name: collection + - string: + default: null + description: 'Human-readable label that identifies the database on which you grant the action to one MongoDB user. If you set `"actions.resources.cluster" : true`, MongoDB Cloud ignores this parameter.' + computedOptionalRequired: required + name: db + description: List of resources on which you grant the action. + computedOptionalRequired: optional + name: resources + description: List of the individual privilege actions that the role grants. + computedOptionalRequired: optional + name: actions + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - setNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Human-readable label that identifies the database on which someone grants the action to one MongoDB user. + computedOptionalRequired: required + name: db + - string: + default: null + description: Human-readable label that identifies the role inherited. Set this value to `admin` for every role except `read` or `readWrite`. + computedOptionalRequired: required + name: role + description: List of the built-in roles that this custom role inherits. + computedOptionalRequired: optional + name: inherited_roles - string: default: null - description: Unique 24-hexadecimal character string that identifies the atlas resource policy. - computedOptionalRequired: computed - name: id - reqBodyUsage: 3 - - singleNested: + description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. + computedOptionalRequired: required + name: role_name + reqBodyUsage: 1 + openapi-schema: + properties: + actions: + description: List of the individual privilege actions that the role grants. + items: + $ref: "#/components/schemas/DatabasePrivilegeAction" + type: array + inheritedRoles: + description: List of the built-in roles that this custom role inherits. + items: + $ref: "#/components/schemas/DatabaseInheritedRole" + type: array + uniqueItems: true + roleName: + description: Human-readable label that identifies the role for the request. This name must be unique for this custom role in this project. + type: string + required: + - roleName + type: object + - name: maintenance_window_api + operations: + create: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + delete: + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/maintenanceWindow + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Updates the maintenance window for the specified project. Urgent maintenance activities such as security patches can't wait for your chosen window. MongoDB Cloud starts those maintenance activities when needed. After you schedule maintenance for your cluster, you can't change your maintenance window until the current maintenance efforts complete. The maintenance procedure that MongoDB Cloud performs requires at least one replica set election during the maintenance window per replica set. Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or unexpected system issues could delay the start time. Updating the maintenance window will reset any maintenance deferrals for this project. To use this resource, the requesting Service Account or API Key must have the Project Owner role. + attributes: + - bool: + default: null + description: Flag that indicates whether MongoDB Cloud should defer all maintenance windows for one week after you enable them. + computedOptionalRequired: computed_optional + name: auto_defer_once_enabled + - int64: default: null - nestedobject: - attributes: - - string: - default: null - description: Unique 24-hexadecimal character string that identifies a user. - computedOptionalRequired: computed - name: id - reqBodyUsage: 3 - - string: - default: null - description: Human-readable label that describes a user. - computedOptionalRequired: computed - name: name - reqBodyUsage: 3 - description: The user that last updated the atlas resource policy. - computedOptionalRequired: computed - name: last_updated_by_user - reqBodyUsage: 3 + description: |- + One-based integer that represents the day of the week that the maintenance window starts. + + - `1`: Sunday. + - `2`: Monday. + - `3`: Tuesday. + - `4`: Wednesday. + - `5`: Thursday. + - `6`: Friday. + - `7`: Saturday. + computedOptionalRequired: required + name: day_of_week - string: default: null - description: Date and time in UTC when the atlas resource policy was last updated. - computedOptionalRequired: computed - name: last_updated_date + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id reqBodyUsage: 3 - - string: + - int64: default: null - description: Human-readable label that describes the atlas resource policy. + description: Zero-based integer that represents the hour of the of the day that the maintenance window starts according to a 24-hour clock. Use `0` for midnight and `12` for noon. computedOptionalRequired: required - name: name - - string: + name: hour_of_day + - int64: default: null - description: Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. - computedOptionalRequired: required - name: org_id + description: Number of times the current maintenance event for this project has been deferred. + computedOptionalRequired: computed + name: number_of_deferrals reqBodyUsage: 3 - - listNested: + - singleNested: default: null nestedobject: attributes: - - string: + - int64: default: null - description: A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. - computedOptionalRequired: required - name: body - - string: + description: Zero-based integer that represents the end hour of the of the day that the maintenance will not begin in. + computedOptionalRequired: optional + name: end_hour_of_day + - int64: default: null - description: Unique 24-hexadecimal character string that identifies the policy. - computedOptionalRequired: computed - name: id - reqBodyUsage: 3 - description: List of policies that make up the atlas resource policy. - computedOptionalRequired: required - name: policies + description: Zero-based integer that represents the beginning hour of the of the day that the maintenance will not begin in. + computedOptionalRequired: optional + name: start_hour_of_day + description: Defines the a window where maintenance will not begin within. + computedOptionalRequired: optional + name: protected_hours + - bool: + default: null + description: Flag that indicates whether MongoDB Cloud starts the maintenance window immediately upon receiving this request. To start the maintenance window immediately for your project, MongoDB Cloud must have maintenance scheduled and you must set a maintenance window. This flag resets to `false` after MongoDB Cloud completes maintenance. + computedOptionalRequired: optional + name: start_asap - string: default: null - description: A string that identifies the version of the atlas resource policy. + description: Identifier for the current time zone of the maintenance window. This can only be updated via the Project Settings UI. computedOptionalRequired: computed - name: version + name: time_zone_id reqBodyUsage: 3 - openapi-schema: - properties: - createdByUser: - $ref: "#/components/schemas/ApiAtlasUserMetadata" - createdDate: - description: Date and time in UTC when the atlas resource policy was created. - format: date-time - readOnly: true - type: string - description: - description: Description of the atlas resource policy. - readOnly: true - type: string - id: - description: Unique 24-hexadecimal character string that identifies the atlas resource policy. - example: 32b6e34b3d91647abb20e7b8 - pattern: ^([a-f0-9]{24})$ - readOnly: true - type: string - lastUpdatedByUser: - $ref: "#/components/schemas/ApiAtlasUserMetadata" - lastUpdatedDate: - description: Date and time in UTC when the atlas resource policy was last updated. - format: date-time - readOnly: true - type: string - name: - description: Human-readable label that describes the atlas resource policy. - readOnly: true - type: string - orgId: - description: Unique 24-hexadecimal character string that identifies the organization the atlas resource policy belongs to. - example: 32b6e34b3d91647abb20e7b8 - pattern: ^([a-f0-9]{24})$ - readOnly: true - type: string - policies: - description: List of policies that make up the atlas resource policy. - items: - $ref: "#/components/schemas/ApiAtlasPolicy" - readOnly: true - type: array - version: - description: A string that identifies the version of the atlas resource policy. - example: v1 - readOnly: true - type: string - type: object - - name: search_deployment_api + openapi-schema: null + - name: push_based_log_export_api operations: create: wait: - stateProperty: stateName + stateProperty: state pendingStates: - - UPDATING - - PAUSED + - INITIATING + - BUCKET_VERIFIED targetStates: - - IDLE - timeoutSeconds: 10800 + - ACTIVE + timeoutSeconds: 900 minTimeoutSeconds: 60 - delaySeconds: 60 + delaySeconds: 10 httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport read: httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport update: wait: - stateProperty: stateName + stateProperty: state pendingStates: - - UPDATING - - PAUSED + - INITIATING + - BUCKET_VERIFIED targetStates: - - IDLE - timeoutSeconds: 10800 + - ACTIVE + timeoutSeconds: 900 minTimeoutSeconds: 60 - delaySeconds: 60 + delaySeconds: 10 httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport delete: wait: - stateProperty: stateName + stateProperty: state pendingStates: - - IDLE - - UPDATING - - PAUSED + - ACTIVE + - INITIATING + - BUCKET_VERIFIED targetStates: + - UNCONFIGURED - DELETED - timeoutSeconds: 10800 - minTimeoutSeconds: 30 - delaySeconds: 60 + timeoutSeconds: 900 + minTimeoutSeconds: 60 + delaySeconds: 10 httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment - versionheader: application/vnd.atlas.2025-03-12+json + path: /api/atlas/v2/groups/{groupId}/pushBasedLogExport + versionheader: application/vnd.atlas.2023-01-01+json schema: - description: Creates Search Nodes for the specified cluster. + description: Configures the project level settings for the push-based log export feature. attributes: - string: default: null - description: Label that identifies the cluster to create Search Nodes for. + description: The name of the bucket to which the agent will send the logs to. computedOptionalRequired: required - name: cluster_name - reqBodyUsage: 3 + name: bucket_name - string: default: null - description: Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster. + description: Date and time that this feature was enabled on. This parameter expresses its value in the ISO 8601 timestamp format in UTC. computedOptionalRequired: computed - name: encryption_at_rest_provider + name: create_date reqBodyUsage: 3 - string: default: null @@ -908,323 +999,374 @@ resources: **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. computedOptionalRequired: required - name: group_id - reqBodyUsage: 3 - - string: - default: null - description: Unique 24-hexadecimal digit string that identifies the search deployment. - computedOptionalRequired: computed - name: id - reqBodyUsage: 3 - - listNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: Hardware specification for the Search Node instance sizes. - computedOptionalRequired: required - name: instance_size - - int64: - default: null - description: Number of Search Nodes in the cluster. - computedOptionalRequired: required - name: node_count - description: |- - List of settings that configure the Search Nodes for your cluster. - - **NOTE**: We accept a single configuration for all nodes currently. - computedOptionalRequired: required - name: specs + name: group_id + reqBodyUsage: 3 - string: default: null - description: Human-readable label that indicates the current operating condition of this search deployment. + description: ID of the AWS IAM role that will be used to write to the S3 bucket. + computedOptionalRequired: required + name: iam_role_id + - string: + default: null + description: S3 directory in which vector will write to in order to store the logs. An empty string denotes the root directory. + computedOptionalRequired: required + name: prefix_path + - string: + default: null + description: Describes whether or not the feature is enabled and what status it is in. computedOptionalRequired: computed - name: state_name + name: state reqBodyUsage: 3 - openapi-schema: - properties: - encryptionAtRestProvider: - description: Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster. - externalDocs: - description: Encryption at Rest using Customer Key Management - url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ - readOnly: true - type: string - groupId: - description: Unique 24-hexadecimal character string that identifies the project. - example: 32b6e34b3d91647abb20e7b8 - pattern: ^([a-f0-9]{24})$ - readOnly: true - type: string - id: - description: Unique 24-hexadecimal digit string that identifies the search deployment. - example: 32b6e34b3d91647abb20e7b8 - pattern: ^([a-f0-9]{24})$ - readOnly: true - type: string - specs: - description: List of settings that configure the Search Nodes for your cluster. The configuration will be returned for each region and shard. - items: - $ref: "#/components/schemas/ApiSearchDeploymentSpec" - readOnly: true - type: array - stateName: - description: Human-readable label that indicates the current operating condition of this search deployment. - readOnly: true - type: string - type: object - - name: stream_instance_api + openapi-schema: null + - name: resource_policy_api operations: create: httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/streams + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies read: httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/streams/{name} + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} update: httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/streams/{name} + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} delete: httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/streams/{name} - versionheader: application/vnd.atlas.2023-02-01+json + path: /api/atlas/v2/orgs/{orgId}/resourcePolicies/{id} + versionheader: application/vnd.atlas.2024-08-05+json schema: - description: Creates one stream instance in the specified project. To use this resource, the requesting Service Account or API Key must have the Project Data Access Admin role, Project Owner role or Project Stream Processing Owner role. + description: Create one Atlas Resource Policy for an org. attributes: - - listNested: + - singleNested: default: null nestedobject: attributes: - - singleNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: Style of authentication. Can be one of PLAIN, SCRAM-256, or SCRAM-512. - computedOptionalRequired: computed - name: mechanism - reqBodyUsage: 3 - - string: - default: null - description: Password of the account to connect to the Kafka cluster. - computedOptionalRequired: computed - name: password - reqBodyUsage: 3 - sensitive: true - - string: - default: null - description: SSL certificate for client authentication to Kafka. - computedOptionalRequired: computed - name: ssl_certificate - reqBodyUsage: 3 - - string: - default: null - description: SSL key for client authentication to Kafka. - computedOptionalRequired: computed - name: ssl_key - reqBodyUsage: 3 - - string: - default: null - description: Password for the SSL key, if it is password protected. - computedOptionalRequired: computed - name: ssl_key_password - reqBodyUsage: 3 - - string: - default: null - description: Username of the account to connect to the Kafka cluster. - computedOptionalRequired: computed - name: username - reqBodyUsage: 3 - description: User credentials required to connect to a Kafka Cluster. Includes the authentication type, as well as the parameters for that authentication mode. - computedOptionalRequired: computed - name: authentication - reqBodyUsage: 3 - - singleNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: Amazon Resource Name (ARN) that identifies the Amazon Web Services (AWS) Identity and Access Management (IAM) role that MongoDB Cloud assumes when it accesses resources in your AWS account. - computedOptionalRequired: computed - name: role_arn - reqBodyUsage: 3 - - string: - default: null - description: The name of an S3 bucket used to check authorization of the passed-in IAM role ARN. - computedOptionalRequired: computed - name: test_bucket - reqBodyUsage: 3 - description: AWS configurations for AWS-based connection types. - computedOptionalRequired: computed - name: aws - reqBodyUsage: 3 - - string: - default: null - description: Comma separated list of server addresses. - computedOptionalRequired: computed - name: bootstrap_servers - reqBodyUsage: 3 - - string: - default: null - description: The id of the group that the cluster belongs to. - computedOptionalRequired: computed - name: cluster_group_id - reqBodyUsage: 3 - - string: - default: null - description: Name of the cluster configured for this connection. - computedOptionalRequired: computed - name: cluster_name - reqBodyUsage: 3 - - map: - default: null - elementtype: 4 - description: A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters. - computedOptionalRequired: computed - name: config - reqBodyUsage: 3 - - singleNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: The name of the role to use. Can be a built in role or a custom role. - computedOptionalRequired: computed - name: role - reqBodyUsage: 3 - - string: - default: null - description: Type of the DB role. Can be either BuiltIn or Custom. - computedOptionalRequired: computed - name: type - reqBodyUsage: 3 - description: The name of a Built in or Custom DB Role to connect to an Atlas Cluster. - computedOptionalRequired: computed - name: db_role_to_execute - reqBodyUsage: 3 - - map: - default: null - elementtype: 4 - description: A map of key-value pairs that will be passed as headers for the request. - computedOptionalRequired: computed - name: headers - reqBodyUsage: 3 - string: default: null - description: Human-readable label that identifies the stream connection. In the case of the Sample type, this is the name of the sample source. - computedOptionalRequired: computed - name: name - reqBodyUsage: 3 - - singleNested: - default: null - nestedobject: - attributes: - - singleNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: Reserved. Will be used by PRIVATE_LINK connection type. - computedOptionalRequired: computed - name: connection_id - reqBodyUsage: 3 - - string: - default: null - description: Reserved. Will be used by PRIVATE_LINK connection type. - computedOptionalRequired: computed - name: name - reqBodyUsage: 3 - - string: - default: null - description: Reserved. Will be used by TRANSIT_GATEWAY connection type. - computedOptionalRequired: computed - name: tgw_id - reqBodyUsage: 3 - - string: - default: null - description: Reserved. Will be used by TRANSIT_GATEWAY connection type. - computedOptionalRequired: computed - name: tgw_route_id - reqBodyUsage: 3 - - string: - default: null - description: Selected networking type. Either PUBLIC, VPC, PRIVATE_LINK, or TRANSIT_GATEWAY. Defaults to PUBLIC. For VPC, ensure that VPC peering exists and connectivity has been established between Atlas VPC and the VPC where Kafka cluster is hosted for the connection to function properly. TRANSIT_GATEWAY support is coming soon. - computedOptionalRequired: computed - name: type - reqBodyUsage: 3 - - string: - default: null - description: Reserved. Will be used by TRANSIT_GATEWAY connection type. - computedOptionalRequired: computed - name: vpc_cidr - reqBodyUsage: 3 - description: Information about networking access. - computedOptionalRequired: computed - name: access - reqBodyUsage: 3 - description: Networking configuration for Streams connections. + description: Unique 24-hexadecimal character string that identifies a user. computedOptionalRequired: computed - name: networking - reqBodyUsage: 3 - - singleNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: A trusted, public x509 certificate for connecting to Kafka over SSL. - computedOptionalRequired: computed - name: broker_public_certificate - reqBodyUsage: 3 - - string: - default: null - description: Describes the transport type. Can be either SASL_PLAINTEXT, SASL_SSL, or SSL. - computedOptionalRequired: computed - name: protocol - reqBodyUsage: 3 - description: Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use. + name: id + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that describes a user. computedOptionalRequired: computed - name: security + name: name reqBodyUsage: 3 + description: The user that last updated the atlas resource policy. + computedOptionalRequired: computed + name: created_by_user + reqBodyUsage: 3 + - string: + default: null + description: Date and time in UTC when the atlas resource policy was created. + computedOptionalRequired: computed + name: created_date + reqBodyUsage: 3 + - string: + default: null + description: Description of the atlas resource policy. + computedOptionalRequired: optional + name: description + - string: + default: null + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - singleNested: + default: null + nestedobject: + attributes: - string: default: null - description: Type of the connection. + description: Unique 24-hexadecimal character string that identifies a user. computedOptionalRequired: computed - name: type + name: id reqBodyUsage: 3 - string: default: null - description: The url to be used for the request. + description: Human-readable label that describes a user. computedOptionalRequired: computed - name: url + name: name reqBodyUsage: 3 - description: List of connections configured in the stream instance. + description: The user that last updated the atlas resource policy. computedOptionalRequired: computed - name: connections + name: last_updated_by_user reqBodyUsage: 3 - - singleNested: + - string: + default: null + description: Date and time in UTC when the atlas resource policy was last updated. + computedOptionalRequired: computed + name: last_updated_date + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that describes the atlas resource policy. + computedOptionalRequired: required + name: name + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the organization that contains your projects. Use the [/orgs](#tag/Organizations/operation/listOrganizations) endpoint to retrieve all organizations to which the authenticated user has access. + computedOptionalRequired: required + name: org_id + reqBodyUsage: 3 + - listNested: default: null nestedobject: attributes: - string: default: null - description: Label that identifies the cloud service provider where MongoDB Cloud performs stream processing. Currently, this parameter only supports AWS and AZURE. + description: A string that defines the permissions for the policy. The syntax used is the Cedar Policy language. computedOptionalRequired: required - name: cloud_provider + name: body - string: default: null - description: Name of the cloud provider region hosting Atlas Stream Processing. + description: Unique 24-hexadecimal character string that identifies the policy. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + description: List of policies that make up the atlas resource policy. + computedOptionalRequired: required + name: policies + - string: + default: null + description: A string that identifies the version of the atlas resource policy. + computedOptionalRequired: computed + name: version + reqBodyUsage: 3 + openapi-schema: + properties: + createdByUser: + $ref: "#/components/schemas/ApiAtlasUserMetadata" + createdDate: + description: Date and time in UTC when the atlas resource policy was created. + format: date-time + readOnly: true + type: string + description: + description: Description of the atlas resource policy. + readOnly: true + type: string + id: + description: Unique 24-hexadecimal character string that identifies the atlas resource policy. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + lastUpdatedByUser: + $ref: "#/components/schemas/ApiAtlasUserMetadata" + lastUpdatedDate: + description: Date and time in UTC when the atlas resource policy was last updated. + format: date-time + readOnly: true + type: string + name: + description: Human-readable label that describes the atlas resource policy. + readOnly: true + type: string + orgId: + description: Unique 24-hexadecimal character string that identifies the organization the atlas resource policy belongs to. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + policies: + description: List of policies that make up the atlas resource policy. + items: + $ref: "#/components/schemas/ApiAtlasPolicy" + readOnly: true + type: array + version: + description: A string that identifies the version of the atlas resource policy. + example: v1 + readOnly: true + type: string + type: object + - name: search_deployment_api + operations: + create: + wait: + stateProperty: stateName + pendingStates: + - UPDATING + - PAUSED + targetStates: + - IDLE + timeoutSeconds: 10800 + minTimeoutSeconds: 60 + delaySeconds: 60 + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + update: + wait: + stateProperty: stateName + pendingStates: + - UPDATING + - PAUSED + targetStates: + - IDLE + timeoutSeconds: 10800 + minTimeoutSeconds: 60 + delaySeconds: 60 + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + delete: + wait: + stateProperty: stateName + pendingStates: + - IDLE + - UPDATING + - PAUSED + targetStates: + - DELETED + timeoutSeconds: 10800 + minTimeoutSeconds: 30 + delaySeconds: 60 + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment + versionheader: application/vnd.atlas.2025-03-12+json + schema: + description: Creates Search Nodes for the specified cluster. + attributes: + - string: + default: null + description: Label that identifies the cluster to create Search Nodes for. + computedOptionalRequired: required + name: cluster_name + reqBodyUsage: 3 + - string: + default: null + description: Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster. + computedOptionalRequired: computed + name: encryption_at_rest_provider + reqBodyUsage: 3 + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + - string: + default: null + description: Unique 24-hexadecimal digit string that identifies the search deployment. + computedOptionalRequired: computed + name: id + reqBodyUsage: 3 + - listNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Hardware specification for the Search Node instance sizes. computedOptionalRequired: required - name: region - description: Information about the cloud provider region in which MongoDB Cloud processes the stream. - computedOptionalRequired: optional - name: data_process_region - reqBodyUsage: 1 + name: instance_size + - int64: + default: null + description: Number of Search Nodes in the cluster. + computedOptionalRequired: required + name: node_count + description: |- + List of settings that configure the Search Nodes for your cluster. + + **NOTE**: We accept a single configuration for all nodes currently. + computedOptionalRequired: required + name: specs + - string: + default: null + description: Human-readable label that indicates the current operating condition of this search deployment. + computedOptionalRequired: computed + name: state_name + reqBodyUsage: 3 + openapi-schema: + properties: + encryptionAtRestProvider: + description: Cloud service provider that manages your customer keys to provide an additional layer of Encryption At Rest for the cluster. + externalDocs: + description: Encryption at Rest using Customer Key Management + url: https://www.mongodb.com/docs/atlas/security-kms-encryption/ + readOnly: true + type: string + groupId: + description: Unique 24-hexadecimal character string that identifies the project. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + id: + description: Unique 24-hexadecimal digit string that identifies the search deployment. + example: 32b6e34b3d91647abb20e7b8 + pattern: ^([a-f0-9]{24})$ + readOnly: true + type: string + specs: + description: List of settings that configure the Search Nodes for your cluster. The configuration will be returned for each region and shard. + items: + $ref: "#/components/schemas/ApiSearchDeploymentSpec" + readOnly: true + type: array + stateName: + description: Human-readable label that indicates the current operating condition of this search deployment. + readOnly: true + type: string + type: object + - name: stream_processor_api + operations: + create: + wait: + stateProperty: state + pendingStates: + - INIT + - CREATING + targetStates: + - CREATED + timeoutSeconds: 300 + minTimeoutSeconds: 10 + delaySeconds: 10 + httpMethod: POST + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} + update: + wait: + stateProperty: state + pendingStates: + - INIT + - CREATING + targetStates: + - CREATED + timeoutSeconds: 300 + minTimeoutSeconds: 10 + delaySeconds: 10 + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} + delete: + wait: + stateProperty: state + pendingStates: + - INIT + - CREATING + - CREATED + - STARTED + - STOPPED + targetStates: + - DELETED + timeoutSeconds: 300 + minTimeoutSeconds: 10 + delaySeconds: 10 + httpMethod: DELETE + path: /api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor/{name} + versionheader: application/vnd.atlas.2024-05-30+json + schema: + description: Create one Stream Processor within the specified stream instance. To use this resource, the requesting Service Account or API Key must have the Project Owner role or Project Stream Processing Owner role. + attributes: - string: default: null description: |- @@ -1234,91 +1376,191 @@ resources: computedOptionalRequired: required name: group_id reqBodyUsage: 3 - - list: - default: null - elementtype: 4 - description: List that contains the hostnames assigned to the stream instance. - computedOptionalRequired: computed - name: hostnames - reqBodyUsage: 3 - string: default: null - description: Human-readable label that identifies the stream instance. + description: Human-readable name of the stream processor. computedOptionalRequired: optional name: name - reqBodyUsage: 1 - singleNested: default: null nestedobject: attributes: + - singleNested: + default: null + nestedobject: + attributes: + - string: + default: null + description: Name of the collection to use for the DLQ. + computedOptionalRequired: optional + name: coll + - string: + default: null + description: Name of the connection to write DLQ messages to. Must be an Atlas connection. + computedOptionalRequired: optional + name: connection_name + - string: + default: null + description: Name of the database to use for the DLQ. + computedOptionalRequired: optional + name: db + description: Dead letter queue for the stream processor. + computedOptionalRequired: optional + name: dlq - bool: - default: false - description: Flag that indicates whether to add a 'sample_stream_solar' connection. - computedOptionalRequired: computed_optional - name: solar - description: Sample connections to add to SPI. - computedOptionalRequired: optional - name: sample_connections - reqBodyUsage: 1 - - singleNested: - default: null - nestedobject: - attributes: - - string: default: null - description: Selected tier for the Stream Instance. Configures Memory / VCPU allowances. + description: When true, the modified stream processor resumes from its last checkpoint. computedOptionalRequired: optional - name: tier - description: Configuration options for an Atlas Stream Processing Instance. + name: resume_from_checkpoint + description: Optional configuration for the stream processor. + computedOptionalRequired: computed_optional + name: options + - list: + default: null + elementtype: 5 + description: Stream aggregation pipeline you want to apply to your streaming data. computedOptionalRequired: optional - name: stream_config - reqBodyUsage: 1 + name: pipeline + - string: + default: null + description: The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. + computedOptionalRequired: computed + name: state + reqBodyUsage: 3 + - string: + default: null + description: The stats associated with the stream processor. + customType: + model: jsontypes.Normalized + schema: jsontypes.NormalizedType{} + computedOptionalRequired: computed + name: stats + reqBodyUsage: 3 + - string: + default: null + description: Human-readable label that identifies the stream instance. + computedOptionalRequired: required + name: tenant_name + reqBodyUsage: 3 openapi-schema: + description: An atlas stream processor with optional stats. properties: _id: - description: Unique 24-hexadecimal character string that identifies the project. + description: Unique 24-hexadecimal character string that identifies the stream processor. example: 32b6e34b3d91647abb20e7b8 pattern: ^([a-f0-9]{24})$ readOnly: true type: string - connections: - description: List of connections configured in the stream instance. + links: + description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + externalDocs: + description: Web Linking Specification (RFC 5988) + url: https://datatracker.ietf.org/doc/html/rfc5988 items: - $ref: "#/components/schemas/StreamsConnection" + $ref: "#/components/schemas/Link" readOnly: true type: array - dataProcessRegion: - $ref: "#/components/schemas/StreamsDataProcessRegion" - groupId: - description: Unique 24-hexadecimal character string that identifies the project. - example: 32b6e34b3d91647abb20e7b8 - pattern: ^([a-f0-9]{24})$ + name: + description: Human-readable name of the stream processor. readOnly: true type: string - hostnames: - description: List that contains the hostnames assigned to the stream instance. + options: + $ref: "#/components/schemas/StreamsOptions" + pipeline: + description: Stream aggregation pipeline you want to apply to your streaming data. items: - description: Unique hostname assigned to the stream instance. readOnly: true - type: string + type: object readOnly: true type: array - links: - description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. + state: + description: The state of the stream processor. Commonly occurring states are 'CREATED', 'STARTED', 'STOPPED' and 'FAILED'. + readOnly: true + type: string + stats: + description: The stats associated with the stream processor. externalDocs: - description: Web Linking Specification (RFC 5988) - url: https://datatracker.ietf.org/doc/html/rfc5988 - items: - $ref: "#/components/schemas/Link" + url: https://www.mongodb.com/docs/atlas/atlas-stream-processing/manage-stream-processor/#view-statistics-of-a-stream-processor + readOnly: true + type: object + required: + - _id + - name + - pipeline + - state + type: object + - name: auditing_api + operations: + create: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/auditLog + read: + httpMethod: GET + path: /api/atlas/v2/groups/{groupId}/auditLog + update: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/auditLog + delete: + httpMethod: PATCH + path: /api/atlas/v2/groups/{groupId}/auditLog + staticRequestBody: '{"enabled": "false"}' + versionheader: application/vnd.atlas.2023-01-01+json + schema: + description: Updates the auditing configuration for the specified project. The auditing configuration defines the events that MongoDB Cloud records in the audit log. To use this resource, the requesting Service Account or API Key must have the Project Owner role. This feature isn't available for `M0`, `M2`, `M5`, or serverless clusters. + attributes: + - bool: + default: false + description: 'Flag that indicates whether someone set auditing to track successful authentications. This only applies to the `"atype" : "authCheck"` audit filter. Setting this parameter to `true` degrades cluster performance.' + computedOptionalRequired: computed_optional + name: audit_authorization_success + - string: + default: null + description: JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (`\`). + computedOptionalRequired: optional + name: audit_filter + - string: + default: null + description: Human-readable label that displays how to configure the audit filter. + computedOptionalRequired: computed + name: configuration_type + reqBodyUsage: 3 + - bool: + default: false + description: Flag that indicates whether someone enabled database auditing for the specified project. + computedOptionalRequired: computed_optional + name: enabled + - string: + default: null + description: |- + Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. + + **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. + computedOptionalRequired: required + name: group_id + reqBodyUsage: 3 + openapi-schema: + properties: + auditAuthorizationSuccess: + default: false + description: 'Flag that indicates whether someone set auditing to track successful authentications. This only applies to the `"atype" : "authCheck"` audit filter. Setting this parameter to `true` degrades cluster performance.' + externalDocs: + description: System Auditing Messages + url: https://docs.mongodb.com/manual/reference/audit-message/#audit-event-actions-details-and-results + type: boolean + auditFilter: + description: JSON document that specifies which events to record. Escape any characters that may prevent parsing, such as single or double quotes, using a backslash (`\`). + externalDocs: + description: Custom Auditing Filter + url: https://docs.atlas.mongodb.com/tutorial/auditing-custom-filter/ + type: string + configurationType: + description: Human-readable label that displays how to configure the audit filter. readOnly: true - type: array - name: - description: Human-readable label that identifies the stream instance. type: string - sampleConnections: - $ref: "#/components/schemas/StreamsSampleConnections" - streamConfig: - $ref: "#/components/schemas/StreamConfig" + enabled: + default: false + description: Flag that indicates whether someone enabled database auditing for the specified project. + type: boolean type: object - name: cluster_api operations: @@ -2247,245 +2489,3 @@ resources: description: Method by which the cluster maintains the MongoDB versions. If value is `CONTINUOUS`, you must not specify **mongoDBMajorVersion**. type: string type: object - - name: database_user_api - operations: - create: - httpMethod: POST - path: /api/atlas/v2/groups/{groupId}/databaseUsers - read: - httpMethod: GET - path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} - update: - httpMethod: PATCH - path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} - delete: - httpMethod: DELETE - path: /api/atlas/v2/groups/{groupId}/databaseUsers/{databaseName}/{username} - versionheader: application/vnd.atlas.2023-01-01+json - schema: - description: Creates one database user in the specified project. This MongoDB Cloud supports a maximum of 100 database users per project. If you require more than 100 database users on a project, contact Support. To use this resource, the requesting Service Account or API Key must have the Project Owner role, the Project Charts Admin role, Project Stream Processing Owner role, or the Project Database Access Admin role. - attributes: - - string: - default: NONE - description: Human-readable label that indicates whether the new database user authenticates with the Amazon Web Services (AWS) Identity and Access Management (IAM) credentials associated with the user or the user's role. - computedOptionalRequired: computed_optional - name: aws_iamtype - - string: - default: admin - description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. - computedOptionalRequired: computed_optional - name: database_name - - string: - default: null - description: Date and time when MongoDB Cloud deletes the user. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. You must specify a future date that falls within one week of making the Application Programming Interface (API) request. - computedOptionalRequired: optional - name: delete_after_date - - string: - default: null - description: Description of this database user. - computedOptionalRequired: optional - name: description - reqBodyUsage: 2 - - string: - default: null - description: |- - Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access. - - **NOTE**: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups. - computedOptionalRequired: required - name: group_id - - listNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: Key applied to tag and categorize this component. - computedOptionalRequired: optional - name: key - - string: - default: null - description: Value set to the Key applied to tag and categorize this component. - computedOptionalRequired: optional - name: value - description: List that contains the key-value pairs for tagging and categorizing the MongoDB database user. The labels that you define do not appear in the console. - computedOptionalRequired: optional - name: labels - - string: - default: NONE - description: Part of the Lightweight Directory Access Protocol (LDAP) record that the database uses to authenticate this database user on the LDAP host. - computedOptionalRequired: computed_optional - name: ldap_auth_type - - string: - default: NONE - description: Human-readable label that indicates whether the new database user or group authenticates with OIDC federated authentication. To create a federated authentication user, specify the value of USER in this field. To create a federated authentication group, specify the value of IDP_GROUP in this field. - computedOptionalRequired: computed_optional - name: oidc_auth_type - - string: - default: null - description: Alphanumeric string that authenticates this database user against the database specified in `databaseName`. To authenticate with SCRAM-SHA, you must specify this parameter. This parameter doesn't appear in this response. - computedOptionalRequired: optional - name: password - sensitive: true - - listNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: Collection on which this role applies. - computedOptionalRequired: optional - name: collection_name - - string: - default: null - description: Database to which the user is granted access privileges. - computedOptionalRequired: required - name: database_name - - string: - default: null - description: Human-readable label that identifies a group of privileges assigned to a database user. This value can either be a built-in role or a custom role. - computedOptionalRequired: required - name: role_name - description: List that provides the pairings of one role with one applicable database. - computedOptionalRequired: optional - name: roles - - listNested: - default: null - nestedobject: - attributes: - - string: - default: null - description: Human-readable label that identifies the cluster or MongoDB Atlas Data Lake that this database user can access. - computedOptionalRequired: required - name: name - - string: - default: null - description: Category of resource that this database user can access. - computedOptionalRequired: required - name: type - description: List that contains clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances that this database user can access. If omitted, MongoDB Cloud grants the database user access to all the clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances in the project. - computedOptionalRequired: optional - name: scopes - - string: - default: null - description: | - Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: - - | Authentication Method | Parameter Needed | Parameter Value | username Format | - |---|---|---|---| - | AWS IAM | awsIAMType | ROLE | ARN | - | AWS IAM | awsIAMType | USER | ARN | - | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | - | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | - | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | - computedOptionalRequired: required - name: username - - string: - default: NONE - description: |- - X.509 method that MongoDB Cloud uses to authenticate the database user. - - - For application-managed X.509, specify `MANAGED`. - - For self-managed X.509, specify `CUSTOMER`. - - Users created with the `CUSTOMER` method require a Common Name (CN) in the **username** parameter. You must create externally authenticated users on the `$external` database. - computedOptionalRequired: computed_optional - name: x509type - openapi-schema: - properties: - awsIAMType: - default: NONE - description: Human-readable label that indicates whether the new database user authenticates with the Amazon Web Services (AWS) Identity and Access Management (IAM) credentials associated with the user or the user's role. - type: string - databaseName: - default: admin - description: The database against which the database user authenticates. Database users must provide both a username and authentication database to log into MongoDB. If the user authenticates with AWS IAM, x.509, LDAP, or OIDC Workload this value should be `$external`. If the user authenticates with SCRAM-SHA or OIDC Workforce, this value should be `admin`. - type: string - deleteAfterDate: - description: Date and time when MongoDB Cloud deletes the user. This parameter expresses its value in the ISO 8601 timestamp format in UTC and can include the time zone designation. You must specify a future date that falls within one week of making the Application Programming Interface (API) request. - format: date-time - type: string - description: - description: Description of this database user. - maxLength: 100 - type: string - groupId: - description: Unique 24-hexadecimal digit string that identifies the project. - type: string - writeOnly: true - labels: - description: List that contains the key-value pairs for tagging and categorizing the MongoDB database user. The labels that you define do not appear in the console. - items: - $ref: "#/components/schemas/ComponentLabel" - type: array - ldapAuthType: - default: NONE - description: Part of the Lightweight Directory Access Protocol (LDAP) record that the database uses to authenticate this database user on the LDAP host. - type: string - links: - description: List of one or more Uniform Resource Locators (URLs) that point to API sub-resources, related API resources, or both. RFC 5988 outlines these relationships. - externalDocs: - description: Web Linking Specification (RFC 5988) - url: https://datatracker.ietf.org/doc/html/rfc5988 - items: - $ref: "#/components/schemas/Link" - readOnly: true - type: array - oidcAuthType: - default: NONE - description: Human-readable label that indicates whether the new database user or group authenticates with OIDC federated authentication. To create a federated authentication user, specify the value of USER in this field. To create a federated authentication group, specify the value of IDP_GROUP in this field. - type: string - password: - description: Alphanumeric string that authenticates this database user against the database specified in `databaseName`. To authenticate with SCRAM-SHA, you must specify this parameter. This parameter doesn't appear in this response. - externalDocs: - description: SCRAM-SHA - url: https://docs.mongodb.com/manual/core/security-scram/ - minLength: 8 - type: string - writeOnly: true - roles: - description: List that provides the pairings of one role with one applicable database. - items: - $ref: "#/components/schemas/DatabaseUserRole" - type: array - scopes: - description: List that contains clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances that this database user can access. If omitted, MongoDB Cloud grants the database user access to all the clusters, MongoDB Atlas Data Lakes, and MongoDB Atlas Streams Instances in the project. - items: - $ref: "#/components/schemas/UserScope" - type: array - username: - description: | - Human-readable label that represents the user that authenticates to MongoDB. The format of this label depends on the method of authentication: - - | Authentication Method | Parameter Needed | Parameter Value | username Format | - |---|---|---|---| - | AWS IAM | awsIAMType | ROLE | ARN | - | AWS IAM | awsIAMType | USER | ARN | - | x.509 | x509Type | CUSTOMER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | x.509 | x509Type | MANAGED | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | LDAP | ldapAuthType | USER | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | LDAP | ldapAuthType | GROUP | [RFC 2253](https://tools.ietf.org/html/2253) Distinguished Name | - | OIDC Workforce | oidcAuthType | IDP_GROUP | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP group name | - | OIDC Workload | oidcAuthType | USER | Atlas OIDC IdP ID (found in federation settings), followed by a '/', followed by the IdP user name | - | SCRAM-SHA | awsIAMType, x509Type, ldapAuthType, oidcAuthType | NONE | Alphanumeric string | - maxLength: 1024 - type: string - x509Type: - default: NONE - description: |- - X.509 method that MongoDB Cloud uses to authenticate the database user. - - - For application-managed X.509, specify `MANAGED`. - - For self-managed X.509, specify `CUSTOMER`. - - Users created with the `CUSTOMER` method require a Common Name (CN) in the **username** parameter. You must create externally authenticated users on the `$external` database. - type: string - required: - - databaseName - - groupId - - username - type: object diff --git a/tools/codegen/codespec/api_to_provider_spec_mapper.go b/tools/codegen/codespec/api_to_provider_spec_mapper.go index d271304660..841eb8a60c 100644 --- a/tools/codegen/codespec/api_to_provider_spec_mapper.go +++ b/tools/codegen/codespec/api_to_provider_spec_mapper.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "github.com/getkin/kin-openapi/openapi3" - "github.com/pb33f/libopenapi" "github.com/pb33f/libopenapi/datamodel/high/base" "log" "strings" @@ -16,7 +15,6 @@ import ( "github.com/mongodb/openapi/tools/codegen/config" "github.com/mongodb/openapi/tools/codegen/openapi" "github.com/mongodb/openapi/tools/codegen/stringcase" - v3 "github.com/pb33f/libopenapi/datamodel/high/v3" ) func ToCodeSpecModel(atlasAdminAPISpecFilePath, configPath string, resourceName *string) (*Model, error) { @@ -46,13 +44,13 @@ func ToCodeSpecModel(atlasAdminAPISpecFilePath, configPath string, resourceName return nil, fmt.Errorf("unable to get APISpecResource schema: %v", err) } // map OAS resource model to CodeSpecModel - results = append(results, *apiSpecResourceToCodeSpecModel(apiSpec, oasResource, &resourceConfig, stringcase.SnakeCaseString(name))) + results = append(results, *apiSpecResourceToCodeSpecModel(oasResource, &resourceConfig, stringcase.SnakeCaseString(name))) } return &Model{Resources: results}, nil } -func apiSpecResourceToCodeSpecModel(spec *libopenapi.DocumentModel[v3.Document], oasResource APISpecResource, resourceConfig *config.Resource, name stringcase.SnakeCaseString) *Resource { +func apiSpecResourceToCodeSpecModel(oasResource APISpecResource, resourceConfig *config.Resource, name stringcase.SnakeCaseString) *Resource { createOp := oasResource.CreateOp updateOp := oasResource.UpdateOp readOp := oasResource.ReadOp @@ -85,7 +83,7 @@ func apiSpecResourceToCodeSpecModel(spec *libopenapi.DocumentModel[v3.Document], resource := &Resource{ Name: name, Schema: schema, - OpenApiSchema: findSuccessfulResponse(spec, &oasResource), + OpenApiSchema: findSuccessfulResponse(&oasResource), Operations: operations, } @@ -94,18 +92,25 @@ func apiSpecResourceToCodeSpecModel(spec *libopenapi.DocumentModel[v3.Document], return resource } -func findSuccessfulResponse(spec *libopenapi.DocumentModel[v3.Document], oasResource *APISpecResource) *base.Schema { +// findSuccessfulResponse searches for a response with a successful HTTP status code (200-208, 226) +// in the UpdateOp of the provided OAS resource. When found, it extracts and returns the content schema +// from that response. This function is used to obtain the schema that represents the resource's structure +// as defined in the OpenAPI specification. +// +// Parameters: +// - oasResource: The API resource specification containing operations (Create, Read, Update, Delete) +// +// Returns: +// - A pointer to the base.Schema object from the successful response content, or nil if not found +func findSuccessfulResponse(oasResource *APISpecResource) *base.Schema { if oasResource.UpdateOp == nil { return nil } successFulResponses := []int{200, 201, 202, 203, 204, 205, 206, 207, 208, 226} - for _, successCode := range successFulResponses { response := oasResource.UpdateOp.Responses.FindResponseByCode(successCode) if response != nil { - //lowResponse := response.GoLow() - // If it's not a reference, return the inline response return response.Content.Newest().Value.Schema.Schema() } } From 39023aa04d9af65608fca745d557c6002f10654a Mon Sep 17 00:00:00 2001 From: Andrea Angiolillo Date: Sat, 5 Jul 2025 22:43:55 +0100 Subject: [PATCH 5/5] Update api_to_provider_spec_mapper.go --- tools/codegen/codespec/api_to_provider_spec_mapper.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/codegen/codespec/api_to_provider_spec_mapper.go b/tools/codegen/codespec/api_to_provider_spec_mapper.go index 841eb8a60c..3b5c8619fa 100644 --- a/tools/codegen/codespec/api_to_provider_spec_mapper.go +++ b/tools/codegen/codespec/api_to_provider_spec_mapper.go @@ -102,6 +102,8 @@ func apiSpecResourceToCodeSpecModel(oasResource APISpecResource, resourceConfig // // Returns: // - A pointer to the base.Schema object from the successful response content, or nil if not found +// +// !IMPORTANT!: This function does not currently handle nested refs in the response schema func findSuccessfulResponse(oasResource *APISpecResource) *base.Schema { if oasResource.UpdateOp == nil { return nil