Integration overview
This topic provides an overview of the AnalyticDB for PostgreSQL OpenAPI and its usage.
OpenAPI Explorer
Alibaba Cloud provides OpenAPI Explorer to help you learn and use the APIs of various cloud products efficiently. OpenAPI Explorer is a comprehensive platform that integrates features such as intelligent API search, documentation, online debugging, SDK acquisition, code samples, error diagnostics, and call statistics. You can use OpenAPI Explorer to call the APIs of Alibaba Cloud products, view requests and responses, and automatically generate SDK sample code. For more information, see Using OpenAPI.
API versions
Alibaba Cloud uses version numbers to manage its API collections. AnalyticDB for PostgreSQL currently supports the API version 2016-05-03. This string is a version identifier, not a date. It provides access to the latest API features and is updated continuously.
|
Version |
Description |
|
Use this version number to call the API for AnalyticDB for PostgreSQL instances. |
Online debugging
AnalyticDB for PostgreSQL provides features such as API debugging in OpenAPI Explorer. Before making an API call, familiarize yourself with the API version, endpoints, and integration methods for AnalyticDB for PostgreSQL.
In the left-side navigation pane of OpenAPI Explorer, select InitVectorDatabase under the RAG Service category. In the parameter configuration form, fill in the required fields: DBInstanceId (the instance ID, for example, gp-xxxxx), ManagerAccount (an account with rds_superuser permissions, for example, testaccount), ManagerAccountPassword (the password of the management account), and RegionId (the region ID of the instance, for example, cn-hangzhou). Then, click Initiate Call.
Debugging page
You can debug the API on the AnalyticDB for PostgreSQL API debugging page.
Endpoints
To minimize latency, select the service endpoint for the region where your resources are located.
For example, for an AnalyticDB for PostgreSQL instance in the China (Zhangjiakou) region, the public endpoint is gpdb.cn-zhangjiakou.aliyuncs.com and the VPC endpoint is gpdb-vpc.cn-zhangjiakou.aliyuncs.com.
Public endpoints are accessible from anywhere in the world.
A Virtual Private Cloud (VPC) is an isolated virtual network. Using a VPC endpoint offers several advantages:
High security: VPC endpoints are accessible only from within your VPC, which provides enhanced security and privacy.
Faster response times: Because they operate within the internal network, VPC endpoints typically offer faster responses than public endpoints and avoid issues like public network latency or bandwidth limitations.
Lower costs: Communication through a VPC endpoint uses the internal network, which can reduce data transfer costs.
For more information, see Endpoints.
Supported user identities
When you log on to OpenAPI Explorer, it uses your current account for online debugging by default. Using an Alibaba Cloud account for debugging poses a high security risk because it has full API access. For security, we recommend creating and using a RAM user with the minimum required permissions for API access and routine O&M. The RAM user must have the necessary permissions to operate AnalyticDB for PostgreSQL. For details, see RAM authorization.
Identity | Supported |
Yes | |
RAM user (Recommended) | Yes |
RAM role (Recommended) | Yes |
Integration methods
AnalyticDB for PostgreSQL supports the following integration methods: Alibaba Cloud SDK, Alibaba Cloud CLI, Terraform, ROS, and custom encapsulation. Choose the method that best fits your business needs.
Using an SDK is the recommended method for calling APIs because it simplifies integration.
Integration method | Supported |
Alibaba Cloud SDK (Recommended) | Yes |
Alibaba Cloud CLI | Yes |
ROS | Yes |
Terraform | Yes |
Alibaba Cloud SDK
Alibaba Cloud provides SDKs for various programming languages, including Java, C#, Go, Python, Node.js, TypeScript, PHP, and C++. The SDKs abstract OpenAPI implementation details and standardize rules for identity, authentication, and signatures. You only need to integrate the SDK to call the API directly. For more information about Alibaba Cloud SDKs, see Alibaba Cloud SDK.
You can use the Alibaba Cloud SDK to call the API for AnalyticDB for PostgreSQL. For a list of supported languages and installation instructions, see SDK overview.
Alibaba Cloud CLI
The Alibaba Cloud CLI is a command-line tool that allows you to interact with Alibaba Cloud services and manage your resources from a command-line shell by using the
aliyuncommand. For more information, see What is Alibaba Cloud CLI.
Terraform
Terraform is an open source tool that lets you safely and efficiently preview, provision, and manage cloud infrastructure and resources. It works similarly to Alibaba Cloud's Resource Orchestration Service (ROS) by converting a template into internal data to make API calls. For more information, see What is Alibaba Cloud Terraform?.
To learn how to use Terraform to call the API for AnalyticDB for PostgreSQL, see Terraform.
Resource Orchestration Service (ROS)
Resource Orchestration Service (ROS) is an Alibaba Cloud service that simplifies the management of cloud resources. Developers and administrators write templates to define required Alibaba Cloud resources, such as Elastic Compute Service (ECS) instances and ApsaraDB RDS database instances, and their dependencies. The ROS orchestration engine then automatically creates and configures all resources based on the template, enabling automated deployment and operations. For more information, see What is Resource Orchestration Service.
You can use ROS to call the OpenAPI for AnalyticDB for PostgreSQL. For a list of some supported common resources and data resources, see ROS-supported resources.
Custom encapsulation
If you prefer not to use an SDK, you can make direct HTTP calls to the Alibaba Cloud API. This requires implementing the signature algorithm, constructing custom requests, and handling the HTTP calls. For more details on the signing mechanism, see V3 request structure and signature.
Usage notes
If an API call fails, check the error code in the response and verify that the request parameters are correct. For more information, see the Error Code Center.
You can also record the RequestID from the response or the error message from the SDK and use the Alibaba Cloud OpenAPI Diagnostic Platform to perform a self-service diagnosis.