List Containers

On This Page

Description

Returns information about all containers that are visible to the user who sent the request, according to its tenant (default), or about a specific container (see the <container> URL resource parameter).

Request

Request Header

Syntax

    GET /api/containers/[<container>] HTTP/1.1
    Host: <management-APIs URL>
    Content-Type: application/json
    Cookie: session=<cookie>

    url = "<management-APIs URL>/api/containers/[<container>]"
    headers = {
                "Content-Type": "application/json",
                "Cookie": "session=<cookie>"
              }

    HTTP Method

    GET

    URL Resource Parameters
    <container>
    The ID of a specific container for which to retrieve information.

    • Type: Integer
    • Requirement: Optional
    • Default Behavior: By default, when the <container> parameter is not set, the operation returns information for all containers of the user’s tenant.

    Request Data

    None

    Response

    Response Header

    Syntax
    HTTP/2.1 <status code; 200 on success> <reason phrase>
    Content-Type: application/json
    ...

    Response Data

    Syntax

      {
          "data": [
             {
                  "attributes": {
                      "admin_status": "string",
                      "cost":         number,
                      "created_at":   "string",
                      "data_lifecycle_layers_order":  [],
                      "data_policy_layers_order":     [],
                      "id":           number,
                      "imports": [],
                      "mapping": {
                          "cmds_index":   number,
                          "container_id": number,
                          "mds_instances": [
                              {
                                  "service_context": {
                                      "internal_xio_addresses": [
                                          {
                                              "url": "string"
                                          }
                                      ],
                                      "rest_addresses": [
                                          {
                                              "url": "string"
                                          }
                                      ],
                                      "shared_memory_objects": [
                                          {
                                              "address": "string",
                                              "type":    "string"
                                          }
                                      ],
                                      "shutdown": {
                                          "phase":    number,
                                          "timeout":  number
                                      },
                                      "version_info": {
                                          "external": "string",
                                          "git":      "string ",
                                          "offline":  "string "
                                      },
                                      "xio_addresses": [
                                          {
                                              "url": "string"
                                          }
                                      ]
                                  },
                                  "service_id": {
                                      "node_name":        "string",
                                      "service_instance": number,
                                      "service_name":     "string"
                                  }
                              }
                          ],
                          "num_slices": 0
                      },
                      "name":                 "string",
                      "operational_status":   "string",
                      "properties": [],
                      "updated_at":           "string"
                  },
                  "id":   number,
                  "type": "container"
              }
          ],
          ...
      }

      {
          "data": {
              "attributes": {
                  "admin_status": "string",
                  "cost":         number,
                  "created_at":   "string",
                  "data_lifecycle_layers_order":  [],
                  "data_policy_layers_order":     [],
                  "id":           number,
                  "imports": [],
                  "mapping": {
                      "cmds_index":   number,
                      "container_id": number,
                      "mds_instances": [
                          {
                              "service_context": {
                                  "internal_xio_addresses": [
                                      {
                                          "url": "string"
                                      }
                                  ],
                                  "rest_addresses": [
                                      {
                                          "url": "string"
                                      }
                                  ],
                                  "shared_memory_objects": [
                                      {
                                          "address": "string",
                                          "type":    "string"
                                      }
                                  ],
                                  "shutdown": {
                                      "phase":    number,
                                      "timeout":  number
                                  },
                                  "version_info": {
                                      "external": "string",
                                      "git":      "string ",
                                      "offline":  "string "
                                  },
                                  "xio_addresses": [
                                      {
                                          "url": "string"
                                      }
                                  ]
                              },
                              "service_id": {
                                  "node_name":        "string",
                                  "service_instance": number,
                                  "service_name":     "string"
                              }
                          }
                      ],
                      "num_slices": 0
                  },
                  "name":                 "string",
                  "operational_status":   "string",
                  "properties": [],
                  "updated_at":           "string"
              },
              "id":   number,
              "type": "container"
          },
          ...
      }

      Elements

      The data object in the HTTP response body contains an array of container-information JSON objects (default) or a single object (for a specific-container request). The returned container information includes the container’s name (name), ID (id), creation time (created_at), relevant addresses, and version information (version_info). Full the full list of returned data elements, see response-data syntax above.

      Examples

      Example 1

      Return information about all visible containers for the user’s tenant:

      Request

        GET /api/containers HTTP/1.1
        Host: https://dashboard.default-tenant.app.mycluster.iguazio.com
        Content-Type: application/json
        Cookie: session=j%3A%7B%22sid%22%3A%20%22a9ce242a-670f-47a8-9c8b-c6730f2794dc%22%7D

        import requests
        
        url = "https://dashboard.default-tenant.app.mycluster.iguazio.com/api/containers"
        headers = {"Cookie": "session=j%3A%7B%22sid%22%3A%20%22a9ce242a-670f-47a8-9c8b-c6730f2794dc%22%7D"}
        
        response = requests.get(url, headers=headers)
        print(response.text)

        Response

        The response includes an array with a single container-information object:

        HTTP/1.1 200 OK
        Content-Type: application/json
        ...
        {
            "data": [
                {
                    "attributes": {
                        "admin_status": "up",
                        "cost": 0.976715087890625,
                        "created_at": "2018-01-15T08:17:19.904000+00:00",
                        "data_lifecycle_layers_order": [],
                        "data_policy_layers_order": [],
                        "id": 1024,
                        "imports": [],
                        "mapping": {
                            "cmds_index": 0,
                            "container_id": 0,
                            "mds_instances": [
                                {
                                    "service_context": {
                                        "internal_xio_addresses": [
                                            {
                                                "url": "tcp:// 10.0.0.1:5000"
                                            }
                                        ],
                                        "rest_addresses": [
                                            {
                                                "url": "10.0.0.1:8154"
                                            }
                                        ],
                                        "shared_memory_objects": [
                                            {
                                                "address": "/dev/shm/mds.1_stats_metadata",
                                            "type": "statsMetadata"
                                        },
                                        {
                                            "address":
                                                "/dev/shm/mds.1_stats_values",
                                                "type": "statsValues"
                                            },
                                            {
                                                "address": "place_holder_for_log_shm",
                                                "type": "log"
                                            },
                                            {
                                                "address": "/dev/shm/mds.1_stats_names",
                                                "type": "statsMetricNames"
                                            }
                                        ],
                                        "shutdown": {
                                            "phase": 0,
                                            "timeout": 0
                                        },
                                        "version_info": {
                                            "external": "",
                                            "git": "",
                                            "offline": ""
                                        },
                                        "xio_addresses": [
                                            {
                                                "url": "tcp:// 10.0.0.1:5001"
                                            }
                                        ]
                                    },
                                    "service_id": {
                                        "node_name": "igz0",
                                        "service_instance": 1,
                                        "service_name": "mds"
                                    }
                                }
                            ],
                            "num_slices": 0
                        },
                        "name": "mycontainer",
                        "operational_status": "up",
                        "properties": [],
                        "updated_at": "2018-01-30T14:30:00.367000+00:00"
                    },
                    "id": 1024,
                    "type": "container"
                }
            ],
            ...
        }

        Example 2

        Return information about a specific container with ID 1024:

        Request

          GET /api/containers/1024 HTTP/1.1
          Host: https://dashboard.default-tenant.app.mycluster.iguazio.com
          Content-Type: application/json
          Cookie: session=j%3A%7B%22sid%22%3A%20%22a9ce242a-670f-47a8-9c8b-c6730f2794dc%22%7D

          import requests
          
          url = "https://dashboard.default-tenant.app.mycluster.iguazio.com/api/containers/1024"
          headers = {"Cookie": "session=j%3A%7B%22sid%22%3A%20%22a9ce242a-670f-47a8-9c8b-c6730f2794dc%22%7D"}
          
          response = requests.get(url, headers=headers)
          print(response.text)

          Response

          The response includes a single container-information object for the requested container (ID = 1024):

          HTTP/1.1 200 OK
          Content-Type: application/json
          ...
          {
              "data": {
                  "attributes": {
                      "admin_status": "up",
                      "cost": 0.976715087890625,
                      "created_at": "2018-01-15T08:17:19.904000+00:00",
                      "data_lifecycle_layers_order": [],
                      "data_policy_layers_order": [],
                      "id": 1024,
                      "imports": [],
                      "mapping": {
                          "cmds_index": 0,
                          "container_id": 0,
                          "mds_instances": [
                              {
                                  "service_context": {
                                      "internal_xio_addresses": [
                                          {
                                              "url": "tcp://10.0.0.1:5000"
                                          }
                                      ],
                                      "rest_addresses": [
                                          {
                                              "url": "10.0.0.1:8154"
                                          }
                                      ],
                                      "shared_memory_objects": [
                                          {
                                              "address": "/dev/shm/mds.1_stats_metadata",
                                              "type": "statsMetadata"
                                          },
                                          {
                                              "address": "/dev/shm/mds.1_stats_values",
                                              "type": "statsValues"
                                          },
                                          {
                                              "address": "place_holder_for_log_shm",
                                              "type": "log"
                                          },
                                          {
                                              "address": "/dev/shm/mds.1_stats_names",
                                              "type": "statsMetricNames"
                                          }
                                      ],
                                      "shutdown": {
                                          "phase": 0,
                                          "timeout": 0
                                      },
                                      "version_info": {
                                          "external": "",
                                          "git": "",
                                          "offline": ""
                                      },
                                      "xio_addresses": [
                                          {
                                              "url": "tcp://10.0.0.1:5001"
                                          }
                                      ]
                                  },
                                  "service_id": {
                                      "node_name": "igz0",
                                      "service_instance": 1,
                                      "service_name": "mds"
                                  }
                              }
                          ],
                          "num_slices": 0
                      },
                      "name": "mycontainer",
                      "operational_status": "up",
                      "properties": [],
                      "updated_at": "2018-01-30T14:30:00.367000+00:00"
                  },
                  "id": 1024,
                  "type": "container"
              },
              ...
          }