Overview

2025-09-08 08:15:43  Updated

OCP provides HTTP APIs that conform to REST specifications to help you manage OceanBase cluster resources and develop applications. This topic describes the open APIs of OCP, including their syntax and examples. This topic is intended for developers. Before you call an API, make sure that you understand the concepts of the OCP platform.

API list for cluster management

Module API Name Description
Cluster information Query clusters The interface for querying the information of OceanBase clusters managed by OCP.
Cluster information Create an OceanBase cluster The interface for creating an OceanBase cluster.
Cluster information Delete an OceanBase cluster The interface for deleting an OceanBase cluster.
Cluster information Stop an OceanBase cluster The interface for stopping an OceanBase cluster.
Cluster information Start an OceanBase cluster The interface for starting an OceanBase cluster.
Cluster information Restart an OceanBase cluster The interface for restarting an OceanBase cluster.
Cluster information Upgrade an OceanBase cluster The interface for upgrading an OceanBase cluster.
Cluster information View the zone list of an OceanBase cluster The interface for querying the zone list of an OceanBase cluster.
Cluster information Create a zone for an OceanBase cluster The interface for adding a zone to an OceanBase cluster.
Cluster information Delete a zone from an OceanBase cluster The interface for deleting a zone from an OceanBase cluster.
Cluster information Stop a zone of an OceanBase cluster The interface for stopping a zone of an OceanBase cluster.
Cluster information Start a zone of an OceanBase cluster The interface for starting a zone of an OceanBase cluster.
Cluster information Restart a zone of an OceanBase cluster The interface for restarting a zone of an OceanBase cluster.
Cluster information Add an OBServer node to an OceanBase cluster The interface for adding an OBServer node to an OceanBase cluster.
Cluster information Batch delete OBServer nodes from an OceanBase cluster The interface for batch deleting OBServer nodes from an OceanBase cluster.
Cluster information Stop an OBServer node in an OceanBase cluster The interface for stopping an OBServer node in an OceanBase cluster.
Cluster information Start an OBServer node in an OceanBase cluster The interface for starting an OBServer node in an OceanBase cluster.
Cluster information Restart an OBServer node in an OceanBase cluster The interface for restarting an OBServer node in an OceanBase cluster.
Cluster information Replace an OBServer node in an OceanBase cluster The interface for replacing an OBServer node in an OceanBase cluster.
Cluster information Modify the password of an OceanBase cluster The interface for modifying the password of an OceanBase cluster.
Cluster information Obtain the parameter metadata of an OceanBase cluster The interface for obtaining the parameter metadata of an OceanBase cluster.
Cluster information Obtain the parameter list of an OceanBase cluster The interface for obtaining the parameter list of an OceanBase cluster.
Cluster information Modify the parameters of an OceanBase cluster The interface for modifying the parameters of an OceanBase cluster.
Cluster information Query the server list The interface for querying the information of all servers in the cluster.
Cluster information Query the server list of a zone The interface for querying the information of all servers in the specified zone of the cluster.
Cluster information Pre-check for switchover The interface for checking the current status of primary and standby clusters to determine whether OceanBase cluster switchover can be performed normally.
Cluster information Pre-check for failover The interface for checking the current status of primary and standby clusters to determine whether OceanBase cluster failover can be performed normally.
Cluster information Perform daily switchover The interface for switching the standby cluster to the primary cluster and vice versa.
Cluster information Perform disaster recovery switchover The interface for switching the standby cluster to the primary cluster.
Cluster information Obtain the statistics of an OceanBase cluster The interface for obtaining the statistics of an OceanBase cluster.
Cluster information Obtain the statistics of all OBServer nodes in the cluster The interface for obtaining the statistics of all OBServer nodes in the cluster.
Cluster information Obtain the unit information list The interface for obtaining the unit information list.

API list for tenant management

