> 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 API response is the data received from the server as a result of the requested Cocktail operation

* 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 %}
