To facilitate the management of OceanBase cluster resources and the development of your own applications, OCP provides HTTP APIs that conform to the REST specification. This topic describes the details, syntax, and examples of OCP's open APIs. It is intended for developers. Before you call an API, make sure you understand the concepts of the OCP platform.
API list for cluster management
Module |
API name |
Description |
|---|---|---|
| Cluster information | Query clusters | The API for querying the OceanBase cluster information managed by OCP. |
| Cluster information | Create an OceanBase cluster | The API for creating an OceanBase cluster. |
| Cluster information | Delete an OceanBase cluster | The API for deleting an OceanBase cluster. |
| Cluster information | Stop an OceanBase cluster | The API for stopping an OceanBase cluster. |
| Cluster information | Start an OceanBase cluster | The API for starting an OceanBase cluster. |
| Cluster information | Restart an OceanBase cluster | The API for restarting an OceanBase cluster. |
| Cluster information | Upgrade an OceanBase cluster | The API for upgrading an OceanBase cluster. |
| Cluster information | View the zone list of an OceanBase cluster | The API for querying the zone list of an OceanBase cluster. |
| Cluster information | Create a zone for an OceanBase cluster | The API for adding a zone to an OceanBase cluster. |
| Cluster information | Delete a zone from an OceanBase cluster | The API for deleting a zone from an OceanBase cluster. |
| Cluster information | Stop a zone of an OceanBase cluster | The API for stopping a zone of an OceanBase cluster. |
| Cluster information | Start a zone of an OceanBase cluster | The API for starting a zone of an OceanBase cluster. |
| Cluster information | Restart a zone of an OceanBase cluster | The API for restarting a zone of an OceanBase cluster. |
| Cluster information | Add an OBServer node to an OceanBase cluster | The API for adding an OBServer node to an OceanBase cluster. |
| Cluster information | Batch delete OBServer nodes from an OceanBase cluster | The API for batch deleting OBServer nodes from an OceanBase cluster. |
| Cluster information | Stop an OBServer node in an OceanBase cluster | The API for stopping an OBServer node in an OceanBase cluster. |
| Cluster information | Start an OBServer node in an OceanBase cluster | The API for starting an OBServer node in an OceanBase cluster. |
| Cluster information | Restart an OBServer node in an OceanBase cluster | The API for restarting an OBServer node in an OceanBase cluster. |
| Cluster information | Replace an OBServer node in an OceanBase cluster | The API for replacing an OBServer node in an OceanBase cluster. |
| Cluster information | Modify the password of an OceanBase cluster | The API for modifying the password of an OceanBase cluster. |
| Cluster information | Obtain the parameter metadata of an OceanBase cluster | The API for obtaining the parameter metadata of an OceanBase cluster. |
| Cluster information | Obtain the parameter list of an OceanBase cluster | The API for obtaining the parameter list of an OceanBase cluster. |
| Cluster information | Modify the parameters of an OceanBase cluster | The API for modifying the parameters of an OceanBase cluster. |
| Cluster information | Query the server list | The API for querying the information of all servers in a cluster. |
| Cluster information | Query the server list of a zone | The API for querying the information of all servers in the specified zone of a cluster. |
| Cluster information | Perform a precheck for a switchover | The API for checking the current status of primary and standby clusters to determine whether a switchover can be performed. |
| Cluster information | Perform a precheck for a failover | The API for checking the current status of primary and standby clusters to determine whether a failover can be performed. |
| Cluster information | Perform a daily switchover | The API for switching the standby cluster to the primary cluster and vice versa. |
| Cluster information | Perform a failover switchover | The API for switching the standby cluster to the primary cluster. |
| Cluster information | Obtain the statistics of an OceanBase cluster | The API for obtaining the statistics of an OceanBase cluster. |
| Cluster information | Obtain the statistics of all OBServer resources in a cluster | The API for obtaining the statistics of all OBServer resources in a cluster. |
| Cluster information | Obtain the unit information list | The API for obtaining the unit information list. |
API list for tenant management
Module |
API name |
Description |
|---|---|---|
| Tenant information | Query tenant list of a cluster | Queries the tenant list of the specified cluster. |
| Tenant information | Query all tenants | Queries the information of all tenants managed by OCP. |
| Tenant information | Query tenant details | Queries the details of the specified tenant. |
| Tenant information | Create a tenant | The interface used to create a single tenant in the specified cluster. |
| Tenant information | Delete a tenant | The interface used to delete the specified tenant in the specified cluster. |
| Tenant information | Lock a tenant | The interface used to lock the specified tenant in the specified cluster. |
| Tenant information | Unlock a tenant | The interface used to unlock the specified tenant in the specified cluster. |
| Tenant information | Query tenant unit list | Queries the unit list of the specified tenant. |
| Tenant information | Delete a tenant unit | The interface used to delete the tenant unit. |
| Tenant information | Add a tenant replica | Adds a replica for the specified tenant. |
| Tenant information | Delete a tenant replica | The interface used to delete the specified tenant replica. |
| Tenant information | Modify a tenant replica | The interface used to modify the specified tenant replica. |
| Tenant information | Modify the zone priority of a tenant | The interface used to modify the zone priority of the specified tenant. |
| Tenant information | Change the management password of a tenant | The interface used to change the management password of the specified tenant. |
| Tenant information | Modify the tenant's allowlist | The interface used to modify the allowlist of the specified tenant. |
| Tenant information | Obtain the tenant parameter list | The interface used to obtain the tenant parameter list. |
| Tenant information | Modify tenant parameters | Modifies the parameters of the specified tenant. |
| Tenant information | Obtain the unit specification list | Queries the unit specification list recorded in OCP. |
| Tenant information | Create a unit specification | Creates a unit specification. |
| Tenant information | Delete a unit specification | Deletes a unit specification. |
API list for managing OBProxy
Module |
API Name |
Description |
|---|---|---|
| OBProxy management | Create an OBProxy cluster | The API used to create an OBProxy cluster. |
| OBProxy management | Delete an OBProxy cluster | The API used to delete an OBProxy cluster. |
| OBProxy management | Query the OBProxy cluster list | The API used to query the list of OBProxy clusters. |
| OBProxy management | Query details about an OBProxy cluster | The API used to query details about an OBProxy cluster. |
| OBProxy management | Update the configuration of an OBProxy cluster | The API used to query details about an OBProxy cluster. |
| OBProxy management | Add an OBProxy node | The API used to add an OBProxy node to an OBProxy cluster. |
| OBProxy management | Take over an OBProxy node | The API used to take over an OBProxy node into an OBProxy cluster. |
| OBProxy management | Delete an OBProxy node | The API used to delete an OBProxy node. |
| OBProxy management | Restart an OBProxy node | The API used to restart an OBProxy node. |
| OBProxy management | Upgrade an OBProxy node | The API used to upgrade an OBProxy node. |
| OBProxy management | Add an OceanBase cluster to an OBProxy cluster | Adds an OceanBase cluster to an OBProxy cluster. |
| OBProxy management | Delete an OceanBase cluster from an OBProxy cluster | Deletes the association between an OBProxy cluster and an OceanBase cluster. |
| OBProxy management | Query the metadata of an OBProxy parameter | Queries the metadata of an OBProxy parameter. |
| OBProxy management | Query the parameters of an OBProxy cluster | Queries the parameter settings of an OBProxy cluster. |
API list for database management
Module |
API name |
Description |
|---|---|---|
| Database management | Obtain a list of databases | The interface used to obtain a list of databases. |
| Database management | Create a database | The interface used to create a database. |
| Database management | Modify a database | The interface used to modify a database. |
| Database management | Delete a database | The interface used to delete a database. |
| Database management | Obtain a list of database users | The interface used to obtain a list of database users. |
| Database management | Obtain details about a database user | The interface used to obtain details about a database user. |
| Database management | Create a database user | The interface used to create a database user. |
| Database management | Delete a database user | The interface used to delete a database user. |
| Database management | Modify the password of a database user | The interface used to modify the password of a database user. |
| Database management | Lock a database user | The interface used to lock a database user. |
| Database management | Unlock a database user | The interface used to unlock a database user. |
| Database management | Obtain a list of database roles | The interface used to obtain a list of database roles. |
| Database management | Obtain details about a database role | The interface used to obtain details about a database role. |
| Database management | Create a database role | The interface used to create a database role. |
| Database management | Delete a database role | The interface used to delete a database role. |
| Database management | Obtain a list of database objects | The interface used to obtain a list of database objects. |
| Database management | Grant global permissions to a user | The interface used to grant global permissions to a user. |
| Database management | Revoke global permissions from a user | The interface used to revoke global permissions from a user. |
| Database management | Modify the global permissions of a user | The interface used to modify the global permissions of a user. |
| Database management | Grant global permissions to a role | The interface used to grant global permissions to a role. |
| Database management | Revoke global permissions from a role | The interface used to revoke global permissions from a role. |
| Database management | Modify the global permissions of a role | The interface used to modify the global permissions of a role. |
| Database management | Grant a role to a user | The interface used to grant a role to a user. |
| Database management | Revoke a role from a user | The interface used to revoke a role from a user. |
| Database management | Modify the role of a user | The interface used to modify the role of a user. |
| Database management | Modify the role of a role | The interface used to modify the role of a role. |
| Database management | Revoke the role of a RAM role | The interface used to revoke the role of a RAM role. |
| Database management | Modify the role of a role | The interface used to modify the role of a role. |
| Database management | Grant database permissions to a user | The interface used to grant a user database permissions. |
| Database management | Revoke database permissions from a user | The interface used to revoke some database permissions from a user. |
| Database management | Modify the database permissions of a user | The interface used to modify the database permissions of a user. |
| Database management | Grant object permissions to a user | The interface used to grant object permissions to a user. |
| Database management | Revoke object permissions from a user | The interface used to revoke object permissions from a user. |
| Database management | Modify the object permissions of a user | The interface used to modify the object permissions of a user. |
| Database management | Grant object permissions to a role | The interface used to grant object permissions to a role. |
| Database management | Revoke object permissions from a role | The interface used to revoke object permissions from a role. |
| Database management | Modify the object permissions of a role | The interface used to modify the object permissions of a role. |
Monitoring APIs
Module |
API Name |
Description |
|---|---|---|
| Monitoring | Query the metadata of a monitoring metric | Query the metadata of OCP monitoring metrics. You can use this information to query the monitoring data of the specified metric. |
| Monitoring | Query monitoring data | Query the monitoring data of the specified metric. You must specify the time interval for the query. |
| Monitoring | Query monitoring data and attach a tag to the data | Query the monitoring data of the specified metric. You must specify the time interval for the query. The returned results are associated with group tags. |
Alerting APIs
Module |
API Name |
Description |
|---|---|---|
| Alerting | Get current alerts | Get current alerts. |
| Alerting | Get alert history | Get the alert history. |
| Alerting | Query alert events | Query alert events. |
Inspection APIs
Module |
API Name |
Description |
|---|---|---|
| Inspection | Query all inspection tasks | Query all inspection tasks. |
| Inspection | Get an overview of inspection objects of a specific type | Get an overview of inspection objects of a specific type. |
| Inspection | Get the details of an inspection report | Get the details of an inspection report. |
| Inspection | Initiate an inspection for a specific type of object in a specific scenario | Initiate an inspection for a specific type of object in a specific scenario. |
SQL performance APIs
Module |
API Name |
Description |
|---|---|---|
| SQL Performance | Query the performance statistics of an SQL statement | Queries the performance of an SQL statement for a tenant within a specified time interval. The performance statistics include the cluster, tenant, server, database, user, and SQL_ID. |
| SQL Performance | Query the performance trend of an SQL statement | Queries the performance trend of a specific SQL statement within a specified time interval. |
| SQL Performance | Query the text of an SQL statement | Queries the full text of an SQL statement with a specified ID. |
| SQL Performance | Query the performance trend of an execution plan | Queries the performance trend of the execution plan associated with a specific SQL statement. |
| SQL Performance | Query the operator structure of an execution plan | Queries the operator structure of an execution plan. |
| SQL Performance | Query the slow SQL list | Queries the slow SQL list. |
| SQL Performance | Query the snapshot information | Queries the snapshot information of a specified cluster. |
| SQL Performance | Generate a performance report | Generates a performance report for a cluster. |
| SQL Performance | Query a performance report | Queries a performance report of a cluster. |
Backup and restore API list
Module |
API Name |
Description |
|---|---|---|
| Backup and restore | Query the backup capabilities of a cluster | Queries the backup capabilities of an OceanBase cluster, including whether backup is supported and the backup methods supported. |
| Backup and restore | Create a backup policy for a cluster | Creates a backup policy for a cluster. This allows you to set the backup schedule period, time, storage location, expired data cleanup, and alert threshold for the cluster. |
| Backup and restore | Modify the backup policy of a cluster | Modifies the backup policy of a cluster. This allows you to modify the backup schedule period, time, storage location, expired data cleanup, alert threshold, and secondary backup configuration for the cluster. |
| Backup and restore | Delete a backup policy for a cluster | Deletes the backup policy of a cluster. After a backup policy is deleted, the cluster no longer automatically backs up data or detects related alerts. |
| Backup and restore | Query the backup policy of a specified cluster | Queries the details of the backup policy of an OceanBase cluster. |
| Backup and restore | View the cluster backup overview | Queries the backup overview of a cluster, including the basic information, the time of the last data backup, the log backup point, the log latency, and the backup size. |
| Backup and restore | Query the data backup tasks of a cluster | Queries the data backup tasks of a specified cluster. |
| Backup and restore | Query the log backup tasks of a cluster | Queries the log backup tasks of an OceanBase cluster. |
| Backup and restore | Query the restore tasks of a cluster | Queries the restore tasks of a cluster. |
| Backup and restore | Initiate an immediate backup for a cluster | Initiates an immediate backup for a specified cluster. |
| Backup and restore | Parse the backup information of a cluster | Parses the backup information of a cluster. |
| Backup and restore | Initiate tenant restore | Restores a backed-up tenant to the target cluster. |
| Backup and restore | Preview restore task | Previews the restore task and returns the paths of all backup resources. |
| Backup and restore | Add restore resources | Manually adds the restore resource path. |
| Backup and restore | Clear added restore resources | Clears the added restore resource path. |
| Backup and restore | Initiate tenant data backup | Initiates tenant data backup. |
| Backup and restore | Create a tenant backup strategy | Creates a tenant backup strategy. |
| Backup and restore | Delete a tenant backup strategy | Deletes a tenant backup strategy. |
| Backup and restore | View a tenant data backup task | Views a tenant data backup task. |
| Backup and restore | View a tenant log backup task | Views a tenant log backup task. |
| Backup and restore | View restore tasks | Views restore tasks. |
| Backup and restore | Parse tenant backup information | Parses tenant backup information. |
| Backup and restore | Query a tenant backup strategy | Queries a tenant backup strategy. |
| Backup and restore | Update a tenant backup strategy | Updates a tenant backup strategy. |
Host management API list
Module |
API Name |
Description |
|---|---|---|
| Host Module | Query the region list | Query the region information list. |
| Host Module | Query the details of a region | Query the host region information based on the region ID. |
| Host Module | Add a region | Add the host region information. |
| Host Module | Delete region information | Delete the region information. |
| Host Module | Query the data center list | Query the data center information list. |
| Host Module | Query the details of a data center | Query the host data center information based on the data center ID. |
| Host Module | Add a data center | Add the host data center information. |
| Host Module | Delete data center information | Delete the data center information. |
| Host Module | Query the model list | Query the model information list. |
| Host Module | Query the details of a model | Query the host model information based on the model ID. |
| Host Module | Add a model | Add the host model information. |
| Host Module | Delete model information | Delete the model information. |
| Host Module | Query the host list | Query the host information list. |
| Host Module | Query the details of a host | Query the host details based on the host ID. |
| Host Module | Add hosts in batches | Add the host information in batches. |
| Host Module | Delete a host | Delete the host information. |
| Host Module | Delete multiple hosts | Delete the host information in batches. |
API list of software packages
Module |
API Name |
Description |
|---|---|---|
| Software Package Interface | Query software package list | Queries the information about the software packages managed by OCP. You can filter the software package list by package name, type, version, operating system, or architecture. You can also sort the list by upload time. |
| Software Package Interface | Upload software package | Uploads a local software package to the OCP server. You can filter the software package list by package name, type, version, operating system, or architecture. You can also sort the list by upload time. |
| Software Package Interface | Delete software package | Deletes the specified software package. |
API list of O&M tasks
Module |
API Name |
Description |
|---|---|---|
| Task Management | Query task list | Queries the task list and supports filtering based on different parameters. |
| Task Management | Query task details | Queries the execution details of a task. |
| Task Management | Retry task | Triggers the re-execution of all failed subtasks of the task. |
| Task Management | Rollback task | Rolls back from all failed subtask nodes. |
| Task Management | Query subtask instance logs | Queries the execution logs of a subtask based on the subtask instance ID. Multiple queries for an executing subtask will automatically refresh the logs. |
| Task Management | Retry subtask | Re-executes the failed subtask. |
| Task Management | Skip subtask | Skips the execution of the failed subtask and marks the subtask as successful. |
| Task Management | Cancel subtask | Cancels the execution of an executing subtask and marks the subtask as failed. |
System Management APIs
Module |
API Name |
Description |
|---|---|---|
| Health Check | Query the basic information of an OCP application | Queries the basic information of an OCP application, including the version number, build date, and Java version. |
| Health Check | Query the OCP server time | Queries the OCP server time. This API is generally used to confirm whether the local time is synchronized with the server time. |
| Health Check | Query the status of an OCP application | Queries the status of an OCP application. This API checks the status of each module in the OCP application and returns whether all the modules are in a healthy state. |
| Operations Audit | Query historical events | Queries the historical events of OCP. You can search for historical events based on the event type, operation name, resource name, operator ID, event information, event status, and the time period when the event occurred. |
| Agent Management | Query the details of the OCP Agent on a host | Obtains the details of the OCP Agent on the specified host. |
| Agent Management | Stop the underlying process of the OCP Agent on a host | Stops the underlying process of the OCP Agent on the specified host. |
| Agent Management | Stop the underlying processes of the OCP Agent on multiple hosts | Stops the underlying processes of the OCP Agent on multiple hosts. |
| Agent Management | Restart the OCP Agent on a host | Restarts the OCP Agent on the specified host. |
| Agent Management | Restart the OCP Agent on multiple hosts | Restarts the OCP Agent on multiple hosts. |
| Agent Management | Query the worker processes of the OCP Agent on a host | Queries the worker processes of the OCP Agent on the specified host. |
| Agent Management | Restart the worker process of the OCP Agent on a host | Restarts the worker process of the OCP Agent on the specified host. |
| Agent Management | Stop the worker processes of the OCP Agent on a host | Stops the worker processes of the OCP Agent on the specified host. |
Others
Name |
Description |
|---|---|
| API call description | Describes how to call OCP's open API using HTTP. |
| AK/SK signature generation rules | Describes the rules for generating AK/SK signatures. |
| Task return structure | Describes the data structure of the task return. |
| Alert API access example | Describes how to access OCP's alert to the user's alert platform. |