Module API name Description
Tenant information Query the tenant list of a cluster Query the tenant list of a cluster.
Tenant information Query all tenants Query the information of all tenants managed by OCP.
Tenant information Query the details of a tenant Query the details of a 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 a specified tenant in the specified cluster.
Tenant information Lock a tenant The interface used to lock a specified tenant in the specified cluster.
Tenant information Unlock a tenant The interface used to unlock a specified tenant in the specified cluster.
Tenant information Query the unit list of a tenant Query the unit list of a tenant.
Tenant information Delete a tenant unit The interface used to delete a tenant unit.
Tenant information Add a replica for a tenant Add a replica for a specified tenant.
Tenant information Delete a replica for a tenant The interface used to delete a replica for a specified tenant.
Tenant information Modify a replica for a tenant The interface used to modify a replica for a specified tenant.
Tenant information Modify the zone priority of a tenant The interface used to modify the zone priority of a specified tenant.
Tenant information Change the management password of a tenant The interface used to change the management password of a specified tenant.
Tenant information Modify the allowlist of a tenant The interface used to modify the allowlist of a specified tenant.
Tenant information Obtain the tenant parameter list The interface used to obtain the tenant parameter list.
Tenant information Modify tenant parameters Modify the parameters of a tenant.
Tenant information Obtain the unit specification list Query the unit specification list recorded in OCP.
Tenant information Create a unit specification Create a unit specification.
Tenant information Delete a unit specification Delete a unit specification.

API list for OBProxy management

Module API Name Description
OBProxy management Create an OBProxy cluster The interface used when you create an OBProxy cluster.
OBProxy management Delete an OBProxy cluster The interface used when you delete an OBProxy cluster.
OBProxy management Query the list of OBProxy clusters The interface used when you query the list of OBProxy clusters.
OBProxy management Query details about an OBProxy cluster The interface used when you query details about an OBProxy cluster.
OBProxy management Update the configuration of an OBProxy cluster The interface used when you query details about an OBProxy cluster.
OBProxy management Add an OBProxy to an OBProxy cluster The interface used when you add an OBProxy to an OBProxy cluster.
OBProxy management Take over an OBProxy The interface used when you take over an OBProxy into an OBProxy cluster.
OBProxy management Delete an OBProxy The interface used when you delete an OBProxy.
OBProxy management Restart an OBProxy The interface used when you restart an OBProxy.
OBProxy management Upgrade an OBProxy The interface used when you upgrade an OBProxy.
OBProxy management Add an OceanBase cluster to an OBProxy cluster Add an OceanBase cluster to an OBProxy cluster.
OBProxy management Delete an OceanBase cluster from an OBProxy cluster Delete the association between an OBProxy cluster and an OceanBase cluster.
OBProxy management Query the metadata of an OBProxy parameter Query the metadata of an OBProxy parameter.
OBProxy management Query the parameters of an OBProxy cluster Query 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 Assign a role to a role The interface used to assign a role to 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 database permissions to a user.
Database management Revoke database permissions from a user The interface used to revoke 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 an OCP monitoring metric. You can use the metadata to query the monitoring data of the specified metric.
Monitoring Query monitoring data Query the monitoring data of a specified metric. You must specify the time range for the query.
Monitoring Query monitoring data and attach a tag to the data Query the monitoring data of a specified metric. You must specify the time range for the query. The returned results are associated with group tags.

Alerting APIs

Module API Name Description
Alerting Alert API call example An example of calling an alert API.
Alerting Fetch active alerts Query the list of alert events.
Alerting Fetch historical alerts Query information about a specific alert event.
Alerting Query an alert event Query the details of a specified alert event.

Inspection APIs

Module API Name Description
Inspection Query all inspection tasks Query all inspection tasks.
Inspection Get an overview of inspection objects for a specific type Get an overview of inspection objects for 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 API list

Module API Name Description
SQL Performance Query SQL performance Queries the SQL performance of a tenant and statistics the performance of the SQL in the specified time interval. The performance data includes: cluster, tenant, server, database, user, and SQL_ID.
SQL Performance Query SQL performance trend Queries the performance trend of a specific SQL statement in the specified time interval.
SQL Performance Query SQL text Queries the full text of the SQL statement with the specified ID.
SQL Performance Query performance trend of an execution plan Queries the performance trend of the associated execution plan of the specified SQL statement.
SQL Performance Query operator structure of an execution plan Queries the operation structure of the execution plan.
SQL Performance Query slow SQL list Queries the slow SQL list.
SQL Performance Query snapshot information Queries the snapshot information of the specified cluster.
SQL Performance Generate performance report Generates a performance report of the cluster.
SQL Performance Query performance report Queries the performance report of the cluster.

