Lists a container’s consumers.
The list of consumers can be filtered by the parameters passed in via the URL.
Name | Type | Description |
---|---|---|
offset | integer | The starting index within the total list of the consumers that you would like to retrieve. |
limit | integer | The maximum number of records to return (up to 100). The default limit is 10. |
GET {container_ref}/consumers
Headers:
X-Auth-Token: <token>
200 OK
{
"total": 3,
"consumers": [
{
"status": "ACTIVE",
"URL": "consumerurl",
"updated": "2015-10-15T21:06:33.123878",
"name": "consumername",
"created": "2015-10-15T21:06:33.123872"
},
{
"status": "ACTIVE",
"URL": "consumerURL2",
"updated": "2015-10-15T21:17:08.092416",
"name": "consumername2",
"created": "2015-10-15T21:17:08.092408"
},
{
"status": "ACTIVE",
"URL": "consumerURL3",
"updated": "2015-10-15T21:21:29.970370",
"name": "consumername3",
"created": "2015-10-15T21:21:29.970365"
}
]
}
GET {container_ref}/consumers?limit=1&offset=1
Headers:
X-Auth-Token: <token>
{
"total": 3,
"next": "http://localhost:9311/v1/consumers?limit=1&offset=2",
"consumers": [
{
"status": "ACTIVE",
"URL": "consumerURL2",
"updated": "2015-10-15T21:17:08.092416",
"name": "consumername2",
"created": "2015-10-15T21:17:08.092408"
}
],
"previous": "http://localhost:9311/v1/consumers?limit=1&offset=0"
}
Code | Description |
---|---|
200 | Successful Request |
401 | Invalid X-Auth-Token or the token doesn’t have permissions to this resource |
Creates a consumer
Attribute Name | Type | Description | Default |
---|---|---|---|
name | string | The name of the consumer set by the user. | None |
url | string | The url for the user or service using the container. | None |
POST {container_ref}/consumers
Headers:
X-Auth-Token: <token>
Content:
{
"name": "ConsumerName",
"url": "ConsumerURL"
}
200 OK
{
"status": "ACTIVE",
"updated": "2015-10-15T17:56:18.626724",
"name": "container name",
"consumers": [
{
"URL": "consumerURL",
"name": "consumername"
}
],
"created": "2015-10-15T17:55:44.380002",
"container_ref": "http://localhost:9311/v1/containers/74bbd3fd-9ba8-42ee-b87e-2eecf10e47b9",
"creator_id": "b17c815d80f946ea8505c34347a2aeba",
"secret_refs": [
{
"secret_ref": "http://localhost:9311/v1/secrets/b61613fc-be53-4696-ac01-c3a789e87973",
"name": "private_key"
}
],
"type": "generic"
}
Delete a consumer.
Attribute Name | Type | Description | Default |
---|---|---|---|
name | string | The name of the consumer set by the user. | None |
URL | string | The url for the user or service using the container. | None |
POST {container_ref}/consumers
Headers:
X-Auth-Token: <token>
Content:
{
"name": "ConsumerName",
"URL": "ConsumerURL"
}
200 OK
{
"status": "ACTIVE",
"updated": "2015-10-15T17:56:18.626724",
"name": "container name",
"consumers": [],
"created": "2015-10-15T17:55:44.380002",
"container_ref": "http://localhost:9311/v1/containers/74bbd3fd-9ba8-42ee-b87e-2eecf10e47b9",
"creator_id": "b17c815d80f946ea8505c34347a2aeba",
"secret_refs": [
{
"secret_ref": "http://localhost:9311/v1/secrets/b61613fc-be53-4696-ac01-c3a789e87973",
"name": "private_key"
}
],
"type": "generic"
}
Code | Description |
---|---|
200 | OK |
401 | Invalid X-Auth-Token or the token doesn’t have permissions to this resource |
404 | Not Found |