Get details of a container on a specified host

get

/api/containers/{container_id}/host/{host_id}

Retrieves details of the specified container (identified with the container_id parameter) on a specified host (identified with host_id).

Request

Path Parameters
Security
Back to Top

Response

Supported Media Types

200 Response

200 Response
Body ()
Root Schema : schema
Type: array
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : container
Type: object
Show Source
Nested Schema : Args
Type: array
Show Source
Nested Schema : Config
Type: object
Show Source
Nested Schema : HostConfig
Type: object
Show Source
Nested Schema : Mounts
Type: array
Show Source
Nested Schema : NetworkSettings
Type: object
Show Source
Nested Schema : Node
Type: object
Show Source
Nested Schema : State
Type: object
Show Source
Nested Schema : Cmd
Type: array
Show Source
Nested Schema : Entrypoint
Type: array
Show Source
Nested Schema : Env
Type: array
Show Source
Nested Schema : ExposedPorts
Type: object
Show Source
Nested Schema : Volumes
Type: object
Show Source
Nested Schema : 6379~1tcp
Type: object
Show Source
Nested Schema : ~1data
Type: object
Show Source
Nested Schema : Binds
Type: array
Show Source
Nested Schema : LogConfig
Type: object
Show Source
Nested Schema : RestartPolicy
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : Networks
Type: object
Show Source
Nested Schema : Ports
Type: object
Show Source
Nested Schema : bridge
Type: object
Show Source

Default Response

Error Payload
Body ()
Root Schema : schema
Type: array
Show Source
Back to Top

Examples

The following example shows how to get the details about specific container on a specific host. You perform this task by submitting a GET request to the REST resource using cURL. For more information about cURL, see Use cURL.

Note: The command in this example uses the URL structure https://rest_server_url/resource-path, where rest_server_url is the manager node for the Oracle Cloud Container instance. See Send Requests for the appropriate URL structure to use for Oracle Public Cloud.

cURL Command

curl -sk 
     -X "GET" 
     -H "Authorization: Bearer 34660008cea7eeda" 
     "https://rest_server_url/api/containers/container_id/host/host_id"

In this example:

  • Replace container_id with the ID of the container, which you can get by listing the containers in the Oracle Container Cloud Service console or by using the /api/containers REST API endpoint

  • Replace host_id with the ID of the host, which you can get using the /api/hosts endpoint.

Example of Response Body

