arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

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.

hashtag
Response for successful task completion.

Item
Data type
Content

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

Item
Data type
Content

hashtag
Response for failed task execution

Item
Data type
Content

hashtag
API REFERENCE

circle-info

The API REFERENCE document below contains only the content regarding the "result" value in case of successful task execution.

The type varies depending on the requested task

Contents of the query

status

string

  • Internal response status

  • Value: "ok"

code

string

  • Internal Response Status Codes

  • Successful case: 200

result

The type varies depending on the requested task

Contents of the query

status

string

Internal response status

code

string

Value: ""

message

string

Value: ""

metadata

string

Value: null

code

string

Internal Response Status Code

message

string

Internal Response Status Message

status

string

Internal Response Status

result

// 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",
            "cubeType": "MANAGED",
            "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"
}
// Example of partial monitoring (V1)
{
    "code": "",
    "message": "",
    "metadata": null,
    "result": [
        {
            "metrics": {
                "cluster": "thingcluster",
                "controller_class": "k8s.io/ingress-nginx"
            },
            "timestamp": 1706597820,
            "value": 0.16666666666666669
        }
    ],
    "status": "ok"
}
{
    "code": "CCCM1044000",
    "message": "Not Authorized."
    "status: "error"
}