You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by an...@apache.org on 2016/10/08 02:30:34 UTC
[03/27] libcloud git commit: everything is perfect; add tests
everything is perfect; add tests
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/d179167a
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/d179167a
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/d179167a
Branch: refs/heads/trunk
Commit: d179167ab8d7ff98a19cbd9440d08ea0c496e3cb
Parents: 5b17bdf
Author: Mario Loria <ma...@arroyonetworks.com>
Authored: Fri Oct 7 20:46:15 2016 -0400
Committer: Anthony Shaw <an...@apache.org>
Committed: Sat Oct 8 13:29:22 2016 +1100
----------------------------------------------------------------------
libcloud/container/drivers/rancher.py | 5 +-
.../fixtures/rancher/deploy_container.json | 109 ++++
.../fixtures/rancher/ex_activate_service.json | 198 +++++++
.../fixtures/rancher/ex_activate_stack.json | 52 ++
.../fixtures/rancher/ex_deploy_service.json | 66 +++
.../fixtures/rancher/ex_deploy_stack.json | 40 ++
.../fixtures/rancher/ex_destroy_service.json | 66 +++
.../fixtures/rancher/ex_destroy_stack.json | 40 ++
.../fixtures/rancher/ex_list_services.json | 536 +++++++++++++++++++
.../fixtures/rancher/ex_list_stacks.json | 310 +++++++++++
.../fixtures/rancher/ex_search_containers.json | 212 ++++++++
.../fixtures/rancher/ex_search_services.json | 346 ++++++++++++
.../fixtures/rancher/list_containers.json | 336 ++++++++++++
.../fixtures/rancher/stop_container.json | 109 ++++
libcloud/test/container/test_rancher.py | 245 +++++++++
15 files changed, 2667 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/container/drivers/rancher.py
----------------------------------------------------------------------
diff --git a/libcloud/container/drivers/rancher.py b/libcloud/container/drivers/rancher.py
index 9bf810a..c0d2f9d 100644
--- a/libcloud/container/drivers/rancher.py
+++ b/libcloud/container/drivers/rancher.py
@@ -24,7 +24,6 @@ from libcloud.utils.py3 import httplib
from libcloud.utils.py3 import b
from libcloud.common.base import JsonResponse, ConnectionUserAndKey
-from libcloud.common.types import InvalidCredsError
from libcloud.container.base import (Container, ContainerDriver,
ContainerImage)
@@ -200,7 +199,7 @@ class RancherContainerDriver(ContainerDriver):
"rancherCompose": rancher_compose,
"startOnCreate": start
}
- data = json.dumps(dict((k,v) for (k,v) in payload.items()
+ data = json.dumps(dict((k, v) for (k, v) in payload.items()
if v is not None))
result = self.connection.request('%s/environments' %
self.baseuri, data=data,
@@ -391,7 +390,7 @@ class RancherContainerDriver(ContainerDriver):
"vip": vip
}
- data = json.dumps(dict((k,v) for (k,v) in service_payload.items()
+ data = json.dumps(dict((k, v) for (k, v) in service_payload.items()
if v is not None))
result = self.connection.request('%s/services' % self.baseuri,
data=data, method='POST').object
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/deploy_container.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/deploy_container.json b/libcloud/test/container/fixtures/rancher/deploy_container.json
new file mode 100644
index 0000000..bfe0963
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/deploy_container.json
@@ -0,0 +1,109 @@
+{
+ "id": "1i31",
+ "type": "container",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/containers/1i31",
+ "account": "http://172.30.0.100:8080/v1/containers/1i31/account",
+ "credentials": "http://172.30.0.100:8080/v1/containers/1i31/credentials",
+ "healthcheckInstanceHostMaps": "http://172.30.0.100:8080/v1/containers/1i31/healthcheckinstancehostmaps",
+ "hosts": "http://172.30.0.100:8080/v1/containers/1i31/hosts",
+ "instanceLabels": "http://172.30.0.100:8080/v1/containers/1i31/instancelabels",
+ "instanceLinks": "http://172.30.0.100:8080/v1/containers/1i31/instancelinks",
+ "instances": "http://172.30.0.100:8080/v1/containers/1i31/instances",
+ "mounts": "http://172.30.0.100:8080/v1/containers/1i31/mounts",
+ "ports": "http://172.30.0.100:8080/v1/containers/1i31/ports",
+ "serviceEvents": "http://172.30.0.100:8080/v1/containers/1i31/serviceevents",
+ "serviceExposeMaps": "http://172.30.0.100:8080/v1/containers/1i31/serviceexposemaps",
+ "services": "http://172.30.0.100:8080/v1/containers/1i31/services",
+ "targetInstanceLinks": "http://172.30.0.100:8080/v1/containers/1i31/targetinstancelinks",
+ "volumes": "http://172.30.0.100:8080/v1/containers/1i31/volumes",
+ "stats": "http://172.30.0.100:8080/v1/containers/1i31/stats",
+ "containerStats": "http://172.30.0.100:8080/v1/containers/1i31/containerstats"
+ },
+ "actions": {
+ "update": "http://172.30.0.100:8080/v1/containers/1i31/?action=update",
+ "error": "http://172.30.0.100:8080/v1/containers/1i31/?action=error",
+ "remove": "http://172.30.0.100:8080/v1/containers/1i31/?action=remove",
+ "start": "http://172.30.0.100:8080/v1/containers/1i31/?action=start",
+ "logs": "http://172.30.0.100:8080/v1/containers/1i31/?action=logs",
+ "setlabels": "http://172.30.0.100:8080/v1/containers/1i31/?action=setlabels"
+ },
+ "name": "newcontainer",
+ "state": "running",
+ "accountId": "1a5",
+ "blkioDeviceOptions": null,
+ "build": null,
+ "capAdd": null,
+ "capDrop": null,
+ "command": null,
+ "cpuSet": null,
+ "cpuShares": null,
+ "createIndex": null,
+ "created": "2016-10-06T15:55:58Z",
+ "createdTS": 1475769358000,
+ "dataVolumeMounts": {},
+ "dataVolumes": [],
+ "dataVolumesFrom": null,
+ "deploymentUnitUuid": null,
+ "description": null,
+ "devices": null,
+ "dns": [
+ "169.254.169.250"
+ ],
+ "dnsSearch": [
+ "rancher.internal"
+ ],
+ "dockerPorts": [],
+ "domainName": null,
+ "entryPoint": null,
+ "environment": {
+ "STORAGE_TYPE": "file"
+ },
+ "expose": null,
+ "externalId": "ab334bd25d25db7b94fdcead8f5c023b05bed424f56243187aa90f5ef7f07b09",
+ "extraHosts": null,
+ "firstRunning": "2016-10-06T15:56:00Z",
+ "firstRunningTS": 1475769360000,
+ "healthCheck": null,
+ "healthState": null,
+ "hostId": "1h1",
+ "hostname": null,
+ "imageUuid": "docker:rlister/hastebin:latest",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.uuid": "6d3dcf5f-28b8-4e60-9bf1-618b76a9a805",
+ "io.rancher.container.name": "newcontainer",
+ "io.rancher.container.ip": "10.42.204.104/16"
+ },
+ "logConfig": null,
+ "lxcConf": null,
+ "memory": null,
+ "memorySwap": null,
+ "nativeContainer": false,
+ "networkContainerId": null,
+ "networkMode": "managed",
+ "pidMode": null,
+ "ports": null,
+ "primaryIpAddress": "10.42.204.104",
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "registryCredentialId": null,
+ "removed": null,
+ "requestedHostId": null,
+ "restartPolicy": null,
+ "securityOpt": null,
+ "startCount": 1,
+ "startOnCreate": true,
+ "stdinOpen": false,
+ "systemContainer": null,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "tty": false,
+ "user": null,
+ "uuid": "6d3dcf5f-28b8-4e60-9bf1-618b76a9a805",
+ "version": "0",
+ "volumeDriver": null,
+ "workingDir": null
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/ex_activate_service.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/ex_activate_service.json b/libcloud/test/container/fixtures/rancher/ex_activate_service.json
new file mode 100644
index 0000000..a103ef5
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/ex_activate_service.json
@@ -0,0 +1,198 @@
+{
+ "id": "1s6",
+ "type": "service",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/services/1s6",
+ "account": "http://172.30.0.100:8080/v1/services/1s6/account",
+ "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s6/consumedbyservices",
+ "consumedservices": "http://172.30.0.100:8080/v1/services/1s6/consumedservices",
+ "environment": "http://172.30.0.100:8080/v1/services/1s6/environment",
+ "instances": "http://172.30.0.100:8080/v1/services/1s6/instances",
+ "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s6/serviceexposemaps",
+ "containerStats": "http://172.30.0.100:8080/v1/services/1s6/containerstats"
+ },
+ "actions": {
+ "update": "http://172.30.0.100:8080/v1/services/1s6/?action=update",
+ "restart": "http://172.30.0.100:8080/v1/services/1s6/?action=restart",
+ "remove": "http://172.30.0.100:8080/v1/services/1s6/?action=remove",
+ "setservicelinks": "http://172.30.0.100:8080/v1/services/1s6/?action=setservicelinks",
+ "removeservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=removeservicelink",
+ "upgrade": "http://172.30.0.100:8080/v1/services/1s6/?action=upgrade",
+ "addservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=addservicelink",
+ "deactivate": "http://172.30.0.100:8080/v1/services/1s6/?action=deactivate"
+ },
+ "name": "123",
+ "state": "active",
+ "accountId": "1a5",
+ "assignServiceIpAddress": false,
+ "createIndex": 1,
+ "created": "2016-09-22T18:28:04Z",
+ "createdTS": 1474568884000,
+ "currentScale": 1,
+ "description": null,
+ "environmentId": "1e2",
+ "externalId": null,
+ "fqdn": null,
+ "healthState": "healthy",
+ "kind": "service",
+ "launchConfig": {
+ "capAdd": [],
+ "capDrop": [],
+ "count": null,
+ "cpuSet": null,
+ "cpuShares": null,
+ "dataVolumes": [],
+ "dataVolumesFrom": [],
+ "description": null,
+ "devices": [],
+ "dns": [],
+ "dnsSearch": [],
+ "domainName": null,
+ "hostname": null,
+ "imageUuid": "docker:ubuntu:trusty",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.pull_image": "always"
+ },
+ "logConfig": {
+ "config": {},
+ "driver": ""
+ },
+ "memory": null,
+ "memoryMb": null,
+ "memorySwap": null,
+ "networkMode": "managed",
+ "pidMode": null,
+ "ports": [],
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "requestedIpAddress": null,
+ "startOnCreate": true,
+ "stdinOpen": true,
+ "tty": true,
+ "user": null,
+ "userdata": null,
+ "version": "0bdea468-c3e9-4562-951c-d543958e966a",
+ "volumeDriver": null,
+ "workingDir": null,
+ "dataVolumesFromLaunchConfigs": [],
+ "networkLaunchConfig": null,
+ "vcpu": 1
+ },
+ "metadata": null,
+ "publicEndpoints": null,
+ "removed": null,
+ "retainIp": null,
+ "scale": 1,
+ "scalePolicy": null,
+ "secondaryLaunchConfigs": [],
+ "selectorContainer": null,
+ "selectorLink": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "upgrade": {
+ "inServiceStrategy": {
+ "batchSize": 1,
+ "intervalMillis": 2000,
+ "launchConfig": {
+ "capAdd": [],
+ "capDrop": [],
+ "count": null,
+ "cpuSet": null,
+ "cpuShares": null,
+ "dataVolumes": [],
+ "dataVolumesFrom": [],
+ "description": null,
+ "devices": [],
+ "dns": [],
+ "dnsSearch": [],
+ "domainName": null,
+ "hostname": null,
+ "imageUuid": "docker:ubuntu:trusty",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.pull_image": "always"
+ },
+ "logConfig": {
+ "config": {},
+ "driver": ""
+ },
+ "memory": null,
+ "memoryMb": null,
+ "memorySwap": null,
+ "networkMode": "managed",
+ "pidMode": null,
+ "ports": [],
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "requestedIpAddress": null,
+ "startOnCreate": true,
+ "stdinOpen": true,
+ "tty": true,
+ "user": null,
+ "userdata": null,
+ "version": "0bdea468-c3e9-4562-951c-d543958e966a",
+ "volumeDriver": null,
+ "workingDir": null,
+ "dataVolumesFromLaunchConfigs": [],
+ "networkLaunchConfig": null,
+ "vcpu": 1
+ },
+ "previousLaunchConfig": {
+ "capAdd": [],
+ "capDrop": [],
+ "count": null,
+ "cpuSet": null,
+ "cpuShares": null,
+ "dataVolumes": [],
+ "dataVolumesFrom": [],
+ "description": null,
+ "devices": [],
+ "dns": [],
+ "dnsSearch": [],
+ "domainName": null,
+ "hostname": null,
+ "imageUuid": "docker:ubuntu:trusty",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.pull_image": "always"
+ },
+ "logConfig": {
+ "config": {},
+ "driver": ""
+ },
+ "memory": null,
+ "memoryMb": null,
+ "memorySwap": null,
+ "networkMode": "managed",
+ "pidMode": null,
+ "ports": [],
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "requestedIpAddress": null,
+ "startOnCreate": true,
+ "stdinOpen": true,
+ "tty": true,
+ "user": null,
+ "userdata": null,
+ "version": "0",
+ "volumeDriver": null,
+ "workingDir": null,
+ "dataVolumesFromLaunchConfigs": [],
+ "networkLaunchConfig": null,
+ "vcpu": 1
+ },
+ "previousSecondaryLaunchConfigs": [],
+ "secondaryLaunchConfigs": [],
+ "startFirst": true
+ },
+ "toServiceStrategy": null
+ },
+ "uuid": "c0ae4d08-e20a-45ef-9fb9-ad9f7cdeeb15",
+ "vip": null
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/ex_activate_stack.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/ex_activate_stack.json b/libcloud/test/container/fixtures/rancher/ex_activate_stack.json
new file mode 100644
index 0000000..65148eb
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/ex_activate_stack.json
@@ -0,0 +1,52 @@
+{
+ "id": "1e1",
+ "type": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments/1e1",
+ "account": "http://172.30.0.100:8080/v1/environments/1e1/account",
+ "services": "http://172.30.0.100:8080/v1/environments/1e1/services",
+ "composeConfig": "http://172.30.0.100:8080/v1/environments/1e1/composeconfig"
+ },
+ "actions": {
+ "upgrade": "http://172.30.0.100:8080/v1/environments/1e1/?action=upgrade",
+ "update": "http://172.30.0.100:8080/v1/environments/1e1/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/environments/1e1/?action=remove",
+ "addoutputs": "http://172.30.0.100:8080/v1/environments/1e1/?action=addoutputs",
+ "activateservices": "http://172.30.0.100:8080/v1/environments/1e1/?action=activateservices",
+ "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e1/?action=deactivateservices",
+ "exportconfig": "http://172.30.0.100:8080/v1/environments/1e1/?action=exportconfig"
+ },
+ "name": "Concrete5",
+ "state": "active",
+ "accountId": "1a5",
+ "created": "2016-09-22T17:58:53Z",
+ "createdTS": 1474567133000,
+ "description": null,
+ "dockerCompose": "CMSMysql:\r\n environment:\r\n MYSQL_ROOT_PASSWORD: ${root_password}\r\n MYSQL_DATABASE: ${db_name}\r\n MYSQL_USER: ${db_username}\r\n MYSQL_PASSWORD: ${db_password}\r\n labels:\r\n io.rancher.container.pull_image: always\r\n tty: true\r\n image: mysql\r\n volumes:\r\n - ${db_data_location}:/var/lib/mysql\r\n stdin_open: true\r\n volume_driver: ${volume_driver}\r\n\r\nCMSConfig:\r\n image: opensaas/concrete5\r\n tty: true\r\n stdin_open: true\r\n links:\r\n - CMSMysql:mysql\r\n volumes:\r\n - ${cms_application_data}:/var/www/html/application\r\n - ${cms_packages_data}:/var/www/html/packages\r\n labels:\r\n io.rancher.container.hostname_override: container_name\r\n io.rancher.container.start_once: true\r\n volume_driver: ${volume_driver}\r\n command: bash -c \"chown -R www-data. application; chown -R www-data. packages; sleep 2m; php -f concrete/bin/concrete5.
php c5:install --db-server=mysql --db-username=${db_username} --db-password=${db_password} --db-database=${db_name} --site=${cms_sitename} --admin-email=${cms_admin_email} --admin-password=${cms_admin_password} -n -vvv\"\r\n\r\nConcrete5App:\r\n labels:\r\n io.rancher.container.pull_image: always\r\n io.rancher.sidekicks: CMSConfig\r\n tty: true\r\n links:\r\n - CMSMysql:mysql\r\n image: opensaas/concrete5\r\n volumes:\r\n - ${cms_application_data}:/var/www/html/application\r\n - ${cms_packages_data}:/var/www/html/packages\r\n volume_driver: ${volume_driver}\r\n stdin_open: true",
+ "environment": {
+ "root_password": "password",
+ "db_name": "CMS_DB",
+ "db_username": "CMS_USER",
+ "db_password": "password",
+ "db_data_location": "CMS_DB_DATA",
+ "volume_driver": "",
+ "cms_application_data": "CMS_APP_DATA",
+ "cms_packages_data": "CMS_PACK_DATA",
+ "cms_admin_email": "admin@example.com",
+ "cms_admin_password": "password",
+ "cms_sitename": "MySite"
+ },
+ "externalId": "catalog://community:Concrete5:1",
+ "healthState": "unhealthy",
+ "kind": "environment",
+ "outputs": null,
+ "previousEnvironment": null,
+ "previousExternalId": null,
+ "rancherCompose": ".catalog:\r\n name: \"Concrete5\"\r\n version: \"v0.2\"\r\n description: \"Concrete5 CMS\"\r\n uuid: Concrete5-1\r\n minimum_rancher_version: v0.51.0\r\n questions:\r\n - variable: root_password\r\n description: \"MySQL root password - keep this password complex and secure\"\r\n label: \"MySQL Root Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: db_name\r\n description: \"MySQL Database Name - to use in the Concrete5 setup\"\r\n label: \"MySQL Database Name\"\r\n required: true\r\n default: \"CMS_DB\"\r\n type: \"string\"\r\n - variable: db_username\r\n description: \"MySQL Username - to use in the Concrete5 setup\"\r\n label: \"MySQL Username\"\r\n required: true\r\n default: \"CMS_USER\"\r\n type: \"string\"\r\n - variable: db_password\r\
n description: \"MySQL password for the above user - to use in the Concrete5 setup\"\r\n label: \"MySQL Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: db_data_location\r\n description: \"Location on the host for the database files\"\r\n label: \"DB Data Location\"\r\n required: true\r\n default: \"CMS_DB_DATA\"\r\n type: \"string\"\r\n - variable: volume_driver\r\n description: \"Volume Driver for the persistant data locations requires docker 1.7\"\r\n label: \"Volume Driver\"\r\n type: \"string\"\r\n - variable: cms_application_data\r\n description: \"Concrcte5 application folder for persistant data storage\"\r\n label: \"Application Folder\"\r\n required: true\r\n default: \"CMS_APP_DATA\"\r\n type: \"string\"\r\n - variable: cms_packages_data\r\n
description: \"Concrcte5 packages folder for persistant data storage\"\r\n label: \"Packages Folder\"\r\n required: true\r\n default: \"CMS_PACK_DATA\"\r\n type: \"string\"\r\n - variable: cms_admin_email\r\n description: \"Concrcete5 admin email address\"\r\n label: \"Admin Email\"\r\n required: true\r\n default: \"admin@example.com\"\r\n type: \"string\"\r\n - variable: cms_admin_password\r\n description: \"Concrcete5 admin password\"\r\n label: \"Admin Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: cms_sitename\r\n description: \"Concrcete5 Sitename\"\r\n label: \"Sitename\"\r\n required: true\r\n default: \"MySite\"\r\n type: \"string\"\r\nCMSMysql:\r\n scale: 1\r\nConcrete5App:\r\n scale: 1\r\n\r\n",
+ "removed": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "uuid": "e129ed27-3823-4e2e-af62-4565d68995d4"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/ex_deploy_service.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/ex_deploy_service.json b/libcloud/test/container/fixtures/rancher/ex_deploy_service.json
new file mode 100644
index 0000000..e30bc47
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/ex_deploy_service.json
@@ -0,0 +1,66 @@
+{
+ "id": "1s13",
+ "type": "service",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/services/1s13",
+ "account": "http://172.30.0.100:8080/v1/services/1s13/account",
+ "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s13/consumedbyservices",
+ "consumedservices": "http://172.30.0.100:8080/v1/services/1s13/consumedservices",
+ "environment": "http://172.30.0.100:8080/v1/services/1s13/environment",
+ "instances": "http://172.30.0.100:8080/v1/services/1s13/instances",
+ "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s13/serviceexposemaps",
+ "containerStats": "http://172.30.0.100:8080/v1/services/1s13/containerstats"
+ },
+ "actions": {
+ "setservicelinks": "http://172.30.0.100:8080/v1/services/1s13/?action=setservicelinks",
+ "removeservicelink": "http://172.30.0.100:8080/v1/services/1s13/?action=removeservicelink",
+ "addservicelink": "http://172.30.0.100:8080/v1/services/1s13/?action=addservicelink"
+ },
+ "name": "newservice",
+ "state": "active",
+ "accountId": "1a5",
+ "assignServiceIpAddress": false,
+ "createIndex": 1,
+ "created": "2016-10-06T15:31:35Z",
+ "createdTS": 1475767895000,
+ "currentScale": 1,
+ "description": null,
+ "environmentId": "1e6",
+ "externalId": null,
+ "fqdn": null,
+ "healthState": "unhealthy",
+ "kind": "service",
+ "launchConfig": {
+ "environment": {
+ "root_password": "password"
+ },
+ "imageUuid": "docker:rlister/hastebin:latest",
+ "kind": "container",
+ "networkMode": "managed",
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "startOnCreate": true,
+ "stdinOpen": false,
+ "tty": false,
+ "version": "0",
+ "vcpu": 1
+ },
+ "metadata": null,
+ "publicEndpoints": null,
+ "removed": "2016-10-06T15:45:03Z",
+ "removedTS": 1475768703000,
+ "retainIp": null,
+ "scale": 1,
+ "scalePolicy": null,
+ "secondaryLaunchConfigs": [],
+ "selectorContainer": null,
+ "selectorLink": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "upgrade": null,
+ "uuid": "de2cd54f-9936-49fb-a41a-35653c4510f7",
+ "vip": null
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/ex_deploy_stack.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/ex_deploy_stack.json b/libcloud/test/container/fixtures/rancher/ex_deploy_stack.json
new file mode 100644
index 0000000..38b1db4
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/ex_deploy_stack.json
@@ -0,0 +1,40 @@
+{
+ "id": "1e9",
+ "type": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments/1e9",
+ "account": "http://172.30.0.100:8080/v1/environments/1e9/account",
+ "services": "http://172.30.0.100:8080/v1/environments/1e9/services",
+ "composeConfig": "http://172.30.0.100:8080/v1/environments/1e9/composeconfig"
+ },
+ "actions": {
+ "upgrade": "http://172.30.0.100:8080/v1/environments/1e9/?action=upgrade",
+ "update": "http://172.30.0.100:8080/v1/environments/1e9/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/environments/1e9/?action=remove",
+ "addoutputs": "http://172.30.0.100:8080/v1/environments/1e9/?action=addoutputs",
+ "activateservices": "http://172.30.0.100:8080/v1/environments/1e9/?action=activateservices",
+ "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e9/?action=deactivateservices",
+ "exportconfig": "http://172.30.0.100:8080/v1/environments/1e9/?action=exportconfig"
+ },
+ "name": "newstack",
+ "state": "active",
+ "accountId": "1a5",
+ "created": "2016-10-06T14:12:34Z",
+ "createdTS": 1475763154000,
+ "description": null,
+ "dockerCompose": null,
+ "environment": {"root_password": "password"},
+ "externalId": null,
+ "healthState": "healthy",
+ "kind": "environment",
+ "outputs": null,
+ "previousEnvironment": null,
+ "previousExternalId": null,
+ "rancherCompose": null,
+ "removed": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "uuid": "7f8b1836-5619-4e19-adfe-6967fe55bda7"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/ex_destroy_service.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/ex_destroy_service.json b/libcloud/test/container/fixtures/rancher/ex_destroy_service.json
new file mode 100644
index 0000000..6af70ad
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/ex_destroy_service.json
@@ -0,0 +1,66 @@
+{
+ "id": "1s13",
+ "type": "service",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/services/1s13",
+ "account": "http://172.30.0.100:8080/v1/services/1s13/account",
+ "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s13/consumedbyservices",
+ "consumedservices": "http://172.30.0.100:8080/v1/services/1s13/consumedservices",
+ "environment": "http://172.30.0.100:8080/v1/services/1s13/environment",
+ "instances": "http://172.30.0.100:8080/v1/services/1s13/instances",
+ "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s13/serviceexposemaps",
+ "containerStats": "http://172.30.0.100:8080/v1/services/1s13/containerstats"
+ },
+ "actions": {
+ "setservicelinks": "http://172.30.0.100:8080/v1/services/1s13/?action=setservicelinks",
+ "removeservicelink": "http://172.30.0.100:8080/v1/services/1s13/?action=removeservicelink",
+ "addservicelink": "http://172.30.0.100:8080/v1/services/1s13/?action=addservicelink"
+ },
+ "name": "newservice",
+ "state": "removing",
+ "accountId": "1a5",
+ "assignServiceIpAddress": false,
+ "createIndex": 1,
+ "created": "2016-10-06T15:31:35Z",
+ "createdTS": 1475767895000,
+ "currentScale": 1,
+ "description": null,
+ "environmentId": "1e6",
+ "externalId": null,
+ "fqdn": null,
+ "healthState": "unhealthy",
+ "kind": "service",
+ "launchConfig": {
+ "environment": {
+ "root_password": "password"
+ },
+ "imageUuid": "docker:rlister/hastebin:latest",
+ "kind": "container",
+ "networkMode": "managed",
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "startOnCreate": true,
+ "stdinOpen": false,
+ "tty": false,
+ "version": "0",
+ "vcpu": 1
+ },
+ "metadata": null,
+ "publicEndpoints": null,
+ "removed": "2016-10-06T15:45:03Z",
+ "removedTS": 1475768703000,
+ "retainIp": null,
+ "scale": 1,
+ "scalePolicy": null,
+ "secondaryLaunchConfigs": [],
+ "selectorContainer": null,
+ "selectorLink": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "upgrade": null,
+ "uuid": "de2cd54f-9936-49fb-a41a-35653c4510f7",
+ "vip": null
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/ex_destroy_stack.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/ex_destroy_stack.json b/libcloud/test/container/fixtures/rancher/ex_destroy_stack.json
new file mode 100644
index 0000000..daef943
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/ex_destroy_stack.json
@@ -0,0 +1,40 @@
+{
+ "id": "1e10",
+ "type": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments/1e10",
+ "account": "http://172.30.0.100:8080/v1/environments/1e10/account",
+ "services": "http://172.30.0.100:8080/v1/environments/1e10/services",
+ "composeConfig": "http://172.30.0.100:8080/v1/environments/1e10/composeconfig"
+ },
+ "actions": {
+ "addoutputs": "http://172.30.0.100:8080/v1/environments/1e10/?action=addoutputs",
+ "activateservices": "http://172.30.0.100:8080/v1/environments/1e10/?action=activateservices",
+ "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e10/?action=deactivateservices",
+ "exportconfig": "http://172.30.0.100:8080/v1/environments/1e10/?action=exportconfig"
+ },
+ "name": "newstack1",
+ "state": "removing",
+ "accountId": "1a5",
+ "created": "2016-10-06T14:15:41Z",
+ "createdTS": 1475763341000,
+ "description": null,
+ "dockerCompose": null,
+ "environment": {
+ "root_password": "password"
+ },
+ "externalId": null,
+ "healthState": "healthy",
+ "kind": "environment",
+ "outputs": null,
+ "previousEnvironment": null,
+ "previousExternalId": null,
+ "rancherCompose": null,
+ "removed": "2016-10-06T14:56:16Z",
+ "removedTS": 1475765776000,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "uuid": "289f380f-d00a-4faf-b69f-53a559dbfd05"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/ex_list_services.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/ex_list_services.json b/libcloud/test/container/fixtures/rancher/ex_list_services.json
new file mode 100644
index 0000000..789bca8
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/ex_list_services.json
@@ -0,0 +1,536 @@
+{
+ "type": "collection",
+ "resourceType": "service",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/services"
+ },
+ "createTypes": {
+ "dnsService": "http://172.30.0.100:8080/v1/dnsservices",
+ "externalService": "http://172.30.0.100:8080/v1/externalservices",
+ "loadBalancerService": "http://172.30.0.100:8080/v1/loadbalancerservices",
+ "service": "http://172.30.0.100:8080/v1/services"
+ },
+ "actions": {},
+ "data": [
+ {
+ "id": "1s1",
+ "type": "service",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/services/1s1",
+ "account": "http://172.30.0.100:8080/v1/services/1s1/account",
+ "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s1/consumedbyservices",
+ "consumedservices": "http://172.30.0.100:8080/v1/services/1s1/consumedservices",
+ "environment": "http://172.30.0.100:8080/v1/services/1s1/environment",
+ "instances": "http://172.30.0.100:8080/v1/services/1s1/instances",
+ "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s1/serviceexposemaps",
+ "containerStats": "http://172.30.0.100:8080/v1/services/1s1/containerstats"
+ },
+ "actions": {
+ "update": "http://172.30.0.100:8080/v1/services/1s1/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/services/1s1/?action=remove",
+ "setservicelinks": "http://172.30.0.100:8080/v1/services/1s1/?action=setservicelinks",
+ "removeservicelink": "http://172.30.0.100:8080/v1/services/1s1/?action=removeservicelink",
+ "activate": "http://172.30.0.100:8080/v1/services/1s1/?action=activate",
+ "upgrade": "http://172.30.0.100:8080/v1/services/1s1/?action=upgrade",
+ "addservicelink": "http://172.30.0.100:8080/v1/services/1s1/?action=addservicelink"
+ },
+ "name": "CMSMysql",
+ "state": "inactive",
+ "accountId": "1a5",
+ "assignServiceIpAddress": false,
+ "createIndex": 1,
+ "created": "2016-09-22T17:58:54Z",
+ "createdTS": 1474567134000,
+ "currentScale": 1,
+ "description": null,
+ "environmentId": "1e1",
+ "externalId": null,
+ "fqdn": null,
+ "healthState": "unhealthy",
+ "kind": "service",
+ "launchConfig": {
+ "dataVolumes": [
+ "CMS_DB_DATA:/var/lib/mysql"
+ ],
+ "environment": {
+ "MYSQL_DATABASE": "CMS_DB",
+ "MYSQL_PASSWORD": "password",
+ "MYSQL_ROOT_PASSWORD": "password",
+ "MYSQL_USER": "CMS_USER"
+ },
+ "imageUuid": "docker:mysql",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.pull_image": "always",
+ "io.rancher.service.hash": "c5d6bacef4be47a5ca5d1517a1d33319d024cdde"
+ },
+ "logConfig": {},
+ "networkMode": "managed",
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "startOnCreate": true,
+ "stdinOpen": true,
+ "tty": true,
+ "version": "0",
+ "vcpu": 1
+ },
+ "metadata": {
+ "io.rancher.service.hash": "41ccfd7f8023f2efcc758a925a9f461d607c990d"
+ },
+ "publicEndpoints": null,
+ "removed": null,
+ "retainIp": null,
+ "scale": 1,
+ "scalePolicy": null,
+ "secondaryLaunchConfigs": [],
+ "selectorContainer": null,
+ "selectorLink": null,
+ "startOnCreate": false,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "upgrade": null,
+ "uuid": "85f4e9fc-c311-45a0-9a1a-a9da229aaa2a",
+ "vip": null
+ },
+ {
+ "id": "1s2",
+ "type": "service",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/services/1s2",
+ "account": "http://172.30.0.100:8080/v1/services/1s2/account",
+ "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s2/consumedbyservices",
+ "consumedservices": "http://172.30.0.100:8080/v1/services/1s2/consumedservices",
+ "environment": "http://172.30.0.100:8080/v1/services/1s2/environment",
+ "instances": "http://172.30.0.100:8080/v1/services/1s2/instances",
+ "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s2/serviceexposemaps",
+ "containerStats": "http://172.30.0.100:8080/v1/services/1s2/containerstats"
+ },
+ "actions": {
+ "update": "http://172.30.0.100:8080/v1/services/1s2/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/services/1s2/?action=remove",
+ "setservicelinks": "http://172.30.0.100:8080/v1/services/1s2/?action=setservicelinks",
+ "removeservicelink": "http://172.30.0.100:8080/v1/services/1s2/?action=removeservicelink",
+ "activate": "http://172.30.0.100:8080/v1/services/1s2/?action=activate",
+ "upgrade": "http://172.30.0.100:8080/v1/services/1s2/?action=upgrade",
+ "addservicelink": "http://172.30.0.100:8080/v1/services/1s2/?action=addservicelink"
+ },
+ "name": "Concrete5App",
+ "state": "inactive",
+ "accountId": "1a5",
+ "assignServiceIpAddress": false,
+ "createIndex": 2,
+ "created": "2016-09-22T17:58:54Z",
+ "createdTS": 1474567134000,
+ "currentScale": 1,
+ "description": null,
+ "environmentId": "1e1",
+ "externalId": null,
+ "fqdn": null,
+ "healthState": "degraded",
+ "kind": "service",
+ "launchConfig": {
+ "dataVolumes": [
+ "CMS_APP_DATA:/var/www/html/application",
+ "CMS_PACK_DATA:/var/www/html/packages"
+ ],
+ "imageUuid": "docker:opensaas/concrete5",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.pull_image": "always",
+ "io.rancher.service.hash": "6033469e7596fd16896eb87b3a99f50af2dbf522",
+ "io.rancher.sidekicks": "CMSConfig"
+ },
+ "logConfig": {},
+ "networkMode": "managed",
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "startOnCreate": true,
+ "stdinOpen": true,
+ "tty": true,
+ "version": "0",
+ "vcpu": 1
+ },
+ "metadata": {
+ "io.rancher.service.hash": "037726f2f6d389022953a652a5d3e5775415d0b0"
+ },
+ "publicEndpoints": null,
+ "removed": null,
+ "retainIp": null,
+ "scale": 1,
+ "scalePolicy": null,
+ "secondaryLaunchConfigs": [
+ {
+ "command": [
+ "bash",
+ "-c",
+ "chown -R www-data. application; chown -R www-data. packages; sleep 2m; php -f concrete/bin/concrete5.php c5:install --db-server=mysql --db-username=CMS_USER --db-password=password --db-database=CMS_DB --site=MySite --admin-email=admin@example.com --admin-password=password -n -vvv"
+ ],
+ "dataVolumes": [
+ "CMS_APP_DATA:/var/www/html/application",
+ "CMS_PACK_DATA:/var/www/html/packages"
+ ],
+ "imageUuid": "docker:opensaas/concrete5",
+ "labels": {
+ "io.rancher.container.hostname_override": "container_name",
+ "io.rancher.container.start_once": "true",
+ "io.rancher.service.hash": "db08c70dbb11ff2955a5cac93c2c6e5e1ac95e7e"
+ },
+ "logConfig": {},
+ "name": "CMSConfig",
+ "networkMode": "managed",
+ "startOnCreate": true,
+ "stdinOpen": true,
+ "tty": true,
+ "kind": "container",
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "vcpu": 1,
+ "version": "0"
+ }
+ ],
+ "selectorContainer": null,
+ "selectorLink": null,
+ "startOnCreate": false,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "upgrade": null,
+ "uuid": "1d824bd6-e18b-4ac4-8ea1-5cd0a3c7e234",
+ "vip": null
+ },
+ {
+ "id": "1s3",
+ "type": "service",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/services/1s3",
+ "account": "http://172.30.0.100:8080/v1/services/1s3/account",
+ "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s3/consumedbyservices",
+ "consumedservices": "http://172.30.0.100:8080/v1/services/1s3/consumedservices",
+ "environment": "http://172.30.0.100:8080/v1/services/1s3/environment",
+ "instances": "http://172.30.0.100:8080/v1/services/1s3/instances",
+ "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s3/serviceexposemaps",
+ "containerStats": "http://172.30.0.100:8080/v1/services/1s3/containerstats"
+ },
+ "actions": {
+ "update": "http://172.30.0.100:8080/v1/services/1s3/?action=update",
+ "restart": "http://172.30.0.100:8080/v1/services/1s3/?action=restart",
+ "remove": "http://172.30.0.100:8080/v1/services/1s3/?action=remove",
+ "setservicelinks": "http://172.30.0.100:8080/v1/services/1s3/?action=setservicelinks",
+ "removeservicelink": "http://172.30.0.100:8080/v1/services/1s3/?action=removeservicelink",
+ "upgrade": "http://172.30.0.100:8080/v1/services/1s3/?action=upgrade",
+ "addservicelink": "http://172.30.0.100:8080/v1/services/1s3/?action=addservicelink",
+ "deactivate": "http://172.30.0.100:8080/v1/services/1s3/?action=deactivate"
+ },
+ "name": "ghost",
+ "state": "active",
+ "accountId": "1a5",
+ "assignServiceIpAddress": false,
+ "createIndex": 1,
+ "created": "2016-09-22T18:00:26Z",
+ "createdTS": 1474567226000,
+ "currentScale": 1,
+ "description": null,
+ "environmentId": "1e2",
+ "externalId": null,
+ "fqdn": null,
+ "healthState": "healthy",
+ "kind": "service",
+ "launchConfig": {
+ "imageUuid": "docker:ghost",
+ "kind": "container",
+ "labels": {
+ "io.rancher.service.hash": "af9b5ddd2891271b12a88129e2bc37ff57998182"
+ },
+ "logConfig": {},
+ "networkMode": "managed",
+ "ports": [
+ "80:2368/tcp"
+ ],
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "startOnCreate": true,
+ "stdinOpen": false,
+ "tty": false,
+ "version": "0",
+ "vcpu": 1
+ },
+ "metadata": {
+ "io.rancher.service.hash": "f49280e1f709117b76693b638834791e4f4ef0fd"
+ },
+ "publicEndpoints": [
+ {
+ "ipAddress": "172.30.0.101",
+ "port": 80,
+ "serviceId": "1s3",
+ "hostId": "1h1",
+ "instanceId": "1i5"
+ }
+ ],
+ "removed": null,
+ "retainIp": null,
+ "scale": 1,
+ "scalePolicy": null,
+ "secondaryLaunchConfigs": [],
+ "selectorContainer": null,
+ "selectorLink": null,
+ "startOnCreate": false,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "upgrade": null,
+ "uuid": "c2ce7050-e5b5-42c7-a9fb-8ed8d33a4884",
+ "vip": null
+ },
+ {
+ "id": "1s6",
+ "type": "service",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/services/1s6",
+ "account": "http://172.30.0.100:8080/v1/services/1s6/account",
+ "consumedbyservices": "http://172.30.0.100:8080/v1/services/1s6/consumedbyservices",
+ "consumedservices": "http://172.30.0.100:8080/v1/services/1s6/consumedservices",
+ "environment": "http://172.30.0.100:8080/v1/services/1s6/environment",
+ "instances": "http://172.30.0.100:8080/v1/services/1s6/instances",
+ "serviceExposeMaps": "http://172.30.0.100:8080/v1/services/1s6/serviceexposemaps",
+ "containerStats": "http://172.30.0.100:8080/v1/services/1s6/containerstats"
+ },
+ "actions": {
+ "update": "http://172.30.0.100:8080/v1/services/1s6/?action=update",
+ "restart": "http://172.30.0.100:8080/v1/services/1s6/?action=restart",
+ "remove": "http://172.30.0.100:8080/v1/services/1s6/?action=remove",
+ "setservicelinks": "http://172.30.0.100:8080/v1/services/1s6/?action=setservicelinks",
+ "removeservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=removeservicelink",
+ "upgrade": "http://172.30.0.100:8080/v1/services/1s6/?action=upgrade",
+ "addservicelink": "http://172.30.0.100:8080/v1/services/1s6/?action=addservicelink",
+ "deactivate": "http://172.30.0.100:8080/v1/services/1s6/?action=deactivate"
+ },
+ "name": "123",
+ "state": "active",
+ "accountId": "1a5",
+ "assignServiceIpAddress": false,
+ "createIndex": 1,
+ "created": "2016-09-22T18:28:04Z",
+ "createdTS": 1474568884000,
+ "currentScale": 1,
+ "description": null,
+ "environmentId": "1e2",
+ "externalId": null,
+ "fqdn": null,
+ "healthState": "healthy",
+ "kind": "service",
+ "launchConfig": {
+ "capAdd": [],
+ "capDrop": [],
+ "count": null,
+ "cpuSet": null,
+ "cpuShares": null,
+ "dataVolumes": [],
+ "dataVolumesFrom": [],
+ "description": null,
+ "devices": [],
+ "dns": [],
+ "dnsSearch": [],
+ "domainName": null,
+ "hostname": null,
+ "imageUuid": "docker:ubuntu:trusty",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.pull_image": "always"
+ },
+ "logConfig": {
+ "config": {},
+ "driver": ""
+ },
+ "memory": null,
+ "memoryMb": null,
+ "memorySwap": null,
+ "networkMode": "managed",
+ "pidMode": null,
+ "ports": [],
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "requestedIpAddress": null,
+ "startOnCreate": true,
+ "stdinOpen": true,
+ "tty": true,
+ "user": null,
+ "userdata": null,
+ "version": "0bdea468-c3e9-4562-951c-d543958e966a",
+ "volumeDriver": null,
+ "workingDir": null,
+ "dataVolumesFromLaunchConfigs": [],
+ "networkLaunchConfig": null,
+ "vcpu": 1
+ },
+ "metadata": null,
+ "publicEndpoints": null,
+ "removed": null,
+ "retainIp": null,
+ "scale": 1,
+ "scalePolicy": null,
+ "secondaryLaunchConfigs": [],
+ "selectorContainer": null,
+ "selectorLink": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "upgrade": {
+ "inServiceStrategy": {
+ "batchSize": 1,
+ "intervalMillis": 2000,
+ "launchConfig": {
+ "capAdd": [],
+ "capDrop": [],
+ "count": null,
+ "cpuSet": null,
+ "cpuShares": null,
+ "dataVolumes": [],
+ "dataVolumesFrom": [],
+ "description": null,
+ "devices": [],
+ "dns": [],
+ "dnsSearch": [],
+ "domainName": null,
+ "hostname": null,
+ "imageUuid": "docker:ubuntu:trusty",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.pull_image": "always"
+ },
+ "logConfig": {
+ "config": {},
+ "driver": ""
+ },
+ "memory": null,
+ "memoryMb": null,
+ "memorySwap": null,
+ "networkMode": "managed",
+ "pidMode": null,
+ "ports": [],
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "requestedIpAddress": null,
+ "startOnCreate": true,
+ "stdinOpen": true,
+ "tty": true,
+ "user": null,
+ "userdata": null,
+ "version": "0bdea468-c3e9-4562-951c-d543958e966a",
+ "volumeDriver": null,
+ "workingDir": null,
+ "dataVolumesFromLaunchConfigs": [],
+ "networkLaunchConfig": null,
+ "vcpu": 1
+ },
+ "previousLaunchConfig": {
+ "capAdd": [],
+ "capDrop": [],
+ "count": null,
+ "cpuSet": null,
+ "cpuShares": null,
+ "dataVolumes": [],
+ "dataVolumesFrom": [],
+ "description": null,
+ "devices": [],
+ "dns": [],
+ "dnsSearch": [],
+ "domainName": null,
+ "hostname": null,
+ "imageUuid": "docker:ubuntu:trusty",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.pull_image": "always"
+ },
+ "logConfig": {
+ "config": {},
+ "driver": ""
+ },
+ "memory": null,
+ "memoryMb": null,
+ "memorySwap": null,
+ "networkMode": "managed",
+ "pidMode": null,
+ "ports": [],
+ "privileged": false,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "requestedIpAddress": null,
+ "startOnCreate": true,
+ "stdinOpen": true,
+ "tty": true,
+ "user": null,
+ "userdata": null,
+ "version": "0",
+ "volumeDriver": null,
+ "workingDir": null,
+ "dataVolumesFromLaunchConfigs": [],
+ "networkLaunchConfig": null,
+ "vcpu": 1
+ },
+ "previousSecondaryLaunchConfigs": [],
+ "secondaryLaunchConfigs": [],
+ "startFirst": true
+ },
+ "toServiceStrategy": null
+ },
+ "uuid": "c0ae4d08-e20a-45ef-9fb9-ad9f7cdeeb15",
+ "vip": null
+ }
+ ],
+ "sortLinks": {
+ "accountId": "http://172.30.0.100:8080/v1/services?limit=4&sort=accountId",
+ "createIndex": "http://172.30.0.100:8080/v1/services?limit=4&sort=createIndex",
+ "created": "http://172.30.0.100:8080/v1/services?limit=4&sort=created",
+ "description": "http://172.30.0.100:8080/v1/services?limit=4&sort=description",
+ "environmentId": "http://172.30.0.100:8080/v1/services?limit=4&sort=environmentId",
+ "externalId": "http://172.30.0.100:8080/v1/services?limit=4&sort=externalId",
+ "healthState": "http://172.30.0.100:8080/v1/services?limit=4&sort=healthState",
+ "id": "http://172.30.0.100:8080/v1/services?limit=4&sort=id",
+ "kind": "http://172.30.0.100:8080/v1/services?limit=4&sort=kind",
+ "name": "http://172.30.0.100:8080/v1/services?limit=4&sort=name",
+ "removeTime": "http://172.30.0.100:8080/v1/services?limit=4&sort=removeTime",
+ "removed": "http://172.30.0.100:8080/v1/services?limit=4&sort=removed",
+ "selectorContainer": "http://172.30.0.100:8080/v1/services?limit=4&sort=selectorContainer",
+ "selectorLink": "http://172.30.0.100:8080/v1/services?limit=4&sort=selectorLink",
+ "state": "http://172.30.0.100:8080/v1/services?limit=4&sort=state",
+ "uuid": "http://172.30.0.100:8080/v1/services?limit=4&sort=uuid",
+ "vip": "http://172.30.0.100:8080/v1/services?limit=4&sort=vip"
+ },
+ "pagination": {
+ "first": null,
+ "previous": null,
+ "next": "http://172.30.0.100:8080/v1/services?limit=4&marker=m4",
+ "limit": 4,
+ "total": null,
+ "partial": true
+ },
+ "sort": null,
+ "filters": {
+ "accountId": null,
+ "createIndex": null,
+ "created": null,
+ "description": null,
+ "environmentId": null,
+ "externalId": null,
+ "healthState": null,
+ "id": null,
+ "kind": null,
+ "name": null,
+ "removeTime": null,
+ "removed": null,
+ "selectorContainer": null,
+ "selectorLink": null,
+ "state": null,
+ "uuid": null,
+ "vip": null
+ },
+ "createDefaults": {}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/ex_list_stacks.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/ex_list_stacks.json b/libcloud/test/container/fixtures/rancher/ex_list_stacks.json
new file mode 100644
index 0000000..d2d1c3c
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/ex_list_stacks.json
@@ -0,0 +1,310 @@
+{
+ "type": "collection",
+ "resourceType": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments"
+ },
+ "createTypes": {
+ "composeProject": "http://172.30.0.100:8080/v1/composeprojects",
+ "environment": "http://172.30.0.100:8080/v1/environments"
+ },
+ "actions": {},
+ "data": [
+ {
+ "id": "1e1",
+ "type": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments/1e1",
+ "account": "http://172.30.0.100:8080/v1/environments/1e1/account",
+ "services": "http://172.30.0.100:8080/v1/environments/1e1/services",
+ "composeConfig": "http://172.30.0.100:8080/v1/environments/1e1/composeconfig"
+ },
+ "actions": {
+ "upgrade": "http://172.30.0.100:8080/v1/environments/1e1/?action=upgrade",
+ "update": "http://172.30.0.100:8080/v1/environments/1e1/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/environments/1e1/?action=remove",
+ "addoutputs": "http://172.30.0.100:8080/v1/environments/1e1/?action=addoutputs",
+ "activateservices": "http://172.30.0.100:8080/v1/environments/1e1/?action=activateservices",
+ "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e1/?action=deactivateservices",
+ "exportconfig": "http://172.30.0.100:8080/v1/environments/1e1/?action=exportconfig"
+ },
+ "name": "Concrete5",
+ "state": "active",
+ "accountId": "1a5",
+ "created": "2016-09-22T17:58:53Z",
+ "createdTS": 1474567133000,
+ "description": null,
+ "dockerCompose": "CMSMysql:\r\n environment:\r\n MYSQL_ROOT_PASSWORD: ${root_password}\r\n MYSQL_DATABASE: ${db_name}\r\n MYSQL_USER: ${db_username}\r\n MYSQL_PASSWORD: ${db_password}\r\n labels:\r\n io.rancher.container.pull_image: always\r\n tty: true\r\n image: mysql\r\n volumes:\r\n - ${db_data_location}:/var/lib/mysql\r\n stdin_open: true\r\n volume_driver: ${volume_driver}\r\n\r\nCMSConfig:\r\n image: opensaas/concrete5\r\n tty: true\r\n stdin_open: true\r\n links:\r\n - CMSMysql:mysql\r\n volumes:\r\n - ${cms_application_data}:/var/www/html/application\r\n - ${cms_packages_data}:/var/www/html/packages\r\n labels:\r\n io.rancher.container.hostname_override: container_name\r\n io.rancher.container.start_once: true\r\n volume_driver: ${volume_driver}\r\n command: bash -c \"chown -R www-data. application; chown -R www-data. packages; sleep 2m; php -f concrete/bin/concre
te5.php c5:install --db-server=mysql --db-username=${db_username} --db-password=${db_password} --db-database=${db_name} --site=${cms_sitename} --admin-email=${cms_admin_email} --admin-password=${cms_admin_password} -n -vvv\"\r\n\r\nConcrete5App:\r\n labels:\r\n io.rancher.container.pull_image: always\r\n io.rancher.sidekicks: CMSConfig\r\n tty: true\r\n links:\r\n - CMSMysql:mysql\r\n image: opensaas/concrete5\r\n volumes:\r\n - ${cms_application_data}:/var/www/html/application\r\n - ${cms_packages_data}:/var/www/html/packages\r\n volume_driver: ${volume_driver}\r\n stdin_open: true",
+ "environment": {
+ "root_password": "password",
+ "db_name": "CMS_DB",
+ "db_username": "CMS_USER",
+ "db_password": "password",
+ "db_data_location": "CMS_DB_DATA",
+ "volume_driver": "",
+ "cms_application_data": "CMS_APP_DATA",
+ "cms_packages_data": "CMS_PACK_DATA",
+ "cms_admin_email": "admin@example.com",
+ "cms_admin_password": "password",
+ "cms_sitename": "MySite"
+ },
+ "externalId": "catalog://community:Concrete5:1",
+ "healthState": "healthy",
+ "kind": "environment",
+ "outputs": null,
+ "previousEnvironment": null,
+ "previousExternalId": null,
+ "rancherCompose": ".catalog:\r\n name: \"Concrete5\"\r\n version: \"v0.2\"\r\n description: \"Concrete5 CMS\"\r\n uuid: Concrete5-1\r\n minimum_rancher_version: v0.51.0\r\n questions:\r\n - variable: root_password\r\n description: \"MySQL root password - keep this password complex and secure\"\r\n label: \"MySQL Root Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: db_name\r\n description: \"MySQL Database Name - to use in the Concrete5 setup\"\r\n label: \"MySQL Database Name\"\r\n required: true\r\n default: \"CMS_DB\"\r\n type: \"string\"\r\n - variable: db_username\r\n description: \"MySQL Username - to use in the Concrete5 setup\"\r\n label: \"MySQL Username\"\r\n required: true\r\n default: \"CMS_USER\"\r\n type: \"string\"\r\n - variable: db_passwor
d\r\n description: \"MySQL password for the above user - to use in the Concrete5 setup\"\r\n label: \"MySQL Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: db_data_location\r\n description: \"Location on the host for the database files\"\r\n label: \"DB Data Location\"\r\n required: true\r\n default: \"CMS_DB_DATA\"\r\n type: \"string\"\r\n - variable: volume_driver\r\n description: \"Volume Driver for the persistant data locations requires docker 1.7\"\r\n label: \"Volume Driver\"\r\n type: \"string\"\r\n - variable: cms_application_data\r\n description: \"Concrcte5 application folder for persistant data storage\"\r\n label: \"Application Folder\"\r\n required: true\r\n default: \"CMS_APP_DATA\"\r\n type: \"string\"\r\n - variable: cms_packages_data\r
\n description: \"Concrcte5 packages folder for persistant data storage\"\r\n label: \"Packages Folder\"\r\n required: true\r\n default: \"CMS_PACK_DATA\"\r\n type: \"string\"\r\n - variable: cms_admin_email\r\n description: \"Concrcete5 admin email address\"\r\n label: \"Admin Email\"\r\n required: true\r\n default: \"admin@example.com\"\r\n type: \"string\"\r\n - variable: cms_admin_password\r\n description: \"Concrcete5 admin password\"\r\n label: \"Admin Password\"\r\n required: true\r\n default: \"password\"\r\n type: \"string\"\r\n - variable: cms_sitename\r\n description: \"Concrcete5 Sitename\"\r\n label: \"Sitename\"\r\n required: true\r\n default: \"MySite\"\r\n type: \"string\"\r\nCMSMysql:\r\n scale: 1\r\nConcrete5App:\r\n scale: 1\r\n\r\n",
+ "removed": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "uuid": "e129ed27-3823-4e2e-af62-4565d68995d4"
+ },
+ {
+ "id": "1e2",
+ "type": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments/1e2",
+ "account": "http://172.30.0.100:8080/v1/environments/1e2/account",
+ "services": "http://172.30.0.100:8080/v1/environments/1e2/services",
+ "composeConfig": "http://172.30.0.100:8080/v1/environments/1e2/composeconfig"
+ },
+ "actions": {
+ "upgrade": "http://172.30.0.100:8080/v1/environments/1e2/?action=upgrade",
+ "update": "http://172.30.0.100:8080/v1/environments/1e2/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/environments/1e2/?action=remove",
+ "addoutputs": "http://172.30.0.100:8080/v1/environments/1e2/?action=addoutputs",
+ "activateservices": "http://172.30.0.100:8080/v1/environments/1e2/?action=activateservices",
+ "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e2/?action=deactivateservices",
+ "exportconfig": "http://172.30.0.100:8080/v1/environments/1e2/?action=exportconfig"
+ },
+ "name": "ghost",
+ "state": "active",
+ "accountId": "1a5",
+ "created": "2016-09-22T18:00:25Z",
+ "createdTS": 1474567225000,
+ "description": null,
+ "dockerCompose": "ghost:\n image: ghost\n ports:\n - ${public_port}:2368\n",
+ "environment": {
+ "public_port": "80"
+ },
+ "externalId": "catalog://community:ghost:0",
+ "healthState": "healthy",
+ "kind": "environment",
+ "outputs": null,
+ "previousEnvironment": null,
+ "previousExternalId": null,
+ "rancherCompose": ".catalog:\n name: \"Ghost\"\n version: \"v0.1-educaas\"\n description: \"Blog powered by Ghost. Requires no database\"\n uuid: ghost-0\n minimum_rancher_version: v0.51.0\n questions:\n - variable: public_port\n description: \"public port to access the blog\"\n label: \"Public Port\"\n required: true\n default: \"80\"\n type: \"int\"\nghost:\n",
+ "removed": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "uuid": "4c335202-2ca7-41f1-8702-4984518566ec"
+ },
+ {
+ "id": "1e5",
+ "type": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments/1e5",
+ "account": "http://172.30.0.100:8080/v1/environments/1e5/account",
+ "services": "http://172.30.0.100:8080/v1/environments/1e5/services",
+ "composeConfig": "http://172.30.0.100:8080/v1/environments/1e5/composeconfig"
+ },
+ "actions": {
+ "upgrade": "http://172.30.0.100:8080/v1/environments/1e5/?action=upgrade",
+ "update": "http://172.30.0.100:8080/v1/environments/1e5/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/environments/1e5/?action=remove",
+ "addoutputs": "http://172.30.0.100:8080/v1/environments/1e5/?action=addoutputs",
+ "activateservices": "http://172.30.0.100:8080/v1/environments/1e5/?action=activateservices",
+ "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e5/?action=deactivateservices",
+ "exportconfig": "http://172.30.0.100:8080/v1/environments/1e5/?action=exportconfig"
+ },
+ "name": "heyk",
+ "state": "active",
+ "accountId": "1a5",
+ "created": "2016-09-29T20:40:14Z",
+ "createdTS": 1475181614000,
+ "description": null,
+ "dockerCompose": null,
+ "environment": null,
+ "externalId": null,
+ "healthState": "healthy",
+ "kind": "environment",
+ "outputs": null,
+ "previousEnvironment": null,
+ "previousExternalId": null,
+ "rancherCompose": null,
+ "removed": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "uuid": "d5a39304-9247-4a31-8662-7dba98238105"
+ },
+ {
+ "id": "1e6",
+ "type": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments/1e6",
+ "account": "http://172.30.0.100:8080/v1/environments/1e6/account",
+ "services": "http://172.30.0.100:8080/v1/environments/1e6/services",
+ "composeConfig": "http://172.30.0.100:8080/v1/environments/1e6/composeconfig"
+ },
+ "actions": {
+ "upgrade": "http://172.30.0.100:8080/v1/environments/1e6/?action=upgrade",
+ "update": "http://172.30.0.100:8080/v1/environments/1e6/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/environments/1e6/?action=remove",
+ "addoutputs": "http://172.30.0.100:8080/v1/environments/1e6/?action=addoutputs",
+ "activateservices": "http://172.30.0.100:8080/v1/environments/1e6/?action=activateservices",
+ "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e6/?action=deactivateservices",
+ "exportconfig": "http://172.30.0.100:8080/v1/environments/1e6/?action=exportconfig"
+ },
+ "name": "ilikegurls",
+ "state": "active",
+ "accountId": "1a5",
+ "created": "2016-10-06T00:40:23Z",
+ "createdTS": 1475714423000,
+ "description": null,
+ "dockerCompose": null,
+ "environment": null,
+ "externalId": null,
+ "healthState": "healthy",
+ "kind": "environment",
+ "outputs": null,
+ "previousEnvironment": null,
+ "previousExternalId": null,
+ "rancherCompose": null,
+ "removed": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "uuid": "19101511-6dcb-49f7-a8e1-063bcded1956"
+ },
+ {
+ "id": "1e7",
+ "type": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments/1e7",
+ "account": "http://172.30.0.100:8080/v1/environments/1e7/account",
+ "services": "http://172.30.0.100:8080/v1/environments/1e7/services",
+ "composeConfig": "http://172.30.0.100:8080/v1/environments/1e7/composeconfig"
+ },
+ "actions": {
+ "upgrade": "http://172.30.0.100:8080/v1/environments/1e7/?action=upgrade",
+ "update": "http://172.30.0.100:8080/v1/environments/1e7/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/environments/1e7/?action=remove",
+ "addoutputs": "http://172.30.0.100:8080/v1/environments/1e7/?action=addoutputs",
+ "activateservices": "http://172.30.0.100:8080/v1/environments/1e7/?action=activateservices",
+ "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e7/?action=deactivateservices",
+ "exportconfig": "http://172.30.0.100:8080/v1/environments/1e7/?action=exportconfig"
+ },
+ "name": "maybethisyear",
+ "state": "active",
+ "accountId": "1a5",
+ "created": "2016-10-06T00:41:17Z",
+ "createdTS": 1475714477000,
+ "description": null,
+ "dockerCompose": null,
+ "environment": null,
+ "externalId": null,
+ "healthState": "healthy",
+ "kind": "environment",
+ "outputs": null,
+ "previousEnvironment": null,
+ "previousExternalId": null,
+ "rancherCompose": null,
+ "removed": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "uuid": "250c66f6-cd36-4c12-8767-deb5c35d0a05"
+ },
+ {
+ "id": "1e8",
+ "type": "environment",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/environments/1e8",
+ "account": "http://172.30.0.100:8080/v1/environments/1e8/account",
+ "services": "http://172.30.0.100:8080/v1/environments/1e8/services",
+ "composeConfig": "http://172.30.0.100:8080/v1/environments/1e8/composeconfig"
+ },
+ "actions": {
+ "upgrade": "http://172.30.0.100:8080/v1/environments/1e8/?action=upgrade",
+ "update": "http://172.30.0.100:8080/v1/environments/1e8/?action=update",
+ "remove": "http://172.30.0.100:8080/v1/environments/1e8/?action=remove",
+ "addoutputs": "http://172.30.0.100:8080/v1/environments/1e8/?action=addoutputs",
+ "activateservices": "http://172.30.0.100:8080/v1/environments/1e8/?action=activateservices",
+ "deactivateservices": "http://172.30.0.100:8080/v1/environments/1e8/?action=deactivateservices",
+ "exportconfig": "http://172.30.0.100:8080/v1/environments/1e8/?action=exportconfig"
+ },
+ "name": "oh-another",
+ "state": "active",
+ "accountId": "1a5",
+ "created": "2016-10-06T00:51:34Z",
+ "createdTS": 1475715094000,
+ "description": null,
+ "dockerCompose": null,
+ "environment": null,
+ "externalId": null,
+ "healthState": "healthy",
+ "kind": "environment",
+ "outputs": null,
+ "previousEnvironment": null,
+ "previousExternalId": null,
+ "rancherCompose": null,
+ "removed": null,
+ "startOnCreate": true,
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "uuid": "a777dd5e-e524-43c8-8783-d7bb14bcffb6"
+ }
+ ],
+ "sortLinks": {
+ "accountId": "http://172.30.0.100:8080/v1/environments?limit=6&sort=accountId",
+ "created": "http://172.30.0.100:8080/v1/environments?limit=6&sort=created",
+ "description": "http://172.30.0.100:8080/v1/environments?limit=6&sort=description",
+ "externalId": "http://172.30.0.100:8080/v1/environments?limit=6&sort=externalId",
+ "healthState": "http://172.30.0.100:8080/v1/environments?limit=6&sort=healthState",
+ "id": "http://172.30.0.100:8080/v1/environments?limit=6&sort=id",
+ "kind": "http://172.30.0.100:8080/v1/environments?limit=6&sort=kind",
+ "name": "http://172.30.0.100:8080/v1/environments?limit=6&sort=name",
+ "removeTime": "http://172.30.0.100:8080/v1/environments?limit=6&sort=removeTime",
+ "removed": "http://172.30.0.100:8080/v1/environments?limit=6&sort=removed",
+ "state": "http://172.30.0.100:8080/v1/environments?limit=6&sort=state",
+ "uuid": "http://172.30.0.100:8080/v1/environments?limit=6&sort=uuid"
+ },
+ "pagination": {
+ "first": null,
+ "previous": null,
+ "next": "http://172.30.0.100:8080/v1/environments?limit=6&marker=m6",
+ "limit": 6,
+ "total": null,
+ "partial": true
+ },
+ "sort": null,
+ "filters": {
+ "accountId": null,
+ "created": null,
+ "description": null,
+ "externalId": null,
+ "healthState": [
+ {
+ "modifier": "eq",
+ "value": "healthy"
+ }
+ ], "id": null,
+ "kind": null,
+ "name": null,
+ "removeTime": null,
+ "removed": null,
+ "state": null,
+ "uuid": null
+ },
+ "createDefaults": {}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/libcloud/blob/d179167a/libcloud/test/container/fixtures/rancher/ex_search_containers.json
----------------------------------------------------------------------
diff --git a/libcloud/test/container/fixtures/rancher/ex_search_containers.json b/libcloud/test/container/fixtures/rancher/ex_search_containers.json
new file mode 100644
index 0000000..8cd0565
--- /dev/null
+++ b/libcloud/test/container/fixtures/rancher/ex_search_containers.json
@@ -0,0 +1,212 @@
+{
+ "type": "collection",
+ "resourceType": "container",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/containers"
+ },
+ "createTypes": {
+ "container": "http://172.30.0.100:8080/v1/containers",
+ "launchConfig": "http://172.30.0.100:8080/v1/launchconfigs",
+ "virtualMachine": "http://172.30.0.100:8080/v1/virtualmachines"
+ },
+ "actions": {},
+ "data": [
+ {
+ "id": "1i2",
+ "type": "container",
+ "links": {
+ "self": "http://172.30.0.100:8080/v1/containers/1i2",
+ "account": "http://172.30.0.100:8080/v1/containers/1i2/account",
+ "credentials": "http://172.30.0.100:8080/v1/containers/1i2/credentials",
+ "healthcheckInstanceHostMaps": "http://172.30.0.100:8080/v1/containers/1i2/healthcheckinstancehostmaps",
+ "hosts": "http://172.30.0.100:8080/v1/containers/1i2/hosts",
+ "instanceLabels": "http://172.30.0.100:8080/v1/containers/1i2/instancelabels",
+ "instanceLinks": "http://172.30.0.100:8080/v1/containers/1i2/instancelinks",
+ "instances": "http://172.30.0.100:8080/v1/containers/1i2/instances",
+ "mounts": "http://172.30.0.100:8080/v1/containers/1i2/mounts",
+ "ports": "http://172.30.0.100:8080/v1/containers/1i2/ports",
+ "serviceEvents": "http://172.30.0.100:8080/v1/containers/1i2/serviceevents",
+ "serviceExposeMaps": "http://172.30.0.100:8080/v1/containers/1i2/serviceexposemaps",
+ "services": "http://172.30.0.100:8080/v1/containers/1i2/services",
+ "targetInstanceLinks": "http://172.30.0.100:8080/v1/containers/1i2/targetinstancelinks",
+ "volumes": "http://172.30.0.100:8080/v1/containers/1i2/volumes",
+ "stats": "http://172.30.0.100:8080/v1/containers/1i2/stats",
+ "containerStats": "http://172.30.0.100:8080/v1/containers/1i2/containerstats"
+ },
+ "actions": {
+ "update": "http://172.30.0.100:8080/v1/containers/1i2/?action=update",
+ "stop": "http://172.30.0.100:8080/v1/containers/1i2/?action=stop",
+ "restart": "http://172.30.0.100:8080/v1/containers/1i2/?action=restart",
+ "migrate": "http://172.30.0.100:8080/v1/containers/1i2/?action=migrate",
+ "logs": "http://172.30.0.100:8080/v1/containers/1i2/?action=logs",
+ "setlabels": "http://172.30.0.100:8080/v1/containers/1i2/?action=setlabels",
+ "execute": "http://172.30.0.100:8080/v1/containers/1i2/?action=execute",
+ "proxy": "http://172.30.0.100:8080/v1/containers/1i2/?action=proxy"
+ },
+ "name": "Network Agent",
+ "state": "running",
+ "accountId": "1a5",
+ "blkioDeviceOptions": null,
+ "build": null,
+ "capAdd": null,
+ "capDrop": null,
+ "command": null,
+ "cpuSet": null,
+ "cpuShares": null,
+ "createIndex": null,
+ "created": "2016-09-22T17:58:57Z",
+ "createdTS": 1474567137000,
+ "dataVolumeMounts": {},
+ "dataVolumes": [
+ "/var/lib/rancher/etc:/var/lib/rancher/etc:ro"
+ ],
+ "dataVolumesFrom": null,
+ "deploymentUnitUuid": null,
+ "description": null,
+ "devices": null,
+ "dns": null,
+ "dnsSearch": null,
+ "domainName": null,
+ "entryPoint": null,
+ "environment": null,
+ "expose": null,
+ "externalId": "129c67adc9fa084fbc8e1f963db0180896b88af3dca69c7e8fe0493284e4651c",
+ "extraHosts": null,
+ "firstRunning": "2016-09-22T17:59:11Z",
+ "firstRunningTS": 1474567151000,
+ "healthCheck": null,
+ "healthState": null,
+ "hostId": "1h1",
+ "hostname": null,
+ "imageUuid": "docker:rancher/agent-instance:v0.8.3",
+ "kind": "container",
+ "labels": {
+ "io.rancher.container.system": "NetworkAgent",
+ "io.rancher.container.uuid": "b0f88089-d28b-4388-93a7-889b750cd7cb",
+ "io.rancher.container.name": "Network Agent",
+ "io.rancher.container.agent_id": "2",
+ "io.rancher.container.ip": "10.42.247.188/16"
+ },
+ "logConfig": null,
+ "lxcConf": null,
+ "memory": null,
+ "memorySwap": null,
+ "nativeContainer": false,
+ "networkContainerId": null,
+ "networkIds": [],
+ "networkMode": null,
+ "pidMode": null,
+ "ports": null,
+ "primaryIpAddress": "10.42.247.188",
+ "privileged": true,
+ "publishAllPorts": false,
+ "readOnly": false,
+ "registryCredentialId": null,
+ "removed": null,
+ "requestedHostId": null,
+ "restartPolicy": null,
+ "securityOpt": null,
+ "startCount": 3,
+ "startOnCreate": true,
+ "stdinOpen": false,
+ "systemContainer": "NetworkAgent",
+ "transitioning": "no",
+ "transitioningMessage": null,
+ "transitioningProgress": null,
+ "tty": false,
+ "user": null,
+ "uuid": "b0f88089-d28b-4388-93a7-889b750cd7cb",
+ "version": "0",
+ "volumeDriver": null,
+ "workingDir": null
+ }
+ ],
+ "sortLinks": {
+ "accountId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=accountId",
+ "agentId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=agentId",
+ "allocationState": "http://172.30.0.100:8080/v1/containers?limit=2&sort=allocationState",
+ "compute": "http://172.30.0.100:8080/v1/containers?limit=2&sort=compute",
+ "createIndex": "http://172.30.0.100:8080/v1/containers?limit=2&sort=createIndex",
+ "created": "http://172.30.0.100:8080/v1/containers?limit=2&sort=created",
+ "deploymentUnitUuid": "http://172.30.0.100:8080/v1/containers?limit=2&sort=deploymentUnitUuid",
+ "description": "http://172.30.0.100:8080/v1/containers?limit=2&sort=description",
+ "dnsInternal": "http://172.30.0.100:8080/v1/containers?limit=2&sort=dnsInternal",
+ "dnsSearchInternal": "http://172.30.0.100:8080/v1/containers?limit=2&sort=dnsSearchInternal",
+ "domain": "http://172.30.0.100:8080/v1/containers?limit=2&sort=domain",
+ "externalId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=externalId",
+ "firstRunning": "http://172.30.0.100:8080/v1/containers?limit=2&sort=firstRunning",
+ "healthState": "http://172.30.0.100:8080/v1/containers?limit=2&sort=healthState",
+ "healthUpdated": "http://172.30.0.100:8080/v1/containers?limit=2&sort=healthUpdated",
+ "hostname": "http://172.30.0.100:8080/v1/containers?limit=2&sort=hostname",
+ "id": "http://172.30.0.100:8080/v1/containers?limit=2&sort=id",
+ "imageId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=imageId",
+ "instanceTriggeredStop": "http://172.30.0.100:8080/v1/containers?limit=2&sort=instanceTriggeredStop",
+ "kind": "http://172.30.0.100:8080/v1/containers?limit=2&sort=kind",
+ "memoryMb": "http://172.30.0.100:8080/v1/containers?limit=2&sort=memoryMb",
+ "name": "http://172.30.0.100:8080/v1/containers?limit=2&sort=name",
+ "nativeContainer": "http://172.30.0.100:8080/v1/containers?limit=2&sort=nativeContainer",
+ "networkContainerId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=networkContainerId",
+ "offeringId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=offeringId",
+ "registryCredentialId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=registryCredentialId",
+ "removeTime": "http://172.30.0.100:8080/v1/containers?limit=2&sort=removeTime",
+ "removed": "http://172.30.0.100:8080/v1/containers?limit=2&sort=removed",
+ "serviceIndexId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=serviceIndexId",
+ "startCount": "http://172.30.0.100:8080/v1/containers?limit=2&sort=startCount",
+ "state": "http://172.30.0.100:8080/v1/containers?limit=2&sort=state",
+ "systemContainer": "http://172.30.0.100:8080/v1/containers?limit=2&sort=systemContainer",
+ "token": "http://172.30.0.100:8080/v1/containers?limit=2&sort=token",
+ "userdata": "http://172.30.0.100:8080/v1/containers?limit=2&sort=userdata",
+ "uuid": "http://172.30.0.100:8080/v1/containers?limit=2&sort=uuid",
+ "version": "http://172.30.0.100:8080/v1/containers?limit=2&sort=version",
+ "zoneId": "http://172.30.0.100:8080/v1/containers?limit=2&sort=zoneId"
+ },
+ "pagination": {
+ "first": null,
+ "previous": null,
+ "next": "http://172.30.0.100:8080/v1/containers?limit=2&marker=m2",
+ "limit": 2,
+ "total": null,
+ "partial": true
+ },
+ "sort": null,
+ "filters": {
+ "accountId": null,
+ "agentId": null,
+ "allocationState": null,
+ "compute": null,
+ "createIndex": null,
+ "created": null,
+ "deploymentUnitUuid": null,
+ "description": null,
+ "dnsInternal": null,
+ "dnsSearchInternal": null,
+ "domain": null,
+ "externalId": null,
+ "firstRunning": null,
+ "healthState": null,
+ "healthUpdated": null,
+ "hostname": null,
+ "id": null,
+ "imageId": null,
+ "instanceTriggeredStop": null,
+ "kind": null,
+ "memoryMb": null,
+ "name": null,
+ "nativeContainer": null,
+ "networkContainerId": null,
+ "offeringId": null,
+ "registryCredentialId": null,
+ "removeTime": null,
+ "removed": null,
+ "serviceIndexId": null,
+ "startCount": null,
+ "state": null,
+ "systemContainer": null,
+ "token": null,
+ "userdata": null,
+ "uuid": null,
+ "version": null,
+ "zoneId": null
+ },
+ "createDefaults": {}
+}
\ No newline at end of file