Skip to content


You can use the Zero Trust Host Access capability to send "commands" to a target cluster(s).

Command Payload

In this example, we want to send a command to "ping" from target clusters. The command is base64 encoded before being sent over this control channel.

curl --location --request POST '' \
--header 'X-RAFAY-API-KEYID: g5439debbd24b1c876aa79b4d2997bdca7009f3g' \
--header 'Content-Type: application/json' \
--data-raw '{
    "target_type" : "cluster",
    "command": "cGluZyAtYyAxIGdvb2dsZS5jb20KaWYgWyAkPyA9PSAwIF07IHRoZW4KICAgIGVjaG8gJ0Nvbm5lY3Rpb24gd29ya2luZycKZWxzZQogICAgZWNobyAnRXJyb3IgaW4gY29ubmVjdGlvbiB0byBVUkwnCmZpCg==",
    "content_type": "base64",
    "timeout": 120

Once submitted, a response with a "Job ID" is returned. This Job ID should be used to query for results.

    "Id": "dpkv0mn",
    "SubmittedAt": "2021-10-11T07:44:01.09573Z",
    "ClusterId": "3mxg7ek",
    "ClusterName": "madhunew-ubuntu201-arm",
    "ProjectId": "j2q4j5k",
    "OrganizationId": "dk69nqk",
    "PartnerId": "9d2wyk8",
    "Command": "cGluZyAtYyAxIGdvb2dsZS5jb20KaWYgWyAkPyA9PSAwIF07IHRoZW4KICAgIGVjaG8gJ0Nvbm5lY3Rpb24gd29ya2luZycKZWxzZQogICAgZWNobyAnRXJyb3IgaW4gY29ubmVjdGlvbiB0byBVUkwnCmZpCg==",
    "Target": [],
    "TargetType": "cluster",
    "TargetNodes": [
    "ContentType": "base64",
    "Timeout": 120,
    "Username": "",
    "UnreachableNodes": [
    "UnapprovedNodes": []

Retrieve Results

Use a GET request to the API Endpoint with the "Job ID" to retrieve results.

curl --location --request GET '' \
--header 'X-RAFAY-API-KEYID: g5439debbd24b1c876aa79b4d2997bdca7009f3g'

Example Output

    "NodeResponses": [
            "Name": "madhuamd-ubuntu201",
            "Resp": {
                "Return": "PING ( 56(84) bytes of data.\n64 bytes from ( icmp_seq=1 ttl=118 time=9.98 ms\n\n--- ping statistics ---\n1 packets transmitted, 1 received, 0% packet loss, time 0ms\nrtt min/avg/max/mdev = 9.979/9.979/9.979/0.000 ms\nConnection working",
                "Retcode": 0,
                "Success": true
    "Responded": [
    "Unreachable": [
    "Unapproved": [],
    "Pending": []