To facilitate the management of your OceanBase cluster resources and the development of your own applications through APIs, OCP exposes HTTP APIs that comply with the REST specification. This topic describes the APIs exposed by OCP, including their syntax and examples. It is intended for developers. Before calling the APIs, ensure you have a thorough understanding of the relevant concepts of the OCP platform.
List of cluster management APIs
Module |
API name |
Description |
|---|---|---|
| Cluster Information | Query cluster list | This API is used to query the information about the OceanBase cluster managed by OCP. |
| Cluster Information | Create an OceanBase cluster | This API is used to create an OceanBase cluster. |
| Cluster Information | Delete an OceanBase cluster | This API is used to delete an OceanBase cluster. |
| Cluster Information | Stop an OceanBase cluster | This API is used to stop an OceanBase cluster. |
| Cluster Information | Start an OceanBase cluster | This API is used to start an OceanBase cluster. |
| Cluster Information | Restart an OceanBase cluster | This API is used to restart an OceanBase cluster. |
| Cluster Information | Upgrade an OceanBase cluster | This API is used to upgrade an OceanBase cluster. |
| Cluster Information | Move out an OceanBase cluster | This API is used to migrate out an OceanBase cluster. |
| Cluster Information | Pre-check for taking over an OceanBase cluster | This API is used to perform a precheck for taking over an OceanBase cluster. |
| Cluster Information | Take over an OceanBase cluster | The interface used to take over an OceanBase cluster. |
| Cluster Information | View the zone list of an OceanBase cluster | This API is used to query the zone list of an OceanBase cluster. |
| Cluster Information | Create a zone for an OceanBase cluster | This API is used to add a zone to an OceanBase cluster. |
| Cluster Information | Delete a zone from an OceanBase cluster | This API is used to delete a zone from a specified OceanBase cluster. |
| Cluster Information | Stop a zone in an OceanBase cluster | This API is used to stop a zone of the specified OceanBase cluster. |
| Cluster Information | Start an OceanBase cluster in a zone | This API is used to start a zone of the target OceanBase cluster. |
| Cluster Information | Restart zones in an OceanBase cluster | This API is used to restart a zone in a specified OceanBase cluster. |
| Cluster Information | Add an OBServer node | This API is used to add an OBServer node to a target OceanBase cluster. |
| Cluster Information | Batch delete OBServer nodes | This API is used to batch delete OBServer nodes from a target OceanBase cluster. |
| Cluster Information | Stop an OBServer node | This API is used to stop an OBServer node in the target OceanBase cluster. |
| Cluster Information | Start an OBServer node | This API is used to start an OBServer node in the target OceanBase cluster. |
| Cluster Information | Restart an OBServer node | This API is used to restart an OBServer node in the target OceanBase cluster. |
| Cluster Information | Replace an OBServer node | An API for replacing an OBServer node in the target OceanBase cluster. |
| Cluster Information | Modify the password of an OceanBase cluster | This API is used to modify the password of a target OceanBase cluster. |
| Cluster Information | Obtain parameter metadata of an OceanBase cluster | This API is used to obtain the parameter descriptions of an OceanBase cluster. |
| Cluster Information | Obtain the parameter list of an OceanBase cluster | This API is used to obtain the parameter list of the target OceanBase cluster. |
| Cluster Information | Modify parameters of an OceanBase cluster | This API is used to modify parameters of the target OceanBase cluster. |
| Cluster Information | Query OBServer nodes in an OceanBase cluster | This API is used to query information about all OBServer nodes in a cluster. |
| Cluster Information | Query OBServer nodes in a zone | This API is used to query OBServer nodes in a specified zone of a cluster. |
| Cluster Information | Pre-check for switchover | It is used to check the current status of the primary and standby clusters and determine whether a switchover operation for the OceanBase cluster can be performed normally. |
| Cluster Information | Failover pre-check | It is used to check the current status of the primary and standby clusters to determine whether a failover of the OceanBase cluster can be performed normally. |
| Cluster Information | Switchover Daily Switching | Specifies to switch the standby cluster to the primary cluster, and at the same time switch the current primary cluster to the standby cluster. |
| Cluster Information | Failover disaster recovery switching | The API used to designate a standby cluster as the primary cluster. |
| Cluster Information | Query resource statistics of an OceanBase cluster | This API is used to obtain resource statistics of an OceanBase cluster. |
| Cluster Information | Query resource statistics of all OBServer nodes in a cluster | This API is used to obtain the resource statistics of all OBServer nodes in a cluster. |
| Cluster Information | Query units of an OceanBase cluster | This API is used to obtain the unit list of an OceanBase cluster. |
| Cluster Information | Create an arbitration service | This API is used to create an arbitration service. |
| Cluster Information | Query arbitration service details | This API is used to query the details of an arbitration service. |
| Cluster Information | Query the arbitration service list | This API is used to query the arbitration service list. |
| Cluster Information | Stop an arbitration service | This API is used to stop the arbitration service. |
| Cluster Information | Start an arbitration service | This API is used to start an arbitration service. |
| Cluster Information | Restart an arbitration service | This API is used to restart an arbitration service. |
| Cluster Information | Upgrade an arbitration service | This API is used to upgrade an arbitration service. |
| Cluster Information | Delete an arbitration service | This API is used to delete an arbitration service. |
| Cluster Information | Query arbitration service parameters | This API is used to obtain the list of arbitration service parameters. |
| Cluster Information | Bind/unbind a specified set of tags to/from an arbitration service | This API is used to bind or unbind a specified set of tags to/from an arbitration service. |
| Cluster Information | Pre-check for taking over an arbitration service | This API is used to perform a pre-check for taking over an arbitration service. |
| Cluster Information | Take over an arbitration service | The interface for taking over the arbitration service. |
| Cluster Information | Move out arbitration service | This API is used to migrate out an arbitration service. |
| Cluster Information | Pre-check for batch replacing arbitration services | This API is used to batch replace the pre-check of an arbitration service. |
| Cluster Information | Batch Replace Arbitration Services | This API is used to batch replace arbitration services. |
| Cluster Information | Pre-check for batch association with OceanBase clusters | This API is used to batch associate pre-checks for OceanBase clusters. |
| Cluster Information | Batch associate with OceanBase clusters | This API is used to batch associate OceanBase clusters. |
| Cluster Information | Batch remove clusters from an arbitration service | This API is used to unbind clusters in batches. |
| Cluster Information | Create an arbitration service group | This API is used to create an arbitration service group. |
| Cluster Information | Update an arbitration service group | This API is used to update an arbitration service group. |
| Cluster Information | Query arbitration service groups | This API is used to obtain information about an arbitration service group. |
| Cluster Information | Query arbitration service groups | This API is used to obtain the list of arbitration service groups. |
| Cluster Information | Delete an arbitration service group | This API is used to delete an arbitration service group. |
| Cluster Information | Upgrade an arbitration service group | This API is used to upgrade an arbitration service group. |
Tenant management APIs
Module |
API name |
Description |
|---|---|---|
| Tenant Information | Query tenants of a cluster | Query the tenant list of a cluster. |
| Tenant Information | Query all tenants | Query information about all tenants in a cluster managed by OCP. |
| Tenant Information | Query tenant details | Query details of a specified tenant. |
| Tenant Information | Create a tenant | This API is used to create a single tenant in a specified cluster. |
| Tenant Information | Create a standby tenant | This API is used to create a single standby tenant in a specified cluster. |
| Tenant Information | Delete a tenant | This API is used to delete a specified tenant from a specified cluster. |
| Tenant Information | Lock a tenant | The API used to lock a specified tenant in a specified cluster. |
| Tenant Information | Unlock a tenant | This API is used to unlock a specified tenant in a specified cluster. |
| Tenant Information | Query tenant unit lists | Query the unit list of a tenant. |
| Tenant Information | Delete a tenant unit | This API is used to delete a tenant unit. |
| Tenant Information | Add Tenant Replicas | Adds a replica for the specified tenant. |
| Tenant Information | Delete a tenant replica | This API is used to delete replicas for a specified tenant. |
| Tenant Information | Modify Tenant Replica | This API is used to modify replicas for a specified tenant. |
| Tenant Information | Modify the zone priority of a tenant | This API is used to modify the zone priority of a specified tenant. |
| Tenant Information | Modify tenant management password | This API is used to modify the management password of a specified tenant. |
| Tenant Information | Modify tenant allowlist | The API used to modify the allowlist for a specified tenant. |
| Tenant Information | Query tenant parameters | The API used to obtain the tenant parameter list. |
| Tenant Information | Modify tenant parameters | Modify tenant parameters. |
| Tenant Information | Query unit specifications | Query the unit specification list recorded in OCP. |
| Tenant Information | Create a unit specification | Create a resource unit specification. |
| Tenant Information | Delete a unit specification | Delete a unit config. |
| Tenant Information | Pre-check for routine switchover | This API is used for daily pre-checks before switching. |
| Tenant Information | Daily Switchover | An API for routine switching. |
| Tenant Information | Batch Daily Switchover Precheck | This API is used to perform batch pre-checks for routine switchover. |
| Tenant Information | Batch daily switchover | This API is used for batch daily switching. |
| Tenant Information | Pre-check for disaster recovery switchover | This API is used for the pre-check of a disaster recovery switchover. |
| Tenant Information | Disaster recovery switchover | This API is used for disaster recovery switchover. |
| Tenant Information | Batch Disaster Recovery Switchover Precheck | This API is used for pre-checks of batch disaster recovery switchover. |
| Tenant Information | Batch disaster recovery switchover | This API is used for batch disaster recovery switchover. |
OBProxy Management API List
Module |
API name |
Description |
|---|---|---|
| OBProxy Management | Create an OBProxy cluster | The API used to create an OBProxy cluster. |
| OBProxy Management | Delete an OBProxy cluster | This API is used to delete an OBProxy cluster. |
| OBProxy Management | Query the OBProxy cluster list | The API used to query the OBProxy cluster list information. |
| OBProxy Management | Query details about an OBProxy cluster | This API is used to query the details of an OBProxy cluster. |
| OBProxy Management | Update OBProxy cluster configuration | This API is used to query the details of an OBProxy cluster. |
| OBProxy Management | Add OBProxy | The API used to add an OBProxy to an OBProxy cluster. |
| OBProxy Management | Take over OBProxy | The API used to take over OBProxy into an OBProxy cluster. |
| OBProxy Management | Delete an OBProxy | The API used to delete an OBProxy. |
| OBProxy Management | Restart an OBProxy instance | The API used to restart the OBProxy. |
| OBProxy Management | Upgrade OBProxy | The API used to upgrade OBProxy. |
| OBProxy Management | Add an OceanBase cluster to the OBProxy cluster | Add an OceanBase cluster that can be connected to the OBProxy cluster. |
| OBProxy Management | Delete an OBProxy cluster that can connect to the OceanBase cluster | Delete the association between an OBProxy cluster and an OceanBase cluster. |
| OBProxy Management | Query OBProxy parameters | Query the parameter description of OBProxy. |
| OBProxy Management | Query OBProxy cluster parameters | Query the OBProxy cluster parameter settings. |
| Stop OBProxy | Modify OBProxy cluster parameters | This API is used to stop an OBProxy. |
| Start OBProxy | Query the status of an OBProxy cluster | This API is used to start an OBProxy. |
Database management APIs
Module |
API name |
Description |
|---|---|---|
| Database Management | Query databases | The API used to obtain the database list. |
| Database Management | Create a database | The API used to create a database. |
| Database Management | Modify a database | The API used to modify a database. |
| Database Management | Delete a database | The API used to delete a database. |
| Database Management | Query database users | Retrieves the list of database user details. |
| Database Management | Query details of a database user | Retrieves details of a database user. |
| Database Management | Create a database user | Create a database user. |
| Database Management | Delete a database user | Delete a database user. |
| Database Management | Modify the password of a database user | Modify the password of a database user. |
| Database Management | Lock a database user | Lock the database user. |
| Database Management | Unlock a database user | Unlock the database user. |
| Database Management | Query database role details | Retrieves the list of database role details. |
| Database Management | Query database role details | Retrieves details of a database role. |
| Database Management | Create a database role | Create a database role. |
| Database Management | Delete a database role | Delete a database role. |
| Database Management | Query database objects | Retrieves the list of database objects. |
| Database Management | Grant global permissions to users | Grant global privileges to the user. |
| Database Management | Revoke global user permissions | Revoke global privileges from a user. |
| Database Management | Modify global user permissions | Modify user global permissions. |
| Database Management | Grant global permissions to a role | Grants global privileges on the role. |
| Database Management | Revoke global permissions of a role | Revoke global role permissions. |
| Database Management | Modify global role permissions | Modify global role permissions. |
| Database Management | Grant roles to users | The role granted to the user. |
| Database Management | Revoke a user's role | Revoke a user's role. |
| Database Management | Modify a user's role | Modify the user's role. |
| Database Management | Grant roles to roles | Modify the role of a role. |
| Database Management | Revoke the role of a role | Revoke the role. |
| Database Management | Modify the role of a role | Modify the role of a role. |
| Database Management | Grant database privileges to users | This API is used to grant database privileges to a user. |
| Database Management | Revoke user database privileges | This API is used to revoke certain privileges of a user on a database. |
| Database Management | Modify user database permissions | This API is used to modify user privileges on a database. |
| Database Management | Grant object permissions to a user | Grants object permissions to a user. |
| Database Management | Revoke user object permissions | Revoke user object permissions. |
| Database Management | Modify user object permissions | Modify user object permissions. |
| Database Management | Grant role object permissions | Grants role object permissions. |
| Database Management | Revoke role object permissions | Revoke role object permissions. |
| Database Management | Modify role object permissions | Modify role object permissions. |
Monitoring APIs
Module |
API name |
Description |
|---|---|---|
| Monitoring | Query the metadata of a monitoring metric | Query the metadata of OCP monitoring metrics to retrieve the monitoring data for a specified metric. |
| Monitoring | Query monitoring data | To query the monitoring data of a specified metric, you must specify the time interval for the query. |
| Monitoring | Query monitoring data and attach a tag to the data | To query monitoring data for a specified metric, you need to specify the time interval for the query. The returned results include the values of the grouping tags. |
Alert API List
Module |
API name |
Description |
|---|---|---|
| Alert | Alert API call example | An example of an alert API call. |
| Alert | Get active alerts | Query the alert event list. |
| Alert | Get historical alerts | Query single alert event information. |
| Alert | Query alert events | Query detailed information about a specified alert event. |
Inspection API List
Module |
API name |
Description |
|---|---|---|
| Inspection | Query the inspection task list | This API is used to query the inspection task list. |
| Inspection | Query inspection object list | This API is used to query the inspection object list. |
| Inspection | Get inspection report details | This API is used to obtain details of an inspection report. |
| Inspection | Initiate an inspection | This API is used to initiate an inspection. |
| Inspection | Query the last inspection result of a specified inspection item | This API is used to query the last inspection result of a specified inspection item. |
| Inspection | Get the latest inspection result of a specific object | This API is used to obtain the most recent inspection result of a specific object. |
SQL Performance API List
Module |
API name |
Description |
|---|---|---|
| SQL Performance | Query SQL performance statistics | Query the SQL performance of a tenant and statistically analyze the SQL performance within a specified time interval. The performance data includes: cluster, tenant, server, database, user, and SQL_ID. |
| SQL Performance | Query the performance statistics trend of an SQL statement | Query the performance trend of an SQL statement within a specified time interval. |
| SQL Performance | Query SQL text | Query the full text of the SQL statement with the specified ID. |
| SQL Performance | Query execution plan performance statistics trend | Query the performance trend of associated execution plans for a specified SQL statement. |
| SQL Performance | Query the operator structure of an execution plan | Query the execution plan. |
| SQL Performance | Query the slow SQL list | Query the slow SQL list. |
| SQL Performance | Query snapshot information | Query the snapshot information of a specified cluster. |
| SQL Performance | Generate a performance report | Generate a cluster performance report. |
| SQL Performance | Query performance report | Query the cluster performance report. |
Backup and Recovery APIs
Module |
API name |
Description |
|---|---|---|
| Backup and Recovery | Query the backup capabilities of a cluster | Query the backup capabilities of an OceanBase cluster, such as whether backup is supported and what backup methods are available. |
| Backup and Recovery | Create a backup policy for the cluster | Creates a backup policy for a cluster. This API allows you to set the backup scheduling cycle, time, and storage address for the cluster, as well as configure options such as expired data cleanup and alert thresholds. |
| Backup and Recovery | Modify the backup policy of a cluster | This API is used to modify the backup strategy of a cluster, including the backup scheduling cycle, time, and storage address, as well as information such as expired data cleanup, alert thresholds, and secondary backup configurations. |
| Backup and Recovery | Delete a backup policy for a cluster | Delete the backup policy of a cluster. After the backup policy is deleted, the cluster will no longer perform automatic backup scheduling or detect related alerts. |
| Backup and Recovery | Query the backup policy of a specified cluster | Query the backup strategy details of an OceanBase cluster. |
| Backup and Recovery | Query the backup overview of a cluster | Query the backup overview of a cluster, including basic cluster information, the time of the last data backup, log backup timestamps, log latency, and backup size. |
| Backup and Recovery | Query data backup tasks for a cluster | Query data backup tasks for a specified cluster. |
| Backup and Recovery | Query the log backup tasks of a cluster | Query the log backup tasks of an OceanBase cluster. |
| Backup and Recovery | Query recovery tasks of a cluster | Query the restore tasks of a cluster. |
| Backup and Recovery | Back up a cluster immediately | Initiates an immediate backup for a cluster. |
| Backup and Recovery | Parse cluster backup information | Parse the backup information of the cluster. |
| Backup and Recovery | Start cluster backup scheduling | Starts cluster backup scheduling. |
| Backup and Recovery | Stop cluster backup scheduling | Pause cluster backup scheduling. |
| Backup and Recovery | Initiate tenant/database/table recovery | Restore the backed-up tenant to the target cluster. |
| Backup and Recovery | Preview restore | Preview the restore task and return the paths of all backup resources. |
| Backup and Recovery | Add a restore resource | Manually add the resource path for recovery. |
| Backup and Recovery | Clear added restore resources | Clear the added restore resource path. |
| Backup and Recovery | Initiate tenant data backup | Initiate tenant data backup. |
| Backup and Recovery | Create tenant backup strategy | Creates a tenant backup strategy. |
| Backup and Recovery | Delete tenant backup strategy | Delete tenant backup strategy. |
| Backup and Recovery | View tenant data backup tasks | View tenant data backup tasks. |
| Backup and Recovery | View tenant log backup tasks | View tenant log backup tasks. |
| Backup and Recovery | View a restore task | View the restore task. |
| Backup and Recovery | Parse tenant backup information | Parse tenant backup information. |
| Backup and Recovery | Query tenant backup strategy | Query tenant backup policies. |
| Backup and Recovery | Update tenant backup strategy | Updates the tenant backup strategy. |
| Backup and Recovery | Start tenant backup scheduling | Start tenant backup scheduling. |
| Backup and Recovery | Pause tenant backup scheduling | Suspends tenant backup scheduling. |
| Backup and Recovery | Parse global backup information | Access the specified backup storage using the host managed by the current OCP, and parse the source cluster, source tenant, and recoverable time interval from it. |
| Backup and Recovery | Global Initiate Tenant Recovery | Initiate tenant restore from the global view, where the source cluster does not need to be managed by the current OCP. |
Host management APIs
Module |
API name |
Description |
|---|---|---|
| Host Module | Query the region list | Query the list of region information. |
| Host Module | Query area details | Query host region information by region ID. |
| Host Module | Add a region | Add host region information. |
| Host Module | Delete region information | Delete region information. |
| Host Module | Query the data center list | Query the IDC information list. |
| Host Module | Query detailed data center information | Query host IDC information by IDC ID. |
| Host Module | Add data center information | Add host IDC information. |
| Host Module | Delete IDC information | Delete IDC information. |
| Host Module | Query model list | Query the list of instance types. |
| Host Module | Query model details | Query host IDC information by instance ID. |
| Host Module | Add new model information | Add host model information. |
| Host Module | Delete model information | Delete the model information. |
| Host Module | Query host list | Query the host information list. |
| Host Module | Query host details | Query host details by host ID. |
| Host Module | Add hosts in batches | Add host information in batches. |
| Host Module | Delete host | Delete host information. |
| Host Module | Delete multiple hosts | Batch delete host information. |
Software package API list
Module |
API name |
Description |
|---|---|---|
| Software Package API | Query the software package list | Query the software package information managed by OCP. You can filter the package list by keyword, type, version, operating system, and architecture, or sort the list by upload time. |
| Software Package API | Upload a software package | Upload local software packages to the OCP server. You can filter the package list by keyword, type, version, operating system, and architecture, or sort the list by upload time. |
| Software Package API | Delete software packages | Deletes specified software package information. |
List of O&M task management APIs
Module |
API name |
Description |
|---|---|---|
| Task Management | Query the task list | Query the task list, which supports filtering by different parameters. |
| Task Management | Query task details | This API is used to query the details of a task execution. |
| Task Management | Retry a task | Triggers the re-execution of all failed subtasks of a task. |
| Task Management | Rollback tasks | Roll back from all failed subtask nodes. |
| Task Management | Query subtask instance logs | Query the log information of a subtask by its instance ID. Log information is automatically refreshed for ongoing subtasks when queried multiple times. |
| Task Management | Retry a subtask | Rerun failed subtasks. |
| Task Management | Skip a subtask | Skip the failed subtask and mark it as successful. |
| Task Management | Cancel a subtask | Aborts the execution of the subtask and marks it as failed. |
System management APIs
Module |
API name |
Description |
|---|---|---|
| Health Check | Query the basic information of an OCP application | Query the basic information of an OCP application, including: version number, build date, Java version, and other details. |
| Health Check | Query the OCP server time | Query the time on the OCP server. This API is generally used to confirm whether the local time is synchronized with the server time. |
| Health Check | Query the status of OCP applications | Query the status of OCP applications. This API checks the status of each module in the OCP application and returns whether all statuses are healthy. |
| Operation Audit | Query historical events | Query historical events in OCP. You can filter historical events by event type, operation event name, resource name, operator ID, event information, event status, or the time period when the event occurred. |
| Agent Management | Query the details of the OCP agent on a host | Retrieves detailed information about the OCP Agent on a specified host. |
| Agent Management | Stop the underlying process of the OCP agent on a host | Stop the OCP Agent base process on the specified host. |
| Agent Management | Stop the basic processes of the OCP Agent on multiple hosts in batches | Stop the basic processes of the OCP Agent on hosts in batches. |
| Agent Management | Restart the basic process of the OCP Agent on the host | Restart the base process of the OCP Agent on the specified host. |
| Agent Management | Batch restart the basic processes of the OCP Agent on hosts | Batch restart the base processes of the OCP Agent on hosts. |
| Agent Management | Query the OCP Agent process list on a host | Query the worker process list of the OCP Agent on the host. |
| Agent Management | Restart the worker process of the OCP agent on a host | The worker process of the OCP Agent on the specified host during restart. |
| Agent Management | Stop the worker processes of the OCP agent on the host | Stop the OCP Agent worker process on the specified host. |
SOP API List
Module |
API Name |
Description |
|---|---|---|
| SOP Task Management | Query SOP Type List | Queries the list of available SOP types, including their names, target input prompts, and prerequisites. |
| SOP Task Management | Query Default Steps of a Specified Type | Queries the default step template of a specified SOP type. |
| SOP Task Management | Create an SOP Task | Creates an SOP task definition. |
| SOP Task Management | Query SOP Tasks | Queries tasks that can be read by callers by name, type, or display status. Supports pagination and sorting. |
| SOP Task Management | Query SOP Task Details | Queries the task definition, target parameters, step configuration, and derived status. |
| SOP Task Management | Edit an SOP Task | Fully updates the name, target parameters, step configuration, and remarks of an unstarted task. |
| SOP Task Management | Start an SOP Task | Creates an execution instance and all enabled steps, and starts the first step. |
| SOP Task Management | Delete an SOP Task | Deletes an SOP task. |
| SOP Task Management | Query SOP Execution Details | Queries the task execution status and the status of all steps. |
| SOP Task Management | Execute Next Step | Advances the current ready step whose autoRun attribute is set to false. |
| SOP Task Management | Retry All Failed Steps | Retries all failed steps when the overall execution instance status is FAILED. |
| SOP Task Management | Retry a Specified Failed Step | Retries a specified failed step. |
| SOP Task Management | Update the Auto-Execution Switch or Step Parameters of Unexecuted Steps | Updates steps in a started task that are in the PENDING state. |
Others
Name |
Description |
|---|---|
| API details | This topic describes how to call the open APIs of OCP using HTTP. |
| AK/SK Signature Generation Rules | This topic describes the signature generation rules for AK and SK. |
| Task return structure | This topic describes the data structure of the response parameters in a task. |
| Alert API Integration Example | Describes how to integrate OCP alerts with your alerting platform. |