{
  "host_id": "host_id",
  "container": {
    "Id": "0af8f86f95c1f63802d8dca35519892cab39bb59ecb53e50cbc5f5a19ad61303",
    "Created": "2016-10-24T16:55:38.89130665-04:00",
    "Path": "docker-entrypoint.sh",
    "Args": [
      "redis-server"
    ],
    "Config": {
      "Hostname": "0.redis.Redis-20161024-155609",
      "ExposedPorts": {
        "6379/tcp": {},
        "65500/tcp": {}
      },
      "Env": [
        "occs:availability=per-pool",
        "occs:scheduler=random",
        "occs:description=The official Redis image. This example is provided as-is for educational purposes and should not be used in production.",
        "OCCS_SERVICE_ID=redis",
        "OCCS_COMMAND=",
        "OCCS_COMPOSE_EXPOSE=[\"65500\"]",
        "OCCS_REMOVE_ON_DIE=true",
        "OCCS_CONTAINER_DEATH_LOG_LINES=1000",
        "constraint:pool_id==default",
        "occs:availability_hosts=host_id",
        "OCCS_SERVICE_SLOT=0",
        "OCCS_HOST_GROUP=default",
        "OCCS_STACK_ID=redis",
        "OCCS_STACK_NAME=Redis",
        "OCCS_DEPLOYMENT_ID=Redis-20161024-155609",
        "OCCS_DEPLOYMENT_NAME=Redis",
        "OCCS_ENVIRONMENT_ID=",
        "OCCS_DEPLOYMENT_SERVICE_IDS=redis",
        "OCCS_DEPLOYMENT_CREATED_BY=admin",
        "OCCS_DEPLOYMENT_KEY=Redis-20161024-155609/redis/default/0",
        "OCCS_CONTAINER_KEY=0.redis.Redis-20161024-155609",
        "OCCS_CONTAINER_NAME=0.redis.Redis-20161024-155609",
        "OCCS_CONTAINER_HOSTNAME=0.redis.Redis-20161024-155609",
        "OCCS_PENDING_ID=789b06de-6772-4dfa-8d29-301687fd51c0",
        "OCCS_HOSTNAME=dual",
        "OCCS_HOSTID=host_id",
        "OCCS_HOSTIPS=eth0: ip_address, docker0: ip_address, public_ip: ip_address",
        "OCCS_HOSTIP=ip_address",
        "OCCS_CONTAINER_MAPPED_ENV=/u01/data/occs-cluster-agent/containers/env",
        "OCCS_CONTROLLER_STARTED=true",
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
        "REDIS_VERSION=3.2.1",
        "REDIS_DOWNLOAD_URL=http://download.redis.io/releases/redis-3.2.1.tar.gz",
        "REDIS_DOWNLOAD_SHA1=26c0fc282369121b4e278523fce122910b65fbbf"
      ],
      "Cmd": [
        "redis-server"
      ],
      "Image": "redis:3.2.1-alpine",
      "Volumes": {
        "/data": {}
      },
      "WorkingDir": "/data",
      "Entrypoint": [
        "docker-entrypoint.sh"
      ]
    },
    "State": {
      "Running": true,
      "Pid": 2360,
      "StartedAt": "2016-10-24T16:55:40.509750986-04:00",
      "FinishedAt": "0000-12-31T19:00:01.025114112-05:00"
    },
    "Image": "sha256:2aabafe89cbffe63a812e3965137f36df73488488a6ad4ba641272a3cf384cd1",
    "Node": {},
    "NetworkSettings": {
      "Networks": {
        "bridge": {
          "MacAddress": "02:42:ac:11:00:02",
          "IPPrefixLen": 16,
          "IPAddress": "ip_address",
          "Gateway": "ip_address",
          "EndpointID": "d67b2910c1d550d49e0c2510ad5717f05dca1a933c1e61cb7217c91a97927e84"
        }
      },
      "IPAddress": "ip_address",
      "IPPrefixLen": 16,
      "MacAddress": "02:42:ac:11:00:02",
      "Gateway": "ip_address",
      "Ports": {
        "6379/tcp": null,
        "65500/tcp": null
      },
      "EndpointID": "d67b2910c1d550d49e0c2510ad5717f05dca1a933c1e61cb7217c91a97927e84",
      "SandboxKey": "/var/run/docker/netns/c0dfb463a7ab"
    },
    "ResolvConfPath": "/u01/data/docker/containers/0af8f86f95c1f63802d8dca35519892cab39bb59ecb53e50cbc5f5a19ad61303/resolv.conf",
    "HostnamePath": "/u01/data/docker/containers/0af8f86f95c1f63802d8dca35519892cab39bb59ecb53e50cbc5f5a19ad61303/hostname",
    "HostsPath": "/u01/data/docker/containers/0af8f86f95c1f63802d8dca35519892cab39bb59ecb53e50cbc5f5a19ad61303/hosts",
    "LogPath": "/u01/data/docker/containers/0af8f86f95c1f63802d8dca35519892cab39bb59ecb53e50cbc5f5a19ad61303/0af8f86f95c1f63802d8dca35519892cab39bb59ecb53e50cbc5f5a19ad61303-json.log",
    "Name": "/0.redis.Redis-20161024-155609",
    "Driver": "overlay",
    "Mounts": [
      {
        "Name": "214e46ae980f9f7415e38563f70c903aede014a6619db74f257e3142d6f7900f",
        "Source": "/u01/data/docker/volumes/214e46ae980f9f7415e38563f70c903aede014a6619db74f257e3142d6f7900f/_data",
        "Destination": "/data",
        "Driver": "local",
        "Mode": "",
        "RW": true
      },
      {
        "Name": "",
        "Source": "/u01/data/occs-cluster-agent/containers/env",
        "Destination": "/u01/data/occs-cluster-agent/containers/env",
        "Driver": "",
        "Mode": "",
        "RW": true
      }
    ],
    "HostConfig": {
      "Binds": [
        "/u01/data/occs-cluster-agent/containers/env:/u01/data/occs-cluster-agent/containers/env"
      ],
      "NetworkMode": "default",
      "RestartPolicy": {},
      "LogConfig": {
        "Type": "json-file"
      },
      "MemorySwappiness": -1
    }
  },
  "container_id": "0af8f86f95c1f63802d8dca35519892cab39bb59ecb53e50cbc5f5a19ad61303",
  "name": "/0.redis.Redis-20161024-155609",
  "hostname_path": "/u01/data/docker/containers/0af8f86f95c1f63802d8dca35519892cab39bb59ecb53e50cbc5f5a19ad61303/hostname",
  "hostname": "dual",
  "image_id": "sha256:2aabafe89cbffe63a812e3965137f36df73488488a6ad4ba641272a3cf384cd1",
  "command": "redis-server",
  "state": "Running",
  "action_state": "",
  "started_at": "2016-10-24T16:55:40.509750986-04:00",
  "deployment_id": "Redis-20161024-155609",
  "deployment_name": "Redis",
  "service_id": "redis",
  "service_slot": "0"
}
Back to Top