List all containers
get
/api/containers/
Retrieves a list of all containers with details.
Note: This endpoint is deprecated and will no longer be available in the future release.
Request
There are no request parameters for this operation.
Security
-
Authorization: apiKey
Type:
apiKey
Response
Supported Media Types
- application/json
200 Response
200 Response
Nested Schema : container
Type:
Show Source
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
Error Payload
Examples
The following example shows how to retrieve a list of containers in your Oracle Container Cloud Service environment. 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/"
Example of Response Body
[
{
"host_id": "host_id",
"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",
"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
}
},
"deployment_id": "Redis-20161024-155609",
"deployment_name": "Redis",
"service_id": "redis",
"service_slot": "0"
}
]