Overview
Call DescribeOpenApi to retrieve the HTTP method, path, parameters, and response structure of a specified API as an OpenAPI definition in JSON format.
API details
Constraints
This API requires authentication with an AccessKey ID and an AccessKey Secret. For information about obtaining these credentials, see Manage AccessKeys. For common request headers and authentication details, see Using API.
Request path
GET /api/v2/openapis/detail
Request parameters
Query
Parameter |
Type |
Required |
Description |
Example value |
|---|---|---|---|---|
| requestId | String | Yes | Request ID. | d04eabba**** |
| apiKey | String | Yes | Name of the API to query. Matches operationId in the API definition. |
DescribeInstance |
| apiVersion | String | Yes | API version. Only v2 is currently supported. |
v2 |
Response parameters
Field |
Type |
Description |
Example value |
|---|---|---|---|
| success | Boolean | Whether the request succeeded. | true |
| errorCode | String | Error code. Returns InvalidParameter if apiKey or apiVersion is missing or blank, or NotFound if no API definition matches the specified apiKey and apiVersion. |
InvalidParameter |
| errorMessage | String | Error message. | Invalid parameter |
| data | Object | Response data. | — |
| cost | Number | Time taken to process the request. | 1.0 |
| server | String | Server address. | 10.0.0.10 |
| requestId | String | Request ID. | d04eabba**** |
| extra | Object | Additional information. | {} |
data object fields
Field |
Type |
Description |
Example value |
|---|---|---|---|
| apiKey | String | API name. Matches operationId in the API definition. |
DescribeInstance |
| apiVersion | String | API version, currently v2. |
v2 |
| category | String | API category, derived from the API's tags. |
MultiCloudOpenAPI |
| summary | String | API summary. | DescribeInstance |
| method | String | HTTP method. | GET |
| path | String | API path. | /api/v2/instances/{instanceId} |
| action | String | API operation name. Use the value returned by the API. | DescribeInstance |
| deprecated | Boolean | Whether the API is deprecated. | false |
| openApi | Object | OpenAPI definition of the queried API, as a JSON object. | — |
Examples
Request example
The following example queries version v2 of the DescribeInstance API. Replace <AccessKey ID> and <AccessKey Secret> with your credentials.
curl --digest -u '<AccessKey ID>:<AccessKey Secret>' \
--get 'https://api-cloud.oceanbase.com/api/v2/openapis/detail' \
--data-urlencode 'requestId=7908a9db****' \
--data-urlencode 'apiKey=DescribeInstance' \
--data-urlencode 'apiVersion=v2'
Response example
The following example shows a partial response with some content from openApi omitted. Refer to the actual API response for the complete result.
Partial response example
{
"data": {
"action": "DescribeInstance",
"apiKey": "DescribeInstance",
"apiVersion": "v2",
"category": "MultiCloudOpenAPI",
"deprecated": false,
"method": "GET",
"openApi": {
"openapi": "3.0.1",
"info": {
"title": "OCP Cloud OpenAPI",
"version": "v2"
},
"paths": {
"/api/v2/instances/{instanceId}": {
"get": {
"operationId": "DescribeInstance",
"parameters": [
{
"schema": {
"type": "string"
},
"in": "path",
"name": "instanceId",
"description": "OceanBase集群ID",
"required": true,
"example": "obcluster-*****"
}
],
"responses": {
"200": {
"description": "成功"
}
}
}
}
}
},
"path": "/api/v2/instances/{instanceId}",
"summary": "DescribeInstance"
},
"requestId": "7908a9db****",
"success": true
}