Get a detailed list of Docker containers from a specific host
/api/hosts/{host_id}/containers/
Retrieves a detailed list of the Docker containers deployed on a specific host. You identify the host with the host_id parameter.
Note: This endpoint is deprecated and will no longer be available in the future release.
Request
-
host_id: string
host_id
-
Authorization: apiKey
Type:
apiKey
Response
- application/json
200 Response
object
-
Args:
array Args
-
Config:
object Config
-
Created:
string
-
Driver:
string
-
HostConfig:
object HostConfig
-
HostnamePath:
string
-
HostsPath:
string
-
Id:
string
-
Image:
string
-
LogPath:
string
-
Mounts:
array Mounts
-
Name:
string
-
NetworkSettings:
object NetworkSettings
-
Node:
object Node
-
Path:
string
-
ResolvConfPath:
string
-
State:
object State
Default Response
Examples
The following example shows how to retrieve a list of the Docker containers deployed on a specific host. The response body includes a detailed report about each container deployed on the 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 b39f09c71c297f1d"
"https://rest_server_url/api/hosts/host_id/containers/"
In this example, replace host_id ID of the host, which you can find by using a GET method on the /api/hosts
endpoint.
Example of Response Body
[
{
"host_id": "host_id",
"container_id": "75fec4c0091c2861aa066c299e83d202364ee7a72dc04645df721d6663997570",
"name": "/0.redis.Redis-20161026-165916",
"hostname_path": "/u01/data/docker/containers/75fec4c0091c2861aa066c299e83d202364ee7a72dc04645df721d6663997570/hostname",
"hostname": "demowkr0",
"image_id": "sha256:2aabafe89cbffe63a812e3965137f36df73488488a6ad4ba641272a3cf384cd1",
"command": "redis-server",
"state": "Running",
"action_state": "",
"started_at": "2016-10-26T18:27:58.486676199-04:00",
"container": {
"Id": "75fec4c0091c2861aa066c299e83d202364ee7a72dc04645df721d6663997570",
"Created": "2016-10-26T18:27:56.975654157-04:00",
"Path": "docker-entrypoint.sh",
"Args": [
"redis-server"
],
"Config": {
"Hostname": "0.redis.Redis-20161026-165916",
"ExposedPorts": {
"6379/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_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-20161026-165916",
"OCCS_DEPLOYMENT_NAME=Redis",
"OCCS_ENVIRONMENT_ID=",
"OCCS_DEPLOYMENT_SERVICE_IDS=redis",
"OCCS_DEPLOYMENT_CREATED_BY=admin",
"OCCS_DEPLOYMENT_KEY=Redis-20161026-165916/redis/default/0",
"OCCS_CONTAINER_KEY=0.redis.Redis-20161026-165916",
"OCCS_CONTAINER_NAME=0.redis.Redis-20161026-165916",
"OCCS_CONTAINER_HOSTNAME=0.redis.Redis-20161026-165916",
"OCCS_PENDING_ID=b0c7a853-e937-4fe6-a9f5-b0d030cc3f0b",
"OCCS_HOSTNAME=demowkr0",
"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": 30837,
"StartedAt": "2016-10-26T18:27:58.486676199-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": "5b86539d81b54b96bd01dec46799642408740668a29e8efe5901ce89298c9017"
}
},
"IPAddress": "ip_address",
"IPPrefixLen": 16,
"MacAddress": "02:42:ac:11:00:02",
"Gateway": "ip_address",
"Ports": {
"6379/tcp": null
},
"EndpointID": "5b86539d81b54b96bd01dec46799642408740668a29e8efe5901ce89298c9017",
"SandboxKey": "/var/run/docker/netns/e159cd11c725"
},
"ResolvConfPath": "/u01/data/docker/containers/75fec4c0091c2861aa066c299e83d202364ee7a72dc04645df721d6663997570/resolv.conf",
"HostnamePath": "/u01/data/docker/containers/75fec4c0091c2861aa066c299e83d202364ee7a72dc04645df721d6663997570/hostname",
"HostsPath": "/u01/data/docker/containers/75fec4c0091c2861aa066c299e83d202364ee7a72dc04645df721d6663997570/hosts",
"LogPath": "/u01/data/docker/containers/75fec4c0091c2861aa066c299e83d202364ee7a72dc04645df721d6663997570/75fec4c0091c2861aa066c299e83d202364ee7a72dc04645df721d6663997570-json.log",
"Name": "/0.redis.Redis-20161026-165916",
"Driver": "overlay",
"Mounts": [
{
"Name": "dba4c4f4b7420a217c0fa7c5e5ebe71ca8a43a6880ea7a3f93685dcd803e5d4f",
"Source": "/u01/data/docker/volumes/dba4c4f4b7420a217c0fa7c5e5ebe71ca8a43a6880ea7a3f93685dcd803e5d4f/_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
}
}
}
]