Generate a report containing Docker data for a target

Generate a report containing Docker data for a target

POST api/v2/jobs/rvc '{"method":"docker.report","params":{"includes":["images","containers","stats"]},"hostnames":["<node_hostname>"]}'

Starts a SC//Reliantâ„¢ Virtual Controller (RVC) job to generate a report containing Docker data for a target. The Docker data includes the list of container images, list of running containers, and the statistics on running containers. By default, all of this data is included in the report. You can use the includes parameter to control the data to include in the report. The available targets are a node, node group, or saved filter. The response will indicate that the RVC job is created and is scheduled to run. You can use the job ID from the response to retrieve the job status.

In order to perform this action, the following conditions must be met:

  • Must have the Remote Job Execution feature turned on at the site level.
  • The user must have the following capabilities:
    • Create and Update a RVC job
    • Call Docker read-only methods

Request syntax

post api/v2/jobs/rvc '{"method":"docker.report","params":{"includes":["images","containers","stats"]},"hostnames":["<node_hostname>"]}'

Request parameters

The request accepts the following data in JSON format.

ParameterTypeDescriptionRequired
methodStringThe RVC action to start. This value is specified as a combination of the RVC module and method. For example, to generate a report containing Docker data you would specify the docker module and the report method combined as docker.report.Yes
paramsStringThe parameters that scope which Docker data to include in the generated report. The only supported parameter is includes which determines which data to include. The available values are all, images, containers, and stats. If no value is specified, the default value of all is used.No
hostnamesString arrayThe list of node hostnames on which to run the RVC job.Dependent. Only if no node group or saved filter is provided.
node_group_nameStringThe name of the node group on which to run the RVC job. The RVC job will run on all nodes that are members of the node group.Dependent. Only if no hostnames or saved filter is provided.
node_group_idIntegerThe ID of the node group on which to run the RVC job. The RVC job will run on all nodes that are members of the node group.Dependent. Only if no hostnames or saved filter is provided.
saved_filter_nameStringThe name of the saved filter on which to run the RVC job. The RVC job will run on all nodes that match the saved filter.Dependent. Only if no hostnames or node group is provided.
saved_filter_idIntegerThe ID of the saved filter on which to run the RVC job. The RVC job will run on all nodes that match the saved filter.Dependent. Only if no hostnames or node group is provided.

Response syntax

When the hostnames request parameter is used, the following response syntax is received.

{
    "id": integer,
    "type": "RVC3",
    "status": "string",
    "message": "string",
    "trigged_by": "string",
    "parameters": {
        "method": "docker.report",
        "update_rpm": true,
        "params": {
          "includes": [
            "string"
          ]
        },
        "hostnames": [
            "string",
            "string"
        ]
    },
    "time_started": "timestamp"
}
When the node group or saved filter request parameters are used, the following response syntax is received.
{
    "id": integer,
    "type": "RVC3",
    "status": "string",
    "message": "string",
    "trigged_by": "string",
    "parameters": {
        "method": "docker.report",
        "update_rpm": true,
        "params": {
          "includes": [
            "string"
          ]
        },
        "node_group_name": "string",
        "node_group_id": integer,
        "saved_filter_name": "string",
        "saved_filter_id": integer
    },
    "time_started": "timestamp"
}

Response parameters

If the action is successful, an HTTP 200 response is returned. The following data is returned in JSON format.

FieldTypeDescription
idIntegerThe ID of the RVC job.
typeStringThe type of RVC job. For RVC jobs, it is RVC3.
statusStringThe status of the job.
messageStringThis field is reserved for internal use.
trigged_byStringThe username of the person who initiated the job.
parametersStringThe request parameters indicating the RVC method and request parameters as well as the hostnames, Node Groups, or saved filters the RVC job ran on.
time_startedTimestampThe timestamp indicating when the job started. The timestamp is given in ISO 8601 UTC datetime format.

Errors

For a list of potential errors, refer to the common errors, as this action does not have any unique error responses. For more information, see Common errors.

Examples

Example 1: Generate a report with all Docker data for a list of hostnames.

This example starts an RVC job to generate a report with all Docker data for a node with hostname sit0001red0.

ruby api.rb <customer_code> POST api/v2/jobs/rvc '{"method":"docker.report","hostnames":["sit0001red0"]}'

Response

