Software Secure Workload
Activity Configure

API to Create a Troubleshooting Command

This endpoint creates a troubleshooting command available for given Connector.

POST /openapi/v1/connectors/<id>/commands

here <id> is the id that can be obtained from the API to Get Connectors. In request payload, <command> is a troubleshooting command type that can be obtained from API to List Troubleshooting Commands Available for Connector. <arguments> is a filled JSON object of the command schema, which can be obtained from API to Get the Schema of Troubleshooting Commands.

Parameters: The request URL contains the following parameters

Name

Type

Description

id

string

Specify the Connector ID

command

string

Specify the command type

arguments

set

Provide the filled command schema in JSON format

Response object: Returns the troubleshooting command created for given Appliance.

Sample response

req_payload = {
    "command": "SHOW_LOG",
    "arguments": {
      "pattern": "info"
    }
  }
  resp = restclient.post('/connectors/63db5418e6ee1167a4c0986c/commands', json_body=json.dumps(req_payload))
  if resp.status_code == 200:
    parsed_resp = json.loads(resp.content)
    print json.dumps(parsed_resp)

Sample response

{
    "appliance_id": "63dad690e6ee1131f255e985",
    "connector_id": "63db5418e6ee1167a4c0986c",
    "service_id": "63db5418e6ee1167a4c0986d",
    "state": "pending",
    "level": "SERVICE",
    "command": "SHOW_LOG",
    "args": {
      "pattern": "info"
    },
    "tailed": false,
    "rc": 0,
    "push_to_dio_at": 0,
    "attempts": 0,
    "deleted": false,
    "deleted_at": 0,
    "created_at": 1675319613,
    "total_chunk": 0,
    "id": "63db593df029813659f9fcf6"
  }