OceanBase Cloud Platform (OCP) provides HTTP APIs that conform to the REST specification to facilitate you in managing your OceanBase resources and developing your own applications. This topic describes APIs of OCP, including their syntax and examples. The document is intended for developers. Before you call an API operation, make sure that you fully understand the related concepts.
API List of Cluster management
| Module | Operation | Description |
|---|---|---|
| Cluster management | Query clusters | Query OceanBase clusters managed by OCP. |
| Cluster management | Create an OceanBase cluster | Create an OceanBase cluster. |
| Cluster management | Delete an OceanBase cluster | Delete an OceanBase cluster. |
| Cluster management | Stop an OceanBase cluster | Stop an OceanBase cluster. |
| Cluster management | Start an OceanBase cluster | Start an OceanBase cluster. |
| Cluster management | Restart an OceanBase cluster | Restart an OceanBase cluster. |
| Cluster management | Upgrade an OceanBase cluster | Upgrade an OceanBase cluster. |
| Cluster management | Query zones of an OceanBase cluster | Query zones of an OceanBase cluster. |
| Cluster management | Create a zone for an OceanBase cluster | Create a zone for an OceanBase cluster. |
| Cluster management | Delete a zone from an OceanBase cluster | Delete a zone from an OceanBase cluster. |
| Cluster management | Stop a zone in an OceanBase cluster | Stop a zone in an OceanBase cluster. |
| Cluster management | Start a zone in an OceanBase cluster | Start a zone in an OceanBase cluster. |
| Cluster management | Restart a zone in an OceanBase cluster | Restart a zone in an OceanBase cluster. |
| Cluster management | Add an OBServer | Add an OBServer for an OceanBase cluster. |
| Cluster management | Delete multiple OBServers at a time | Delete multiple OBServers at a time. |
| Cluster management | Stop an OBServer | Stop an OBServer in an OceanBase cluster. |
| Cluster management | Start an OBServer | Start an OBServer in an OceanBase cluster. |
| Cluster management | Restart an OBServer | Restart an OBServer in an OceanBase cluster. |
| Cluster management | Replace an OBServer | Replace an OBServer in an OceanBase cluster. |
| Cluster management | Change the password of an OceanBase cluster | Change the password of an OceanBase cluster. |
| Cluster management | Query the parameter metadata of an OceanBase cluster | Query the parameter metadata of an OceanBase cluster. |
| Cluster management | Query parameters of an OceanBase cluster | Query parameters of an OceanBase cluster. |
| Cluster management | Modify parameters of an OceanBase cluster | Modify parameters of an OceanBase cluster. |
| Cluster management | Query servers | Query all servers in an OceanBase cluster. |
| Cluster management | Query servers in a zone | Query servers in a zone of an OceanBase cluster. |
| Cluster management | Perform a switchover pre-check | Check the current state of the primary and standby OceanBase clusters and determine whether a switchover operation can be performed. |
| Cluster management | Perform a failover pre-check | Check the current state of the primary and standby OceanBase clusters and determine whether a failover operation can be performed. |
| Cluster management | Perform a switchover | Switch the current primary cluster to a standby cluster, and the specified standby cluster to the new primary cluster. |
| Cluster management | Perform a failover | Switch the specified standby cluster to the primary cluster. |
| Cluster management | Obtain resource statistics of an OceanBase cluster | Obtain the resource statistics of an OceanBase cluster. |
| Cluster management | Obtain resource statistics of all OBServer nodes in a cluster | Obtain resource statistics of all OBServer nodes in a cluster. |
| Cluster management | # Obtain information of resource units | Obtain information of resource units. |
API List of Tenant management
| Module | Operation | Description |
|---|---|---|
| Tenant management | Query tenants of a cluster | Query tenants of a cluster. |
| Tenant management | Query all tenants | Query the information of all tenants in a cluster managed by OCP. |
| Tenant management | Query details about a tenant | Query details about a tenant. |
| Tenant management | Create a tenant | Create a single tenant in a specified cluster. |
| Tenant management | Delete a tenant | Delete a tenant from a cluster. |
| Tenant management | Lock a tenant | Lock a tenant in a cluster. |
| Tenant management | Unlock a tenant | Unlock a tenant in a cluster. |
| Tenant management | Query units of a tenant | Query units of a tenant. |
| Tenant management | Delete a unit from a tenant | Delete a unit from a tenant. |
| Tenant management | Add a replica for a tenant | Add a replica for a tenant. |
| Tenant management | Delete a replica of a tenant | Delete a replica of a tenant. |
| Tenant management | Modify a replica of a tenant | Modify a replica of a tenant. |
| Tenant management | Modify zone priorities of a tenant | Modify zone priorities of a tenant. |
| Tenant management | Change the administrator password of a tenant | Change the administrator password of a tenant. |
| Tenant management | Modify the whitelist of a tenant | Modify the whitelist of a tenant. |
| Tenant management | Query parameters of a tenant | Query parameters of a tenant. |
| Tenant management | Modify parameters of a tenant | Modify parameters of a tenant. |
| Tenant management | Obtain a list of unit specifications | Obtain a list of unit specifications from OceanBase Cloud Platform (OCP). |
| Tenant management | Create a resource unit specification | Create a resource unit specification. |
| Tenant management | Delete a resource unit specification | Delete a resource unit specification. |
API List of OBProxy Management
| Module | Operation | Description |
|---|---|---|
| OBProxy Management | Create an OBProxy cluster | Create an OBProxy cluster. |
| OBProxy Management | Delete an OBProxy cluster | Delete an OBProxy cluster. |
| OBProxy Management | Query OBProxy clusters | Query OBProxy clusters. |
| OBProxy Management | Query details about an OBProxy cluster | Query details about an OBProxy cluster. |
| OBProxy Management | Update configurations of an OBProxy cluster | Update configurations of an OBProxy cluster. |
| OBProxy Management | Add an OBProxy | Add an OBProxy to an OBProxy cluster. |
| OBProxy Management | Take over an OBProxy | Enable an OBProxy cluster to take over an OBProxy. |
| OBProxy Management | Delete an OBProxy | Delete an OBProxy. |
| OBProxy Management | Restart an OBProxy | Restart an OBProxy. |
| OBProxy Management | Upgrade an OBProxy | Upgrade an OBProxy. |
| OBProxy Management | Add a connectable OceanBase cluster for an OBProxy cluster | Add a connectable OceanBase cluster for an OBProxy cluster. |
| OBProxy Management | Remove a connectable OceanBase cluster from an OBProxy cluster | Remove a connectable OceanBase cluster from an OBProxy cluster. |
| OBProxy Management | Query the parameter metadata of an OBProxy | Query the parameter metadata of an OBProxy. |
| OBProxy Management | Query parameters of an OBProxy cluster | Query parameters of an OBProxy cluster. |
API List of Database Management
| Module | Operation | Description |
|---|---|---|
| Database Management | Query databases | Query databases. |
| Database Management | Create a database | Create a database. |
| Database Management | Modify a database | Modify a database. |
| Database Management | Delete a database | Delete a database. |
| Database Management | Query database user details | Query detailed information of database users. |
| Database Management | Query database user details | Query details about database users. |
| Database Management | Create a database user | Create a database user. |
| Database Management | Delete a database user | Delete a database user. |
| Database Management | Change the password of a database user | Change the password of a database user. |
| Database Management | Lock a database user | Lock a database user. |
| Database Management | Unlock a database user | Unlock a database user. |
| Database Management | Query the database role details | Query the detailed database roles. |
| Database Management | Query database role details | Query the 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 | Query database objects. |
| Database Management | Grant global privileges to a user | Grant global privileges to a user. |
| Database Management | Revoke global privileges of a user | Revoke global privileges of a user. |
| Database Management | Change global privileges of a user | Change global privileges of a user. |
| Database Management | Grant global privileges to a role | Grant global privileges to a role. |
| Database Management | Revoke global privileges of a role | Revoke global privileges of a role. |
| Database Management | Change global privileges of a role | Change global privileges of a role. |
| Database Management | Grant roles to a user | Grant roles to a user. |
| Database Management | Revoke roles of a user | Revoke roles of a user. |
| Database Management | Change roles of a user | Change roles of a user. |
| Database Management | Grant roles to a role | Grant roles to a role. |
| Database Management | Revoke roles of a role | Revoke roles of a role. |
| Database Management | Change roles of a role | Change roles of a role. |
| Database Management | Grant database privileges to a user | Grant database privileges to a user. |
| Database Management | Revoke database privileges of a user | Revoke database privileges of a user. |
| Database Management | Change database privileges of a user | Change database privileges of a user. |
| Database Management | Grant object privileges to a user | Grant object privileges to a user. |
| Database Management | Revoke object privileges of a user | Revoke object privileges of a user. |
| Database Management | Change object privileges of a user | Change object privileges of a user. |
| Database Management | Grant object privileges to a role | Grant object privileges to a role. |
| Database Management | Revoke object privileges of a role | Revoke object privileges of a role. |
| Database Management | Change object privileges of a role | Change object privileges of a role. |
API List of Monitoring
| Module | Operation | Description | |
|---|---|---|---|
| Tenant information | Monitoring | Query the metadata of a monitoring metric | Queries the metadata information of a monitoring metric in OCP. You can query the monitoring data of a specified metric based on the metadata. |
| Monitoring | Query monitoring data | Queries the monitoring data of a specified metric. The time range must be specified. | |
| Monitoring | Query monitoring data and attach a tag to the data | Queries the monitoring data of a specified metric. The time range must be specified. The returned results contain values of group tags. |
API List of Alerts
| Module | Operation | Description |
|---|---|---|
| Alerts | Query the alert event list | Queries the alert event list. |
| Alerts | Query alert events | Queries the information about a single alert event. |
| Alerts | Query alert notifications | Queries alert notifications based on conditions, recipient, and sending time. |
API List of SQL performance
| Module | Operation | Description |
|---|---|---|
| Performance | Query performance indicators of an SQL statement | Queries SQL performance indicators of a tenant, and specifies an interval to collect SQL performance of the period. Performance data includes the cluster, tenant, server, database, user, and SQL _ID data. |
| Performance | Query the performance indicator trend of an SQL statement | Queries the performance trend of an SQL statement within a specified time range. |
| Performance | Query SQL text | Queries the full text of an SQL statement with the specified ID. |
| Performance | Query performance indicators of an execution plan | Queries the performance of an execution plan associated with the specified SQL statement. |
| Performance | Query the performance indicator trend of an execution plan | Queries the performance trend of an execution plan associated with the specified SQL statement. |
| Performance | Query the operator structure of an execution plan | Queries the operator structure of an execution plan. |
API List of Backup and recovery
| Module | Operation | Description |
|---|---|---|
| Backup and recovery | Query backup capabilities of a cluster | Query the backup capabilities of an OceanBase cluster, including whether the cluster can be backed up and the supported backup methods. |
| Backup and recovery | Create a backup strategy for a cluster | Create a backup strategy for a cluster, set the cycle, time, and storage address for backup scheduling, and set the expired data cleanup and alert thresholds. |
| Backup and recovery | Modify the backup strategy of a cluster | Modify the backup strategy of a cluster, change the cycle, time, and storage address for backup scheduling, change the expired data cleanup and alert thresholds, and modify secondary backup configurations. |
| Backup and recovery | Delete the backup strategy of a cluster | Delete the backup strategy of a cluster. After the backup strategy is deleted, the cluster does not perform automatic backup scheduling, nor does it check for alerts. |
| Backup and recovery | Query the backup strategy of a cluster | Query the backup strategy of a cluster. |
| Backup and recovery | Query the backup overview of a cluster | Query the backup overview information of a cluster, including the basic cluster information, latest data backup time, log backup offset, log delay, and backup size. |
| Backup and recovery | Query data backup tasks of a cluster | Query data backup tasks of a cluster. |
| Backup and recovery | Query log backup tasks of a cluster | Query the log backup tasks of a cluster. |
| Backup and recovery | Query recovery tasks of a cluster | Query recovery tasks of a cluster. |
| Backup and recovery | Immediately back up a cluster | Immediately back up a cluster. |
| Backup and recovery | Parse cluster backup data | Parse the backup data of a specified cluster. |
| Backup and recovery | Initiate tenant recovery | Recover a backed-up tenant to the destination cluster. |
| Backup and recovery | Preview a restore task | Preview a restore task. |
| Backup and recovery | Add restore resources | Manually add the paths of restore resources. |
| Backup and recovery | Clear added restore resources | Clear the paths of added restore resources. |
API List of Host management
| Module | Operation | Description |
|---|---|---|
| Host management | Query regions | Query regions. |
| Host management | Query details about a region | Query details about a region based on its ID. |
| Host management | Add a region | Add a region for a host. |
| Host management | Delete a region | Delete a region. |
| Host management | Query IDCs | Query IDCs. |
| Host management | Query details about an IDC | Query details about an IDC based on its ID. |
| Host management | Add an IDC | Add an IDC. |
| Host management | Delete an IDC | Delete an IDC. |
| Host management | Query host types | Query host types. |
| Host management | Query details about a host type | Query details about a host type based on its ID. |
| Host management | Add a host type | Add a host type. |
| Host management | Delete a host type | Delete a host type. |
| Host management | Query hosts | Query hosts. |
| Host management | Query details about a host | Query details about a host based on its ID. |
| Host management | Add multiple hosts at a time | Add multiple hosts at a time. |
| Host management | Delete a host | Delete a host. |
| Host management | Delete multiple hosts at a time | Delete multiple hosts at a time. |
API List of Software management
| Module | Operation | Description |
|---|---|---|
| Software management | Query software packages | Query software packages managed by OCP. |
| Software management | Upload a software package | Upload a local software package to the OCP server. |
| Software management | Delete a software package | Delete a specific software package. |
API List of O&M tasks management
| Module | Operation | Description |
|---|---|---|
| O&M tasks management | Query tasks | Query tasks by different parameters. |
| O&M tasks management | Query details about a task | Query details about a task. |
| O&M tasks management | Retry a task | Retry all failed subtasks of a task. |
| O&M tasks management | Roll back a task | Roll back all failed subtasks of a task. |
| O&M tasks management | Query logs of a subtask instance | Query subtask execution logs based on the ID of the subtask instance. |
| O&M tasks management | Retry a subtask | Retry a failed subtask. |
| O&M tasks management | Skip a subtask | Skip a failed subtask and mark it as successful. |
| O&M tasks management | Cancel a subtask | Cancel an ongoing subtask and mark it as failed. |
API List of System management
| Module | Operation | Description |
|---|---|---|
| Health examination | Query the basic information of an OCP application | Query the basic information about an OCP application, such as the version number, build date, and Java version. |
| Health examination | Query the OCP server time | Query the OCP server time to check the synchronization between the local time and the server time. |
| Health examination | Query OCP application status | Query the status of the OCP application. It checks the status of each module of the OCP application and returns the health status of all modules. |
| Operation Audit | Query event history | Query event history in OCP by event type, operation event name, resource name, operator ID, event information, event status, or time when the event occurred. |
| Agent Management | Stop basic OCP Agent processes on a host | Stop basic OCP Agent processes on a host. |
| Agent Management | Batch stop basic OCP Agent processes on a host | Batch stop basic OCP Agent processes on a host. |
| Agent Management | Restart basic OCP Agent processes on a host | Restart basic OCP Agent processes on a host. |
| Agent Management | Batch restart basic OCP Agent processes on a host | Batch restart basic OCP Agent processes on a host. |
| Agent Management | Query OCP Agent processes on a host | Query OCP Agent processes on a host. |
| Agent Management | Restart OCP Agent processes on a host | Restart OCP Agent processes on a host. |
| Agent Management | Stop OCP Agent processes on a host | Stop OCP Agent processes on a host. |
Others
| Name | Description |
|---|---|
| API call description | This topic describes how to call an API operation of OceanBase Cloud Platform (OCP) in the HTTP mode, using the Query clusters operation as an example. |
| Rules for generating a signature by using AK/SK | This topic describes the rules for generating a signature by using AK/SK. |
| Call an alert API | This topic provides some sample scripts to show you how to call and test an alert API. |