All Products
Search
Document Center

ApsaraDB for MongoDB:Integration overview

Last Updated:Jul 18, 2024

ApsaraDB for MongoDB provides the ApsaraDB for MongoDB console. ApsaraDB for MongoDB also provides multiple integration methods, such as API operations, SDKs, and Alibaba Cloud CLI. You can select the integration methods that suit your business requirements.ApsaraDB for MongoDB

API operations

Alibaba Cloud provides OpenAPI Explorer to help you learn about and use API operations. OpenAPI Explorer provides the following features related to the use of API operations: intelligent search, documentation, online debugging, SDKs, sample code, error diagnostics, and statistics. In OpenAPI Explorer, you can call the API operations of Alibaba Cloud services and view the requests and responses. OpenAPI Explorer can also automatically generate SDK sample code to help you use Alibaba Cloud services. For more information, see What is an API?

Version description

The version numbers of API operations of an Alibaba Cloud service indicate major versions. For example, the current version number of an API operation in ApsaraDB for MongoDB is 2015-12-01. The version number may look like a date, but it is not. It does not indicate that the API operation has not been updated since December 1, 2015.

API version number

Description

2015-12-01

Recommended.

Online debugging

ApsaraDB for MongoDB provides features such as API debugging in OpenAPI Explorer. Before you call an API operation, you need to be familiar with the version, endpoint, style, and calling method of the API operation provided by ApsaraDB for MongoDB.

OpenAPI在线调试-国际站

Debugging page

You can access the following URL to debug an API operation: https://api.alibabacloud.com/api/Dds/2015-12-01/.

Endpoints

Select an endpoint based on the region where your resource resides to reduce latency. For example, if you have an ApsaraDB for MongoDB instance in the China (Zhangjiakou) region, the public endpoint of the instance is mongodb.cn-zhangjiakou.aliyuncs.com and the virtual private cloud (VPC) endpoint of the instance is mongodb-vpc.cn-zhangjiakou.aliyuncs.com.

  • Public endpoints are accessible globally.

  • However, VPC endpoints are accessible only within the VPC in the corresponding Alibaba Cloud region. VPC endpoints have the following benefits:

    • High security: VPC endpoints are accessible only within VPCs, providing higher security and privacy.

    • Faster response speed: VPC endpoints run in the internal network. Therefore, the endpoints provide faster response speed than that of the Internet service, and prevent issues such as Internet latency and bandwidth restrictions.

    • Lower cost: VPC endpoints can use the internal network for communication.

For more information, see Endpoints.

Supported identities

After you log on to OpenAPI Explorer by using your Alibaba Cloud account, OpenAPI Explorer uses the account for online OpenAPI debugging by default. An Alibaba Cloud account has permissions on all API operations. Security risks may arise if you use an Alibaba Cloud account to call API operations. We recommend that you use a Resource Access Management (RAM) user to call API operations or perform routine O&M. To create a RAM user, log on to the RAM console. Before you call API operations as a RAM user, grant the required permissions to the RAM user. The RAM user must be granted permissions to perform operations on ApsaraDB for MongoDB instances. For more information, see Access control based on RAM. The following table describes the supported user identities.

User identity

Supported

Alibaba Cloud account

Yes

RAM user (recommended)

Yes

RAM role (recommended)

Yes

Integration methods

ApsaraDB for MongoDB provides multiple integration methods, such as SDKs and Alibaba Cloud CLI. You can select the integration methods that suit your business scenarios.

Integration method

Supported

Alibaba Cloud SDKs (recommended)

Yes

Alibaba Cloud CLI

Yes

Terraform

Yes

ROS

Yes

Custom encapsulation

Yes

SDKs

  • Alibaba Cloud provides SDKs in multiple programming languages, such as Java, C#, Go, Python, Node.js, TypeScript, PHP, and C++. Your applications integrated with the SDKs can directly call API operations. The SDKs encapsulate information such as the signature logic, timeout mechanism, and retry mechanism and return structured response objects based on specifications. This provides convenience for developers. For more information, see Alibaba Cloud SDKs.

  • You can use the SDKs to manage ApsaraDB for MongoDB instances in the use of OpenAPI Explorer. For more information about the supported programming languages and the installation methods of dependencies, see Example of using an SDK for Java.

Alibaba Cloud CLI

  • You can run the aliyun command to interact with Alibaba Cloud services and manage cloud resources. For more information, see What is Alibaba Cloud CLI?

  • You can use Alibaba Cloud CLI to call API operations provided by ApsaraDB for MongoDB. For more information, see Call RPC API and RESTful API.

Terraform

  • Terraform is an open source tool that is used to securely and efficiently preview, configure, and manage cloud infrastructure and resources. Similar to Resource Orchestration Service (ROS), Terraform converts templates into internal data and then completes API calls. For more information, see What is Terraform?

  • For more information about how to use Terraform to orchestrate ApsaraDB for MongoDB resources, see Integrate ApsaraDB for MongoDB by using Terraform.

ROS

  • ROS is an Alibaba Cloud service that allows you to manage cloud computing resources in a simplified manner. You can compile stack templates to describe cloud computing resources, such as Elastic Compute Service (ECS) and ApsaraDB RDS instances, and the dependencies between resources in the templates. The ROS engine automatically creates and configures all resources in a stack based on a template to implement automated deployment and O&M. For more information, see What is ROS?.

  • You can use ROS to call API operations provided by ApsaraDB for MongoDB. Some resources for orchestration include common resources, such as creating and cloning instances, and data resources, such as querying instance details and instance types that can be created.

  • For more information about how to use ROS to orchestrate ApsaraDB for MongoDB resources, see Integrate ApsaraDB for MongoDB by using ROS.

Custom encapsulation

If none of the preceding methods meet your business requirements, you can manually encapsulate API requests. However, this method is not recommended. For more information, see Request syntax and signature method V3.

Usage notes

If an error is returned after you call an API operation, check whether the request parameters and the parameter values are valid based on the returned error code. For a list of error codes, see Service error codes.

You can also use the Alibaba Cloud OpenAPI Diagnostics platform to perform self-service diagnostics based on the returned request ID or SDK error message.