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.

// 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"
}
ItemData typeContent

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

// 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"
}

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

ItemData typeContent

code

string

Value: ""

message

string

Value: ""

metadata

string

Value: null

result

The type varies depending on the requested task

Contents of the query

status

string

  • Internal response status

  • Value: "ok"

Response for failed task execution

{
    "code": "CCCM1044000",
    "message": "Not Authorized."
    "status: "error"
}
ItemData typeContent

code

string

Internal Response Status Code

message

string

Internal Response Status Message

status

string

Internal Response Status

API REFERENCE

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

Last updated