> For the complete documentation index, see [llms.txt](https://cocktailcloud.gitbook.io/openapi-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cocktailcloud.gitbook.io/openapi-en/api-information/api-response.md).

# API response

* The response may include the success of the requested task, data, error messages, etc
* Below is an example of a simple JSON-formatted API response.

## Response for successful task completion.

<pre class="language-json"><code class="lang-json">// An example of cluster list retrieval
{
    "code": "200",
    "result": [
        {
            "apiUrl": "https://0.0.0.0:0",
            "authType": "CERT",
            "clusterId": "thingcluster",
            "clusterName": "thingcluster",
            "clusterSeq": 1,
            "clusterState": "RUNNING",
            "created": "2023-12-19 09:27:00",
<strong>            "cubeType": "MANAGED",
</strong>            "description": "thingcluster",
            "ingressSupported": "Y",
            "k8sVersion": "1.26.1",
            "loadbalancerSupported": "N",
            "nodePortRange": "30000-32767",
            "nodePortSupported": "Y",
            "nodePortUrl": "0.0.0.0",
            "persistentVolumeSupported": "Y",
            "providerAccountSeq": 1,
            "regionCode": "Acornsoft",
            "updated": "2023-12-20 04:09:29",
            "useYn": "Y"
        }
    ],
    "status": "ok"
}
</code></pre>

<table><thead><tr><th width="116">Item</th><th width="152">Data type</th><th>Content</th></tr></thead><tbody><tr><td><code>code</code></td><td>string</td><td><ul><li>Internal Response Status Codes </li><li>Successful case: 200</li></ul></td></tr><tr><td><code>result</code></td><td>The type varies depending on the requested task</td><td>Contents of the query</td></tr><tr><td><code>status</code></td><td>string</td><td>Internal response status</td></tr></tbody></table>

<pre class="language-json"><code class="lang-json">// Example of partial monitoring (V1)
{
    "code": "",
    "message": "",
    "metadata": null,
    "result": [
        {
            "metrics": {
                "cluster": "thingcluster",
                "controller_class": "k8s.io/ingress-nginx"
            },
            "timestamp": 1706597820,
            "value": 0.16666666666666669
        }
<strong>    ],
</strong>    "status": "ok"
<strong>}
</strong></code></pre>

> You can determine the success of the task based on the status.

<table><thead><tr><th width="135">Item</th><th width="152">Data type</th><th>Content</th></tr></thead><tbody><tr><td><code>code</code></td><td>string</td><td>Value: ""</td></tr><tr><td>message</td><td>string</td><td>Value: ""</td></tr><tr><td>metadata</td><td>string</td><td>Value: null</td></tr><tr><td><code>result</code></td><td>The type varies depending on the requested task</td><td>Contents of the query</td></tr><tr><td><code>status</code></td><td>string</td><td><ul><li>Internal response status</li><li>Value: "ok"</li></ul></td></tr></tbody></table>

### Response for failed task execution

```json
{
    "code": "CCCM1044000",
    "message": "Not Authorized."
    "status: "error"
}
```

<table><thead><tr><th width="139">Item</th><th width="119">Data type</th><th>Content</th></tr></thead><tbody><tr><td><code>code</code></td><td>string</td><td>Internal Response Status Code</td></tr><tr><td><code>message</code></td><td>string</td><td>Internal Response Status Message</td></tr><tr><td><code>status</code></td><td>string</td><td>Internal Response Status</td></tr></tbody></table>

### API REFERENCE

{% hint style="info" %}
The API REFERENCE document below contains only the content regarding the "result" value in case of successful task execution.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cocktailcloud.gitbook.io/openapi-en/api-information/api-response.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