Backup and restore APIs

Module API Name Description
Backup and restore Query the backup capabilities of a cluster Queries the backup capabilities of OceanBase clusters, including whether the clusters can be backed up and the supported backup methods.
Backup and restore Create a backup strategy for a cluster Creates a backup strategy for a cluster. You can use this API to set the backup schedule period, time, storage address, expired data cleanup, and alert threshold for the cluster.
Backup and restore Modify a backup strategy for a cluster Modifies a backup strategy for a cluster. You can use this API to modify the backup schedule period, time, storage address, expired data cleanup, alert threshold, and secondary backup configuration for the cluster.
Backup and restore Delete a backup strategy for a cluster Deletes a backup strategy for a cluster. After a backup strategy is deleted, automatic backup scheduling and alert detection for the cluster are disabled.
Backup and restore Query the backup strategy of a specified cluster Queries the details of the backup strategy 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 timestamp, 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 the restore task Previews the restore task and returns the paths of all backup resources.
Backup and restore Add restore resources Manually adds restore resource paths.
Backup and restore Clear added restore resources Clears the restore resource paths that have been added.
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 a restore task Views a restore task.
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.

API list for host management

Module API Name Description
Host Management Module Query the region list Queries the list of regions.
Host Management Module Query the details of a region Queries the host region information based on the region ID.
Host Management Module Add a region Adds the host region information.
Host Management Module Delete region information Deletes the region information.
Host Management Module Query the data center list Queries the list of data centers.
Host Management Module Query the details of a data center Queries the host data center information based on the data center ID.
Host Management Module Add a data center Adds the host data center information.
Host Management Module Delete data center information Deletes the data center information.
Host Management Module Query the model list Queries the list of models.
Host Management Module Query the details of a model Queries the host data center information based on the model ID.
Host Management Module Add a model Adds the host model information.
Host Management Module Delete model information Deletes the model information.
Host Management Module Query the host list Queries the list of hosts.
Host Management Module Query the details of a host Queries the details of a host based on the host ID.
Host Management Module Add hosts in batches Adds host information in batches.
Host Management Module Delete a host Deletes the host information.
Host Management Module Delete multiple hosts Deletes 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, and architecture, and you can sort the list by upload time.
Software Package Interface Upload a 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, and architecture, and you can sort the list by upload time.
Software Package Interface Delete software packages 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 filters the task list based on different parameters.
Task Management Query task details Queries the execution details of a task.
Task Management Retry a task Triggers the re-execution of all failed subtasks of the task.
Task Management Rollback a 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 log information.
Task Management Retry a subtask Re-executes a failed subtask.
Task Management Skip a subtask Skips the execution of a failed subtask and marks the subtask as successful.
Task Management Cancel a subtask Cancels the execution of an executing subtask and marks the subtask as failed.

API list for system management

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 server time of OCP Queries the server time of OCP. 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 modules are in a healthy state.
Operations Audit Query historical events Queries the historical events of OCP. You can search for historical events by specifying conditions such as 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 basic process of the OCP Agent on a host Stops the basic process of the OCP Agent on the specified host.
Agent Management Stop the basic process of the OCP Agent on multiple hosts Stops the basic process of the OCP Agent on multiple hosts.
Agent Management Restart the basic process of the OCP Agent on a host Restarts the basic process of the OCP Agent on the specified host.
Agent Management Restart the basic process of the OCP Agent on multiple hosts Restarts the basic process of the OCP Agent on multiple hosts.
Agent Management Query the worker process list of the OCP Agent on a host Queries the worker process list 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 process of the OCP Agent on a host Stops the worker process of the OCP Agent on the specified host.

Others

Name Description
API call description Describes how to use HTTP to call the open API of OCP.
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 alerts to your alert platform.

Contact Us