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. In addition, OpenAPI Explorer automatically generates the corresponding SDK sample code to facilitate the use of Alibaba Cloud services. For more information, see What is an API?
API versions
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 |
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.
Debugging page
You can access the following URL to debug an API operation: https://api.alibabacloud.com/api/Dds/2015-12-01/.
Endpoints
You can select an endpoint based on the region in which 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 provide 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 call API operations or perform routine O&M as a Resource Access Management (RAM) user. Before you call API operations as a RAM user, grant the required permissions to the RAM user based on your business requirements. The RAM user must be granted permissions to perform operations on ApsaraDB for MongoDB instances. For more information, see Use RAM to implement access control. The following table describes the supported user identities.
User identity | Supported |
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 SDK (recommended) | Yes |
Yes | |
Yes | |
Yes | |
Yes |
SDKs
Alibaba Cloud provides SDKs in multiple programming languages, including Java, C#, Go, Python, TypeScript, Node.js, 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
Alibaba Cloud CLI allows you to run
aliyun
commands to interact with Alibaba Cloud services and manage cloud service 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 API in the RPC and RESTful styles.
For more information about how to use Alibaba Cloud CLI to call API operations provided by ApsaraDB for MongoDB, see Integrate ApsaraDB for MongoDB by using Alibaba Cloud CLI.
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 can simplify the management of cloud computing resources. You can create templates to define the required Alibaba Cloud resources such as Elastic Compute Service (ECS) and ApsaraDB RDS instances, as well as the dependencies between the resources. 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.
Common resources:
ALIYUN::MONGODB::Instance: creates an ApsaraDB for MongoDB instance.
ALIYUN::MONGODB::ServerlessInstance: creates an ApsaraDB for MongoDB serverless instance.
ALIYUN::MONGODB::ShardingInstance: creates or clones an ApsaraDB for MongoDB sharded cluster instance.
Data resources:
DATASOURCE::MONGODB::Instances: queries the information of ApsaraDB for MongoDB instances.
DATASOURCE::MONGODB::InstanceClasses: queries the ApsaraDB for MongoDB instance types that can be created in a zone.
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 more information, see ApsaraDB for MongoDB - 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 information.