{
  "id": 1598481,
  "type": "RVC3",
  "status": "pending",
  "message": null,
  "trigged_by": "test.user",
  "parameters": {
    "method": "docker.report",
    "update_rpm": true,
    "hostnames": [
      "sit0001red0"
    ]
  },
  "time_started": "2025-04-09T16:46:13Z"
}

Example 2: Generate a report with scoped Docker data for a list of hostnames.

This example starts an RVC job to generate a report with Docker data that only includes the containers and stats for a node with hostname sit0001red0.

ruby api.rb <customer_code> POST api/v2/jobs/rvc '{"method":"docker.report","params":{"includes":["containers","stats"]},"hostnames":["sit0001red0"]}'

Response

{
  "id": 1598525,
  "type": "RVC3",
  "status": "pending",
  "message": null,
  "trigged_by": "test.user",
  "parameters": {
    "method": "docker.report",
    "update_rpm": true,
    "params": {
      "includes": [
        "containers",
        "stats"
      ]
    },
    "hostnames": [
      "sit0001red0"
    ]
  },
  "time_started": "2025-04-09T20:23:26Z"
}

Example 3: Generate a report with all Docker data for all nodes in a specified node group.

This example starts an RVC job requesting a report with all Docker data for all nodes in node group Test Node Group.

ruby api.rb <customer_code> POST api/v2/jobs/rvc '{"method":"docker.report","node_group_name":"Test Node Group"}'

Response

{
  "id": 1596606,
  "type": "RVC3",
  "status": "pending",
  "message": null,
  "trigged_by": "test.user",
  "parameters": {
    "method": "docker.report",
    "update_rpm": true,
    "node_group_name": "Test Node Group"
  },
  "time_started": "2025-04-07T19:55:06Z"
}

Example 4: Retrieving the payload from the RVC job.

This example retrieves the result of an RVC job ID which displays the payload of the docker.report method.

ruby api.rb <customer_code> GET api/jobs/1598528\?include_payload=true

Response

{
  "id": 1598528,
  "type": "RVC3",
  "status": "finished",
  "message": null,
  "payload": {
    "sit0001red0": [
      {
        "result": [
          {
            "name": "images",
            "content": [
              {
                "ID": "d8279c0ec255",
                "Tag": "latest",
                "Size": "68.6MB",
                "Digest": "<none>",
                "CreatedAt": "2024-07-17 19:31:14 -0400 EDT",
                "Containers": "N/A",
                "Repository": "httpd",
                "SharedSize": "N/A",
                "UniqueSize": "N/A",
                "VirtualSize": "68.6MB",
                "CreatedSince": "8 months ago"
              }
            ]
          },
          {
            "name": "containers",
            "content": [
              {
                "ID": "032d2cdc8a9a",
                "Size": "0B",
                "Image": "httpd:latest",
                "Names": "docker-container-httpd-resource",
                "Ports": "80/tcp",
                "Labels": "",
                "Mounts": "",
                "Status": "Up 12 days",
                "Command": "\"httpd-foreground\"",
                "Networks": "customnetwork",
                "CreatedAt": "2025-03-27 20:35:43 -0400 EDT",
                "RunningFor": "12 days ago",
                "LocalVolumes": "0",
                "cluster_managed": false
              }
            ]
          },
          {
            "name": "stats",
            "content": [
              {
                "ID": "032d2cdc8a9ad3b512cb3ed02b8e92ed2a0081b0aca0493e2409adaaabbd77de",
                "Name": "docker-container-httpd-resource",
                "PIDs": "0",
                "NetIO": "0B / 0B",
                "BlockIO": "15.8MB / 0B",
                "CPUPerc": "0.01%",
                "MemPerc": "0.00%",
                "MemUsage": "0B / 0B",
                "Container": "032d2cdc8a9a",
                "cluster_managed": false
              }
            ]
          }
        ],
        "timestamp": 1744230583
      }
    ]
  },
  "trigged_by": "test.user",
  "success_nodes_count": 1,
  "failed_nodes_count": 0,
  "total_nodes_count": 1,
  "parameters": {
    "method": "docker.report",
    "hostnames": [
      "sit0001red0"
    ],
    "update_rpm": true
  },
  "time_started": "2025-04-09T20:29:38Z",
  "time_finished": "2025-04-09T20:29:42Z"
}