From 15efc2d85179b45dd39fdd3afaf1c7c59ece2f07 Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Thu, 29 Sep 2016 11:31:42 -0700 Subject: [PATCH] Initial import of https://github.com/docker/cloud-docs --- Jenkinsfile | 7 + README.md | 40 + apidocs/docker-cloud.md | 14 + apidocs/docker-cloud/fonts/slate.eot | Bin 0 -> 1876 bytes apidocs/docker-cloud/fonts/slate.svg | 14 + apidocs/docker-cloud/fonts/slate.ttf | Bin 0 -> 1720 bytes apidocs/docker-cloud/fonts/slate.woff | Bin 0 -> 1796 bytes apidocs/docker-cloud/fonts/slate.woff2 | Bin 0 -> 796 bytes apidocs/docker-cloud/images/logo.png | Bin 0 -> 4360 bytes apidocs/docker-cloud/images/navbar.png | Bin 0 -> 96 bytes apidocs/docker-cloud/includes/action.html | 517 ++ .../includes/availabilityzone.html | 196 + apidocs/docker-cloud/includes/container.html | 1183 +++ .../includes/dockercloud-events.html | 237 + apidocs/docker-cloud/includes/node.html | 560 ++ .../docker-cloud/includes/nodecluster.html | 589 ++ apidocs/docker-cloud/includes/nodetype.html | 222 + apidocs/docker-cloud/includes/provider.html | 201 + apidocs/docker-cloud/includes/region.html | 218 + apidocs/docker-cloud/includes/registry.html | 178 + apidocs/docker-cloud/includes/repository.html | 358 + apidocs/docker-cloud/includes/service.html | 1479 ++++ apidocs/docker-cloud/includes/stack.html | 695 ++ apidocs/docker-cloud/includes/tag.html | 121 + apidocs/docker-cloud/includes/triggers.html | 389 + apidocs/docker-cloud/index.html | 6545 +++++++++++++++++ apidocs/docker-cloud/javascripts/all.js | 143 + .../docker-cloud/javascripts/all_nosearch.js | 43 + apidocs/docker-cloud/stylesheets/print.css | 1 + apidocs/docker-cloud/stylesheets/screen.css | 1 + apidocs/layouts/single.html | 6545 +++++++++++++++++ cloud-api-docs/.dockerignore | 1 + cloud-api-docs/.gitignore | 2 + cloud-api-docs/Dockerfile | 15 + cloud-api-docs/Gemfile | 12 + cloud-api-docs/Gemfile.lock | 140 + cloud-api-docs/LICENSE | 13 + cloud-api-docs/Makefile | 27 + cloud-api-docs/README.md | 28 + cloud-api-docs/Rakefile | 6 + cloud-api-docs/config.rb | 38 + cloud-api-docs/docker-compose.yml | 4 + cloud-api-docs/font-selection.json | 148 + cloud-api-docs/publish.sh | 3 + cloud-api-docs/source/fonts/slate.eot | Bin 0 -> 1876 bytes cloud-api-docs/source/fonts/slate.svg | 14 + cloud-api-docs/source/fonts/slate.ttf | Bin 0 -> 1720 bytes cloud-api-docs/source/fonts/slate.woff | Bin 0 -> 1796 bytes cloud-api-docs/source/fonts/slate.woff2 | Bin 0 -> 796 bytes cloud-api-docs/source/images/logo.png | Bin 0 -> 4360 bytes cloud-api-docs/source/images/navbar.png | Bin 0 -> 96 bytes cloud-api-docs/source/includes/_errors.md | 28 + cloud-api-docs/source/includes/action.md | 351 + .../source/includes/availabilityzone.md | 120 + cloud-api-docs/source/includes/container.md | 834 +++ .../source/includes/dockercloud-events.md | 120 + cloud-api-docs/source/includes/node.md | 376 + cloud-api-docs/source/includes/nodecluster.md | 410 ++ cloud-api-docs/source/includes/nodetype.md | 137 + cloud-api-docs/source/includes/provider.md | 132 + cloud-api-docs/source/includes/region.md | 137 + cloud-api-docs/source/includes/registry.md | 85 + cloud-api-docs/source/includes/repository.md | 273 + cloud-api-docs/source/includes/service.md | 933 +++ cloud-api-docs/source/includes/stack.md | 568 ++ cloud-api-docs/source/includes/tag.md | 52 + cloud-api-docs/source/includes/triggers.md | 299 + cloud-api-docs/source/index.md | 138 + cloud-api-docs/source/javascripts/all.js | 4 + .../source/javascripts/all_nosearch.js | 3 + .../source/javascripts/app/_lang.js | 162 + .../source/javascripts/app/_search.js | 74 + cloud-api-docs/source/javascripts/app/_toc.js | 55 + .../source/javascripts/lib/_energize.js | 169 + .../javascripts/lib/_imagesloaded.min.js | 7 + .../javascripts/lib/_jquery.highlight.js | 108 + .../source/javascripts/lib/_jquery.tocify.js | 1042 +++ .../source/javascripts/lib/_jquery_ui.js | 566 ++ .../source/javascripts/lib/_lunr.js | 1910 +++++ cloud-api-docs/source/layouts/layout.erb | 117 + .../source/stylesheets/_icon-font.scss | 38 + .../source/stylesheets/_normalize.css | 427 ++ .../source/stylesheets/_syntax.scss.erb | 27 + .../source/stylesheets/_variables.scss | 109 + .../source/stylesheets/print.css.scss | 142 + .../source/stylesheets/screen.css.scss | 620 ++ docs/.gitignore | 4 + docs/Dockerfile | 9 + docs/LICENSE | 202 + docs/Makefile | 42 + docs/README.md | 26 + docs/apps/api-roles.md | 41 + docs/apps/auto-destroy.md | 84 + docs/apps/auto-redeploy.md | 85 + docs/apps/autorestart.md | 95 + docs/apps/deploy-tags.md | 125 + docs/apps/deploy-to-cloud-btn.md | 70 + docs/apps/images/autodestroy.png | Bin 0 -> 63341 bytes docs/apps/images/autorestart.png | Bin 0 -> 63361 bytes docs/apps/images/data-volumes-wizard.png | Bin 0 -> 25909 bytes docs/apps/images/exposing-port.png | Bin 0 -> 25851 bytes docs/apps/images/host-volumes-wizard.png | Bin 0 -> 37334 bytes docs/apps/images/lbd-containers-start.png | Bin 0 -> 121114 bytes docs/apps/images/lbd-endpoints.png | Bin 0 -> 133973 bytes docs/apps/images/lbd-four-nodes.png | Bin 0 -> 75759 bytes .../apps/images/lbd-hello-world-jumpstart.png | Bin 0 -> 89445 bytes docs/apps/images/lbd-hostname-1.png | Bin 0 -> 55085 bytes docs/apps/images/lbd-lb-conf.png | Bin 0 -> 96369 bytes docs/apps/images/lbd-lb-endpoint.png | Bin 0 -> 41584 bytes docs/apps/images/lbd-lb-envvar.png | Bin 0 -> 118859 bytes docs/apps/images/lbd-lb-ports.png | Bin 0 -> 35970 bytes docs/apps/images/lbd-node-wizard.png | Bin 0 -> 68152 bytes docs/apps/images/lbd-reload.gif | Bin 0 -> 97033 bytes docs/apps/images/lbd-web-conf.png | Bin 0 -> 123113 bytes docs/apps/images/new-trigger-created.png | Bin 0 -> 38763 bytes docs/apps/images/node-detail-tags.png | Bin 0 -> 63676 bytes docs/apps/images/nodecluster-detail-tags.png | Bin 0 -> 61249 bytes docs/apps/images/nodecluster-wizard-tags.png | Bin 0 -> 47637 bytes docs/apps/images/ports-published.png | Bin 0 -> 127473 bytes docs/apps/images/publishing-port.png | Bin 0 -> 27881 bytes docs/apps/images/redeploy-service.png | Bin 0 -> 51307 bytes docs/apps/images/revoke-trigger.png | Bin 0 -> 39306 bytes docs/apps/images/service-before-scaling.png | Bin 0 -> 101590 bytes docs/apps/images/service-during-scaling.png | Bin 0 -> 125816 bytes docs/apps/images/service-links-diagram.png | Bin 0 -> 38828 bytes .../images/service-wizard-autoredeploy.png | Bin 0 -> 53116 bytes docs/apps/images/service-wizard-scale.png | Bin 0 -> 50564 bytes .../service-wizard-sequential-deployment.png | Bin 0 -> 44393 bytes docs/apps/images/service-wizard-tags.png | Bin 0 -> 74821 bytes docs/apps/images/stack-create.png | Bin 0 -> 88866 bytes docs/apps/images/stack-edit.png | Bin 0 -> 39942 bytes docs/apps/images/triggers-tab-blank.png | Bin 0 -> 14020 bytes docs/apps/images/volumes-from-wizard.png | Bin 0 -> 32851 bytes docs/apps/index.md | 42 + docs/apps/load-balance-hello-world.md | 205 + docs/apps/menu.md | 14 + docs/apps/ports.md | 128 + docs/apps/service-links.md | 171 + docs/apps/service-redeploy.md | 82 + docs/apps/service-scaling.md | 164 + docs/apps/stack-yaml-reference.md | 330 + docs/apps/stacks.md | 132 + docs/apps/triggers.md | 62 + docs/apps/volumes.md | 76 + docs/builds/advanced.md | 73 + docs/builds/automated-build.md | 291 + docs/builds/automated-testing.md | 102 + docs/builds/image-scan.md | 189 + docs/builds/images/cancel-build.png | Bin 0 -> 84121 bytes docs/builds/images/create-repository.png | Bin 0 -> 61808 bytes docs/builds/images/edit-repository-builds.png | Bin 0 -> 88577 bytes docs/builds/images/edit-repository.png | Bin 0 -> 75949 bytes .../images/link-source-github-ind-revoke.png | Bin 0 -> 83161 bytes docs/builds/images/link-source-github-ind.png | Bin 0 -> 79343 bytes .../images/link-source-github-org-lite.png | Bin 0 -> 98938 bytes .../images/link-source-github-org-revoke.png | Bin 0 -> 117420 bytes docs/builds/images/link-source-github-org.png | Bin 0 -> 119493 bytes .../images/link-source-unlink-github.png | Bin 0 -> 14485 bytes docs/builds/images/private_image.png | Bin 0 -> 28531 bytes docs/builds/images/repo-general.png | Bin 0 -> 95992 bytes docs/builds/images/scan-enable.png | Bin 0 -> 41603 bytes docs/builds/images/scan-full-details.png | Bin 0 -> 96240 bytes docs/builds/images/scan-single.png | Bin 0 -> 57337 bytes docs/builds/images/scan-tags.png | Bin 0 -> 39764 bytes docs/builds/images/scan-view.png | Bin 0 -> 59442 bytes docs/builds/images/source-providers.png | Bin 0 -> 50355 bytes .../images/third-party-images-modal.png | Bin 0 -> 44026 bytes docs/builds/index.md | 33 + docs/builds/link-source.md | 161 + docs/builds/menu.md | 14 + docs/builds/push-images.md | 66 + docs/builds/repos.md | 97 + docs/docker-errors-faq.md | 112 + docs/dockerid.md | 48 + docs/getting-started/connect-infra.md | 42 + ...ovision_a_data_backend_for_your_service.md | 74 + .../deploy-app/11_service_stacks.md | 77 + .../12_data_management_with_volumes.md | 145 + .../deploy-app/1_introduction.md | 31 + docs/getting-started/deploy-app/2_set_up.md | 88 + .../deploy-app/3_prepare_the_app.md | 55 + .../deploy-app/4_push_to_cloud_registry.md | 57 + .../5_deploy_the_app_as_a_service.md | 95 + .../6_define_environment_variables.md | 82 + .../deploy-app/7_scale_the_service.md | 77 + .../getting-started/deploy-app/8_view_logs.md | 47 + .../deploy-app/9_load-balance_the_service.md | 82 + docs/getting-started/deploy-app/index.md | 30 + .../images/create-first-service.png | Bin 0 -> 34655 bytes .../images/first-service-container-list.png | Bin 0 -> 88603 bytes .../images/first-service-container.png | Bin 0 -> 82920 bytes ...first-service-create-and-deploy-button.png | Bin 0 -> 10664 bytes .../images/first-service-ports.png | Bin 0 -> 24367 bytes .../images/first-service-timeline.png | Bin 0 -> 167775 bytes .../images/first-service-webpage.png | Bin 0 -> 38865 bytes .../images/first-service-wizard.png | Bin 0 -> 46451 bytes docs/getting-started/images/first_node.png | Bin 0 -> 63027 bytes docs/getting-started/index.md | 28 + docs/getting-started/intro_cloud.md | 45 + docs/getting-started/your_first_node.md | 52 + docs/getting-started/your_first_service.md | 129 + docs/images/Docker-Cloud-Blue.png | Bin 0 -> 8600 bytes docs/images/cloud-build.png | Bin 0 -> 76448 bytes docs/images/cloud-clusters.png | Bin 0 -> 49771 bytes docs/images/cloud-stack.png | Bin 0 -> 88866 bytes docs/images/slack-notification-updates.png | Bin 0 -> 37832 bytes docs/images/slack-oauth-authorize.png | Bin 0 -> 27238 bytes docs/index.md | 51 + docs/infrastructure/byoh.md | 136 + docs/infrastructure/cloud-on-aws-faq.md | 159 + .../infrastructure/cloud-on-packet.net-faq.md | 63 + docs/infrastructure/deployment-strategies.md | 61 + docs/infrastructure/docker-upgrade.md | 42 + docs/infrastructure/images/aws-iam-role-1.png | Bin 0 -> 108997 bytes docs/infrastructure/images/aws-iam-role-2.png | Bin 0 -> 116826 bytes .../images/aws-link-account.png | Bin 0 -> 77991 bytes docs/infrastructure/images/aws-modal.png | Bin 0 -> 67754 bytes .../images/azure-link-account.png | Bin 0 -> 66650 bytes .../images/azure-link-modal.png | Bin 0 -> 50583 bytes .../images/azure-portal-subscriptions.png | Bin 0 -> 161170 bytes .../images/azure-upload-certificate.png | Bin 0 -> 24563 bytes .../images/do-approve-access.png | Bin 0 -> 42139 bytes .../infrastructure/images/do-link-account.png | Bin 0 -> 66427 bytes .../infrastructure/images/do-login-screen.png | Bin 0 -> 44046 bytes docs/infrastructure/images/get-node-ip.png | Bin 0 -> 70435 bytes .../images/node-byoh-wizard-v2.png | Bin 0 -> 78235 bytes .../images/packet-add-apikey.png | Bin 0 -> 57417 bytes .../images/packet-link-account.png | Bin 0 -> 66718 bytes .../images/softlayer-link-account.png | Bin 0 -> 63530 bytes .../infrastructure/images/softlayer-modal.png | Bin 0 -> 42355 bytes .../images/softlayer-step-1.png | Bin 0 -> 49428 bytes .../images/softlayer-step-2.png | Bin 0 -> 156885 bytes .../images/softlayer-step-6.png | Bin 0 -> 71890 bytes .../images/softlayer-step-7.png | Bin 0 -> 32118 bytes .../infrastructure/images/upgrade-message.png | Bin 0 -> 21768 bytes docs/infrastructure/index.md | 81 + docs/infrastructure/link-aws.md | 127 + docs/infrastructure/link-azure.md | 49 + docs/infrastructure/link-do.md | 38 + docs/infrastructure/link-packet.md | 35 + docs/infrastructure/link-softlayer.md | 79 + docs/infrastructure/menu.md | 14 + docs/infrastructure/ssh-into-a-node.md | 111 + docs/installing-cli.md | 116 + docs/orgs.md | 236 + docs/overview.md | 51 + docs/release-notes.md | 87 + docs/slack-integration.md | 56 + 248 files changed, 37723 insertions(+) create mode 100644 Jenkinsfile create mode 100644 README.md create mode 100644 apidocs/docker-cloud.md create mode 100644 apidocs/docker-cloud/fonts/slate.eot create mode 100644 apidocs/docker-cloud/fonts/slate.svg create mode 100644 apidocs/docker-cloud/fonts/slate.ttf create mode 100644 apidocs/docker-cloud/fonts/slate.woff create mode 100644 apidocs/docker-cloud/fonts/slate.woff2 create mode 100644 apidocs/docker-cloud/images/logo.png create mode 100644 apidocs/docker-cloud/images/navbar.png create mode 100644 apidocs/docker-cloud/includes/action.html create mode 100644 apidocs/docker-cloud/includes/availabilityzone.html create mode 100644 apidocs/docker-cloud/includes/container.html create mode 100644 apidocs/docker-cloud/includes/dockercloud-events.html create mode 100644 apidocs/docker-cloud/includes/node.html create mode 100644 apidocs/docker-cloud/includes/nodecluster.html create mode 100644 apidocs/docker-cloud/includes/nodetype.html create mode 100644 apidocs/docker-cloud/includes/provider.html create mode 100644 apidocs/docker-cloud/includes/region.html create mode 100644 apidocs/docker-cloud/includes/registry.html create mode 100644 apidocs/docker-cloud/includes/repository.html create mode 100644 apidocs/docker-cloud/includes/service.html create mode 100644 apidocs/docker-cloud/includes/stack.html create mode 100644 apidocs/docker-cloud/includes/tag.html create mode 100644 apidocs/docker-cloud/includes/triggers.html create mode 100644 apidocs/docker-cloud/index.html create mode 100644 apidocs/docker-cloud/javascripts/all.js create mode 100644 apidocs/docker-cloud/javascripts/all_nosearch.js create mode 100644 apidocs/docker-cloud/stylesheets/print.css create mode 100644 apidocs/docker-cloud/stylesheets/screen.css create mode 100644 apidocs/layouts/single.html create mode 100644 cloud-api-docs/.dockerignore create mode 100644 cloud-api-docs/.gitignore create mode 100644 cloud-api-docs/Dockerfile create mode 100644 cloud-api-docs/Gemfile create mode 100644 cloud-api-docs/Gemfile.lock create mode 100644 cloud-api-docs/LICENSE create mode 100644 cloud-api-docs/Makefile create mode 100644 cloud-api-docs/README.md create mode 100644 cloud-api-docs/Rakefile create mode 100644 cloud-api-docs/config.rb create mode 100644 cloud-api-docs/docker-compose.yml create mode 100644 cloud-api-docs/font-selection.json create mode 100644 cloud-api-docs/publish.sh create mode 100644 cloud-api-docs/source/fonts/slate.eot create mode 100644 cloud-api-docs/source/fonts/slate.svg create mode 100644 cloud-api-docs/source/fonts/slate.ttf create mode 100644 cloud-api-docs/source/fonts/slate.woff create mode 100644 cloud-api-docs/source/fonts/slate.woff2 create mode 100644 cloud-api-docs/source/images/logo.png create mode 100644 cloud-api-docs/source/images/navbar.png create mode 100644 cloud-api-docs/source/includes/_errors.md create mode 100644 cloud-api-docs/source/includes/action.md create mode 100644 cloud-api-docs/source/includes/availabilityzone.md create mode 100644 cloud-api-docs/source/includes/container.md create mode 100644 cloud-api-docs/source/includes/dockercloud-events.md create mode 100644 cloud-api-docs/source/includes/node.md create mode 100644 cloud-api-docs/source/includes/nodecluster.md create mode 100644 cloud-api-docs/source/includes/nodetype.md create mode 100644 cloud-api-docs/source/includes/provider.md create mode 100644 cloud-api-docs/source/includes/region.md create mode 100644 cloud-api-docs/source/includes/registry.md create mode 100644 cloud-api-docs/source/includes/repository.md create mode 100644 cloud-api-docs/source/includes/service.md create mode 100644 cloud-api-docs/source/includes/stack.md create mode 100644 cloud-api-docs/source/includes/tag.md create mode 100644 cloud-api-docs/source/includes/triggers.md create mode 100644 cloud-api-docs/source/index.md create mode 100644 cloud-api-docs/source/javascripts/all.js create mode 100644 cloud-api-docs/source/javascripts/all_nosearch.js create mode 100644 cloud-api-docs/source/javascripts/app/_lang.js create mode 100644 cloud-api-docs/source/javascripts/app/_search.js create mode 100644 cloud-api-docs/source/javascripts/app/_toc.js create mode 100644 cloud-api-docs/source/javascripts/lib/_energize.js create mode 100644 cloud-api-docs/source/javascripts/lib/_imagesloaded.min.js create mode 100644 cloud-api-docs/source/javascripts/lib/_jquery.highlight.js create mode 100644 cloud-api-docs/source/javascripts/lib/_jquery.tocify.js create mode 100644 cloud-api-docs/source/javascripts/lib/_jquery_ui.js create mode 100644 cloud-api-docs/source/javascripts/lib/_lunr.js create mode 100644 cloud-api-docs/source/layouts/layout.erb create mode 100644 cloud-api-docs/source/stylesheets/_icon-font.scss create mode 100644 cloud-api-docs/source/stylesheets/_normalize.css create mode 100644 cloud-api-docs/source/stylesheets/_syntax.scss.erb create mode 100644 cloud-api-docs/source/stylesheets/_variables.scss create mode 100644 cloud-api-docs/source/stylesheets/print.css.scss create mode 100644 cloud-api-docs/source/stylesheets/screen.css.scss create mode 100644 docs/.gitignore create mode 100644 docs/Dockerfile create mode 100644 docs/LICENSE create mode 100644 docs/Makefile create mode 100644 docs/README.md create mode 100644 docs/apps/api-roles.md create mode 100644 docs/apps/auto-destroy.md create mode 100644 docs/apps/auto-redeploy.md create mode 100644 docs/apps/autorestart.md create mode 100644 docs/apps/deploy-tags.md create mode 100644 docs/apps/deploy-to-cloud-btn.md create mode 100644 docs/apps/images/autodestroy.png create mode 100644 docs/apps/images/autorestart.png create mode 100644 docs/apps/images/data-volumes-wizard.png create mode 100644 docs/apps/images/exposing-port.png create mode 100644 docs/apps/images/host-volumes-wizard.png create mode 100644 docs/apps/images/lbd-containers-start.png create mode 100644 docs/apps/images/lbd-endpoints.png create mode 100644 docs/apps/images/lbd-four-nodes.png create mode 100644 docs/apps/images/lbd-hello-world-jumpstart.png create mode 100644 docs/apps/images/lbd-hostname-1.png create mode 100644 docs/apps/images/lbd-lb-conf.png create mode 100644 docs/apps/images/lbd-lb-endpoint.png create mode 100644 docs/apps/images/lbd-lb-envvar.png create mode 100644 docs/apps/images/lbd-lb-ports.png create mode 100644 docs/apps/images/lbd-node-wizard.png create mode 100644 docs/apps/images/lbd-reload.gif create mode 100644 docs/apps/images/lbd-web-conf.png create mode 100644 docs/apps/images/new-trigger-created.png create mode 100644 docs/apps/images/node-detail-tags.png create mode 100644 docs/apps/images/nodecluster-detail-tags.png create mode 100644 docs/apps/images/nodecluster-wizard-tags.png create mode 100644 docs/apps/images/ports-published.png create mode 100644 docs/apps/images/publishing-port.png create mode 100644 docs/apps/images/redeploy-service.png create mode 100644 docs/apps/images/revoke-trigger.png create mode 100644 docs/apps/images/service-before-scaling.png create mode 100644 docs/apps/images/service-during-scaling.png create mode 100644 docs/apps/images/service-links-diagram.png create mode 100644 docs/apps/images/service-wizard-autoredeploy.png create mode 100644 docs/apps/images/service-wizard-scale.png create mode 100644 docs/apps/images/service-wizard-sequential-deployment.png create mode 100644 docs/apps/images/service-wizard-tags.png create mode 100644 docs/apps/images/stack-create.png create mode 100644 docs/apps/images/stack-edit.png create mode 100644 docs/apps/images/triggers-tab-blank.png create mode 100644 docs/apps/images/volumes-from-wizard.png create mode 100644 docs/apps/index.md create mode 100644 docs/apps/load-balance-hello-world.md create mode 100644 docs/apps/menu.md create mode 100644 docs/apps/ports.md create mode 100644 docs/apps/service-links.md create mode 100644 docs/apps/service-redeploy.md create mode 100644 docs/apps/service-scaling.md create mode 100644 docs/apps/stack-yaml-reference.md create mode 100644 docs/apps/stacks.md create mode 100644 docs/apps/triggers.md create mode 100644 docs/apps/volumes.md create mode 100644 docs/builds/advanced.md create mode 100644 docs/builds/automated-build.md create mode 100644 docs/builds/automated-testing.md create mode 100644 docs/builds/image-scan.md create mode 100644 docs/builds/images/cancel-build.png create mode 100644 docs/builds/images/create-repository.png create mode 100644 docs/builds/images/edit-repository-builds.png create mode 100644 docs/builds/images/edit-repository.png create mode 100644 docs/builds/images/link-source-github-ind-revoke.png create mode 100644 docs/builds/images/link-source-github-ind.png create mode 100644 docs/builds/images/link-source-github-org-lite.png create mode 100644 docs/builds/images/link-source-github-org-revoke.png create mode 100644 docs/builds/images/link-source-github-org.png create mode 100644 docs/builds/images/link-source-unlink-github.png create mode 100644 docs/builds/images/private_image.png create mode 100644 docs/builds/images/repo-general.png create mode 100644 docs/builds/images/scan-enable.png create mode 100644 docs/builds/images/scan-full-details.png create mode 100644 docs/builds/images/scan-single.png create mode 100644 docs/builds/images/scan-tags.png create mode 100644 docs/builds/images/scan-view.png create mode 100644 docs/builds/images/source-providers.png create mode 100644 docs/builds/images/third-party-images-modal.png create mode 100644 docs/builds/index.md create mode 100644 docs/builds/link-source.md create mode 100644 docs/builds/menu.md create mode 100644 docs/builds/push-images.md create mode 100644 docs/builds/repos.md create mode 100644 docs/docker-errors-faq.md create mode 100644 docs/dockerid.md create mode 100644 docs/getting-started/connect-infra.md create mode 100644 docs/getting-started/deploy-app/10_provision_a_data_backend_for_your_service.md create mode 100644 docs/getting-started/deploy-app/11_service_stacks.md create mode 100644 docs/getting-started/deploy-app/12_data_management_with_volumes.md create mode 100644 docs/getting-started/deploy-app/1_introduction.md create mode 100644 docs/getting-started/deploy-app/2_set_up.md create mode 100644 docs/getting-started/deploy-app/3_prepare_the_app.md create mode 100644 docs/getting-started/deploy-app/4_push_to_cloud_registry.md create mode 100644 docs/getting-started/deploy-app/5_deploy_the_app_as_a_service.md create mode 100644 docs/getting-started/deploy-app/6_define_environment_variables.md create mode 100644 docs/getting-started/deploy-app/7_scale_the_service.md create mode 100644 docs/getting-started/deploy-app/8_view_logs.md create mode 100644 docs/getting-started/deploy-app/9_load-balance_the_service.md create mode 100644 docs/getting-started/deploy-app/index.md create mode 100644 docs/getting-started/images/create-first-service.png create mode 100644 docs/getting-started/images/first-service-container-list.png create mode 100644 docs/getting-started/images/first-service-container.png create mode 100644 docs/getting-started/images/first-service-create-and-deploy-button.png create mode 100644 docs/getting-started/images/first-service-ports.png create mode 100644 docs/getting-started/images/first-service-timeline.png create mode 100644 docs/getting-started/images/first-service-webpage.png create mode 100644 docs/getting-started/images/first-service-wizard.png create mode 100644 docs/getting-started/images/first_node.png create mode 100644 docs/getting-started/index.md create mode 100644 docs/getting-started/intro_cloud.md create mode 100644 docs/getting-started/your_first_node.md create mode 100644 docs/getting-started/your_first_service.md create mode 100644 docs/images/Docker-Cloud-Blue.png create mode 100644 docs/images/cloud-build.png create mode 100644 docs/images/cloud-clusters.png create mode 100644 docs/images/cloud-stack.png create mode 100644 docs/images/slack-notification-updates.png create mode 100644 docs/images/slack-oauth-authorize.png create mode 100644 docs/index.md create mode 100644 docs/infrastructure/byoh.md create mode 100644 docs/infrastructure/cloud-on-aws-faq.md create mode 100644 docs/infrastructure/cloud-on-packet.net-faq.md create mode 100644 docs/infrastructure/deployment-strategies.md create mode 100644 docs/infrastructure/docker-upgrade.md create mode 100644 docs/infrastructure/images/aws-iam-role-1.png create mode 100644 docs/infrastructure/images/aws-iam-role-2.png create mode 100644 docs/infrastructure/images/aws-link-account.png create mode 100644 docs/infrastructure/images/aws-modal.png create mode 100644 docs/infrastructure/images/azure-link-account.png create mode 100644 docs/infrastructure/images/azure-link-modal.png create mode 100644 docs/infrastructure/images/azure-portal-subscriptions.png create mode 100644 docs/infrastructure/images/azure-upload-certificate.png create mode 100644 docs/infrastructure/images/do-approve-access.png create mode 100644 docs/infrastructure/images/do-link-account.png create mode 100644 docs/infrastructure/images/do-login-screen.png create mode 100644 docs/infrastructure/images/get-node-ip.png create mode 100644 docs/infrastructure/images/node-byoh-wizard-v2.png create mode 100644 docs/infrastructure/images/packet-add-apikey.png create mode 100644 docs/infrastructure/images/packet-link-account.png create mode 100644 docs/infrastructure/images/softlayer-link-account.png create mode 100644 docs/infrastructure/images/softlayer-modal.png create mode 100644 docs/infrastructure/images/softlayer-step-1.png create mode 100644 docs/infrastructure/images/softlayer-step-2.png create mode 100644 docs/infrastructure/images/softlayer-step-6.png create mode 100644 docs/infrastructure/images/softlayer-step-7.png create mode 100644 docs/infrastructure/images/upgrade-message.png create mode 100644 docs/infrastructure/index.md create mode 100644 docs/infrastructure/link-aws.md create mode 100644 docs/infrastructure/link-azure.md create mode 100644 docs/infrastructure/link-do.md create mode 100644 docs/infrastructure/link-packet.md create mode 100644 docs/infrastructure/link-softlayer.md create mode 100644 docs/infrastructure/menu.md create mode 100644 docs/infrastructure/ssh-into-a-node.md create mode 100644 docs/installing-cli.md create mode 100644 docs/orgs.md create mode 100644 docs/overview.md create mode 100644 docs/release-notes.md create mode 100644 docs/slack-integration.md diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000..a91de56a75 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,7 @@ +wrappedNode(label: 'docker') { + deleteDir() + stage "checkout" + checkout scm + + documentationChecker("docs") +} diff --git a/README.md b/README.md new file mode 100644 index 0000000000..d39ab02b31 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# Documentation for Docker Cloud + +To build the documentation locally. + +1. Fork this repo. + +2. Change to the `docs` directory. + +3. Type `make docs`. + + +## API Documentation Pull Requests + +The API documentation for the Docker Cloud project is here + +https://github.com/docker/cloud-docs + +An extra step is needed when making PR's that modify the API - namely to add the generated HTML output to the PR by doing the following: + +1. Make changes to the API's Markdown source. + +2. Build the HTML for the API in your local branch. + + a. Change to the `cloud-api-docs` directory + + cd cloud-api-docs + + b. Generate the HTML + + make release + +3. Add the Markdown together with the HTML to your pull request: + + $ git add apidocs/* + + $ git add docs + +4. Push your changes to orgin. + +5. Create a Pull request as you normally wouled. diff --git a/apidocs/docker-cloud.md b/apidocs/docker-cloud.md new file mode 100644 index 0000000000..15449d00d7 --- /dev/null +++ b/apidocs/docker-cloud.md @@ -0,0 +1,14 @@ ++++ +type = "cloud-api-docs" +title = "API reference" +description = "API reference" +keywords = ["Docker, cloud, API"] +weight = 100 +[menu.main] +parent="docker-cloud" +identifier = "docker-cloudapi" ++++ + +# Docker Cloud APIs + +Please see the Overview page. diff --git a/apidocs/docker-cloud/fonts/slate.eot b/apidocs/docker-cloud/fonts/slate.eot new file mode 100644 index 0000000000000000000000000000000000000000..13c4839a1975d4c92d66753d75553f922743c6ef GIT binary patch literal 1876 zcmaJ?&2Jl35TEDWeRg&sP8)xqh$Kr)Yzaiu#`dnNaHtS!Xx9i53LF}#nAmmP`Xfq= z;s{Zte*qCEK;i~h4hYFPaA-x4sD#vVrBXQ{MIaD@1Ke8kn|8tnQ^fdI9N^x@? zd<=RUJW{D`U;b-v<0kYSA}zO8E|&DaCqF0BzlPme0}$TUZbAP8`m<~GR{K~75*dg= zcCEQu4DE@ZpmS=+>&5muJwb0nf0^x#V!izR7X1vpggLV7&CM3_1j&!tPMS_)mkgrN zC!rsJe5kniow8zt{RT+zltXle=pd}!=-!|+8X9a|iyqm&z#GOh#?Z4hMmoI$K1va6 zrUYgm&_U=R+`ZrJ0!LQ9E`42ef0@uHvC8U zo}w4%B?O&MCX$JGEG)w^HIqqa()pb0xK4IFpUb457c*fwDPqaQf|z%md}h1{#>ac0 zD>_@{@&c$_-fEYWRBE3yj7U8q4MTz%hA^cOxdwei%19MlXpM(P_)+e=@Rm}B>tXap zwoqO*DogaoKF+^`!zvX>{f10 zq*F6dk@0&Ok4=k2cHR|EKKaOn+_Q3KG-~~J-9n!;&D+d{W9=SQ|IqlDm9?y2uUl{( zi(0o$Q@Cby<g+B7U zE7gMM6{=S}Ps}C~lhg72%h#4X&vB-0d)je4Z)w>(?>M%-xE~jH;l@L}Lcyy(n4O9z z65lS`w&R>XbW_^$2bKN!lz(S%N3N!tcP>R={D&-^3rjyfS-aWi!AkH>sk+00G5&qW zC1%n(1Gmpd;5$IPUF_Lw@K%&WbbxEX?LgKcF9x!K$J`8LiMQ^#KsG5yOZ=|rBS1K&l2uG4tC&hwF_o-hDp_Le zTrgI}?0+pse + + +Generated by IcoMoon + + + + + + + + + + diff --git a/apidocs/docker-cloud/fonts/slate.ttf b/apidocs/docker-cloud/fonts/slate.ttf new file mode 100644 index 0000000000000000000000000000000000000000..ace9a46a7e1ed6b6ab3de2f30ef3e27c572f88d3 GIT binary patch literal 1720 zcmaJ>-D_KA7=PaL@t*V?ZMro%kz(6pV-rwZyCyk@Q7?wb>UJv9`gO6wj7^qiCTUqB zO%X@;7dX69!8^V6LWJzXiw!F%45qgVdLa}=5xvm6E&iVKo-9$jJ@CHI_viaTf`}a2 zC!H2wcyVDVd0amU$>&(FZ8pn0bm7yth{U7dH)`ef4)6r{E^wmO*t_`0^~*QG?-S|8 zt!lYq{5ky*k?|Sy{uTt*p8hrX-@re<)$DYS^+1t{800m!H_O^}@g4X@@W-3w?hZXf zuY!M;^{sNV`qeJ|2)=?Gg`Mqo2XzAEd#oqjAaRXMBJF+c79{T|EPkbe7-PE;5S;Q~ zaGL1Q(r@%{&}khDI-bPX!~GUGz-0@x9Aaiik?BxrHq?#(PnWnI%nYaReOv*$ZSm>?)ctla|1hAG;T1^YPnfOv{N&_J8ekcvoG^Cm?MLpzb znO-8ASEU{s)D{<<&JKz%JjTWAM|EWWzjHMajT;ECdZ?bsKw&|^tZONrkvOuIkI%De zUYTtG_26}0jYK0>4*B1QgBuPLXU?}t^*TiboK|r`R>P0_HD+(cdi{Ze{FKYDLBs0R~?v6B%Rx~Edo2aasT@IJ-vtfG(iE^ z$Awv_E5l{^C4s84a|;3+->t#z!u^V-9Nj!@+Ph(RslFP9tMyA^DCS*vdNzG<@yc2l z`u?ov&H8>AuC0gXeBbj{4$|U#n6XQ^x*FE+&d;P>_lp(J^Zj%8%oMl&cI_ZN6TKO{ zkvFp2-&{yO{TDd~50<`txN&oc<4*8TskuV~pXj~g5i{t$k=GYVU^@bQTx>a5uvcK? zADE$i`dge4A3((KH9;?{zv*7K*f>Jt^humckR5yQeHf=xv0R7Ti)jP&N=%#Ng5wPM z_VCv|5z{smX^sCCV+<0Gsc02b(JH2*RZK;zn2MJ0U5I^E%r-TsOdYDyD_EDQO?BF) z7OFc*Cuk9TtZz5Uo$8RKb(q)a%}C8|gD__z_YMNoV9|<#sst6tUZ*|mXK52w&tq|_ J6Wq-M;U6NW`v(93 literal 0 HcmV?d00001 diff --git a/apidocs/docker-cloud/fonts/slate.woff b/apidocs/docker-cloud/fonts/slate.woff new file mode 100644 index 0000000000000000000000000000000000000000..1e72e0ee0018119d7c814c2097cc60c0bcd05d84 GIT binary patch literal 1796 zcmaJ>&2Jl35TCanZ=GF;-Nqj%Qj#SmwgjS~vAs(b4i$%lc7v*fuR|jhlemtH?Nqf< z5&;$c3y8RZ#0{p83^QtGf$~^ZU#vdPL3b z4fcBr_DN>rKz!G#?&4f~pM4ZRM6a}~ts1aTadwIM%N_dh>UO7#K7YRFXF@YA68l_? z@xFm7>0K?wZ&VUvut!OxMlIIQ5*<0_&Hha~Yl49Y@PK@!7+CqFG*;eClSR)#j$=Xw zNnrjF9T`VX|4zRT99<||DqHk_nzSa(NzO5voBad{L?lOWoE4r?ZbRP(V_X@TZL>{} z(3A8mk}l-3xojrwNJr*pi-lsLQVxSKC{0w##ljO}){#>poy#tYg)pcTCk9|L<3To?f*omEO$b9ODUa}gVj!a zAvUB1l6OCpmTg;7PgnO)phbF-Xik@UVo+OLa3((}zVs*;Zywi?{r}GOL=0{q1ou!q ztD%;HAbGE?Z5HC#RzAMSTXWiN9ioS*i+Usm@#fI}eK@$`F!8DQHtAj`iEnm!UKH}P zNl{d*%%o>TwzLq6ppv_9BR_a$H<|Q)z2RXkyY6k4BJlQ)o4+xU@=Bif%MA~%sib$? zbw%hV*Y96nzi0MvpHdWZeO#D>x^i4rP!XsqKRYk5@ZB2RF5E9QWp(qg81F^VmBvaG ztu(Ggk(kS7r)DyTm#?ozQ4q}d{!9==(dt@sJ_vk&`7k5ChZ~1PD=Sgs?%Z@HoBe#* z_k-a4JvVKwyWWZ=q2@1#9uk~9EfrHBtA=!8%MC` zIGu@c6SyDi7WCym@ z2-w*rE$c_UfviKEL=Vy>={0bo+(i5#P1q3$6VB``hVMrCzU@B6vbqKcPy}m-BtQn- zkylU>byNe6DE>18g5d9bm%bZqa|qF=7&3(|U!AY)%Yg-vOsqKIq$w0D$r*3}ks4=+ z>U6?w2xMd=B$;zQ9v)F1K7KwfQ9|)<9nl&i?6-rchs{I8LC1eK^@#(|^QwB-{VeQz zoHLn@cwG?Yo(X!F(Q8iBOqSNs${h}C*?qJYLuZAnVXqx{ww|}Ux0`ca^V#hz?c7{r z7ldYbmk!M1m3G+IYC6(!VcCzqp&pJkZ#1@kw2W<^EJMqOM;^&dq6ELC*|pK!(cC0< zbZtF%BzLsuTw5O*+eg;dX0a+hcfI=gj8a~qWYJoMamHAo)!Qq|6&~9S8`{d0T?L&% z@$R=P6H0rTp6V+-Dlb>EB67JEMQ>kk%`y}{hvBC(RNEw)*%|U|4>SL+B=3rE@y*rw zR_bLZr&~XN?C;+yx2IilcDnrb?M)}An;DsTe@^rq$9L-UWNqY_oTyWyYisN3CMIh; z*C)b12exYgK^2c4S}J#2YJ+00rUlj%+LqQ7E%lldEc`K|1Bky)iLkwF{Wltvj!{A+PBEzhE3BX) zFBgqmj@&z?N1*=OK?z54T7is8FiA(N66oe`X+cKl>`n&&000000HC;3 zk^ug-#56-JW5JAtMV6Rgj#+|9A(7;@^`+^dWy@Alt7D86w|;R>QMs>d+47HJVfKhH aD;vc&%m&dlj4($-ipx}q&#}A+00017%3vV? literal 0 HcmV?d00001 diff --git a/apidocs/docker-cloud/images/logo.png b/apidocs/docker-cloud/images/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..2442aba6fc21618a95fbcac0a08559a7f8218310 GIT binary patch literal 4360 zcmV+j5%=ziP)et z{##YwRbN$ibyZi_?lx$UP|^cQ4mDUL%b}_}dc2--E+JYtRxb248?Tz)1Wl))b-tAQ{!!7yhDZ zZu(Dj4uNwy_zp;KCA`Mup9I-xEc*9ZCG2h`f4nW5RDS1z*n05icl%Oo8Mvi2uBXM!cbrR8pc z{0DAKl;;@vt}fr^k?jGNfggbeN{Yxg2T|w|Yoio{$Fmrz-A{l*yZ2fbZe%5#7yV}QVG4Hkg4;5d(+9UyCv*?#a#YuaRDu>+)^W2gS>3&o(>l3dw8%@xK&LI2y#gE^H;5@Jbh-#J>u0H&iQ_`xcNuZlBs8u`Vp zEJ_}`&y8)(0HM4E7-#sG`T0SX?*JKY{Q3?M)rEYP(W!~aFNV=w)6=r&ec!f1)!EX(iCCoVL`Vd^Gq4m0Je8W7r18-l-_HZYu+3eC1R4(5e9D*FLK2dV+5hc#j&mwjg1zniBY z>x@$T7A4uEOpG&;^{p&3gfZWJm;GitCmT zy>A0#m%$fY(rorT7(m^6rwXM~4Uo_v5@A6-V3$8Dx!~>%tOv_hK+C0h5o_4d=*iZl z6%@22X#?zx<;t_=?Go!|6!p&06O06RF-YDb?oY^v(K>W;c~`OZO~UD?j$Jk~*^JD1((`jNEKg;vsYPR} zlbWBECU;~FCwt})qhf8X#T1jt#h0~JYM^h;K_mHf# zQ4SD#MeEYeUpn&=csakq+>Q zbP894K7-)52lj}FZpQtA-BHqU3w>YsEzrqc(G1Wu!x0SlI`Xp$h;($M3&>c3z-tF~ zaD7mo1N@d*DK$iT4-t*>*cIid3H7KSbpA_cvD&+Jdh@Z(AXM}?&Nuf~K>23S4)pes z&E$!3EwA1d;%pc;?zL0f0twys z@TdE=54aoj3RI3uK!xfoKk5Oqzn=i!1l3RaQGom+_@Rdtk>4I*`;uSV(7h!n42;^aX*ZbG^Z#yE(WJybe|ZOByV%0R4_f=uKsPqNkI; z_ku5gAAJn-FsrYW@>H%3F1>iiM)=dySMPDD zcRAYFM9$%B7RrgR(QKjj1`Sfp`mI1CumUVbu0Bg6c>AU?dOBpX&^|qxO8us>vY~)-EG_L?{BU>bj^`Zyj93Z(q$!nzpdFsuf;?a3jeml1B z=V6za)Zre8bBU#WbibF}&*85E+HvvHT*G*XRJ$KunhN7<;Abmct*ys`pH=YCC!Vrf z97dss%gB;{1G)Ch6H0oZe)a(G5L<$yz;i&qXcUF?d&@dd*DRl2!7i^|tbFQ9Y>LwZ zdCwqR{M`uYqT+-Vn^*0wXlFzpuJ!?2f+#c-r7=K<-L#99&_>z=c@Gf!t25AcUwxoT z8ljI>I*PH3LGf*UXjIaM!h4{Q0g~6UqwtW6;^DgF1>C=1St)En-voU-@;9nS+(HIO z)a6RKcUL7hz<oOD^2D%4Pd>ZIT(8-QSU*3Vpbq+`E3nC^74HVt&dLx=1v>CoLS zwhiR%QJQNlFG`A?VjT-C=`S7X2#`(%yT^!hu(5-mPxv}oFM7#O?()#-meQ=M%J?n? z|6C)}K}(${6Lc&@ZMCHQ3t(s0Z`}DpzJqA{H7eWIgbj+h47z}R~Y2HL#S}ubDlx4xgUr$J80nf60*i%1Q2Ptl}7O5o9?NntpH2Vpj@re`3+G?{cKU z1hp;DZkmpuFD_P)TocuEj`4p5bu9?03)xS|^lqRJvnOI(v$PAcDHfktv?}QXG?Q!t z`h(ah?*T%9RYapN%whCAov1oq16P7kl=b~&6sS#7Ja^Y-06}%rKU*Qw(m|x%wdK{> zqWwG(&pH7yiMq007j!g${%xW;!=$y65Q_%Mji&Om={vuZ90kRe_W&`qJ|3a=Ezq$? zmQ|nDu5qtbBZN_-qBZuP=v)o(awP2{sn6DcAteZKe^bZk9O|+U#{F`zDVC}pcA}=h zwk5@g<42(bL{FSALjvi^ji_n)VxX_n_klOTv7k0cPvhSaQ&`Nk5tmzMJ5$hKom}e* zij=qY&C9{RU52&K!KPTMpE-_qb@H)f3mPC?z|}-?Lr5e?GVNWD{84mw1N!oQ0w~IQ zF(eL&G&s5w!{jV_wJqM-1n_Bz0%>9DnV&;_c7Ryh98BX?<$C^rNBh9DeHU9L1q~1r z#Y3d;ghVtDnSNbVI}WqRYxhG-h*FX^6OO6_gF}5{`zG54NZkDw$Gs4DOi}%5kceWR zaSQGgZaVE~`~j>~gaK3mUtfbe2FQ!ao{jTv#93L)N@DbF2S%G1eTKQR_3ad<>!Ill!jz+Q7z^s98FH! zeg!o+Qf1kdv^RbxF=@Bz`|Rpvr7^`s(}s(0FMKfrv@@%ISEgaaiuN^n?|Jn9XUgq8 ze7~Z$Xm$VPvN_=A=VZgwH=_^z6bj+RHb4{vH{vLcLK*}tBgU^9G%mR-ZLJ3Z7k>kxifk#Ju+|6ZV`Xx6+|sl zhdv)%W%TdonrlXim0}$rii{v9kmw2XqRJ(r)zot@*opct1+_Im3vMp4ufvH3x#-W_ z1P4@Si}REE^p*ZmJ2 zbY)TV_-KvpE8y2)F1QQSEus-efJ#sd(rL~KK!5mHn*e1;#Fg(^EFCd_8;EpftY1*$ zkflATDciGHgUHK|FI<1<=udp=9F|DunskgrgCRxa8-m|}$v~tN#oJlAo5Jr1RsoUz z+iY8qTDp;L3iJo!Y};OSZEYU;xj-}!*!Y`}*B^W94)kl#`cq6Iomt!4+SbXG2J8oh zf-gZKqM)G@fb)TlQFJvRNs&I-y=n3`QQxV~Y?QW{LVbD?cfm-zk-b4@ zplhXN_%fhP7`<~0Ls!edKtld3zQ&?(6;Rx}1I;+PmNURmbkYVkJeTxc!`lYcsry0q zz}sLXKBkful~Pk*QENz?$I=7ba7}Tfn@lgs`sTEp8$?^BMI-9e;Lxw!rVXZiD#TYK z{DcmyeEcRhNe?7Fkn}*(14$1gJ&^Q3(gSs_2mTL%;u>+QuZAT60000 + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Actions

+ +

Action

+ +
+

Example

+
+
{
+    "action": "Cluster Create",
+    "end_date": "Wed, 17 Sep 2014 08:26:22 +0000",
+    "ip": "56.78.90.12",
+    "is_user_action": true,
+    "can_be_canceled": false,
+    "location": "New York, USA",
+    "method": "POST",
+    "object": "/api/infra/v1/cluster/eea638f4-b77a-4183-b241-22dbd7866f22/",
+    "path": "/api/infra/v1/cluster/",
+    "resource_uri": "/api/audit/v1/action/6246c558-976c-4df6-ba60-eb1a344a17af/",
+    "start_date": "Wed, 17 Sep 2014 08:26:22 +0000",
+    "state": "Success",
+    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2",
+    "uuid": "6246c558-976c-4df6-ba60-eb1a344a17af"
+}
+
+ +

An action represents an API call by a user. Details of the API call such as timestamp, origin IP address, and user agent are logged in the action object.

+ +

Simple API calls that do not require asynchronous execution will return immediately with the appropiate HTTP error code and an action object will be created either in Success or Failed states. API calls that do require asynchronous execution will return HTTP code 202 Accepted immediately and create an action object in In progress state, which will change to Success or Failed state depending on the outcome of the operation being performed. In both cases the response will include a X-DockerCloud-Action-URI header with the resource URI of the created action.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
resource_uriA unique API endpoint that represents the action
uuidA unique identifier for the action generated automatically on creation
objectThe API object (resource URI) to which the action applies to
actionName of the operation performed/being performed
methodHTTP method used to access the API
pathHTTP path of the API accessed
user_agentThe user agent provided by the client when accessing the API endpoint
start_dateDate and time when the API call was performed and the operation started processing
end_dateDate and time when the API call finished processing
stateState of the operation (see table below)
ipIP address of the user that performed the API call
locationGeographic location of the IP address of the user that performed the API call
is_user_actionIf the action has been triggered by the user
can_be_canceledIf the action can be canceled by the user in the middle of its execution
can_be_retriedIf the action can be retried by the user
+ +

Action states

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StateDescription
PendingThe action needed asynchronous execution and it is waiting for an in progress action
In progressThe action needed asynchronous execution and is being performed
CancelingThe action is being canceled by user request
CanceledThe action has been canceled
SuccessThe action was executed successfully
FailedThere was an issue when the action was being performed. Check the logs for more information.
+ +

List all actions

+
import dockercloud
+
+actions = dockercloud.Action.list()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+actionList, err := dockercloud.ListActions()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(actionList)
+
+
GET /api/audit/v1/action/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud action ls
+
+ +

Lists all actions in chronological order. Returns a list of Action objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/audit/v1/action/

+ +

Query Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
uuidFilter by UUID.
stateFilter by state. Possible values: In progress, Success, Failed
start_dateFilter by start date. Valid filtering values are start_date__gte (after or on the date supplied) and start_date__lte (before or on the date supplied)
end_dateFilter by end date. Valid filtering values are end_date__gte (after or on the date supplied) and end_date__lte (before or on the date supplied)
objectFilter by resource URI of the related object. This filter can only be combined with ‘include_related’ filter
include_relatedThere is a parent-child relationship between Docker Cloud objects, described in table Relationships between Docker Cloud objects. If set to 'true’, will include the actions of the related objects to the object specified in “object” filter parameter. Possible values: 'true’ or 'false’
+ +

Relationships between Docker Cloud objects

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ObjectRelationships
ContainerContainer, service, stack (if any)
ServiceAll containers in the service, service, stack (if any)
StackAll services in the stack, all containers in every service in the stack, stack
NodeNode, node cluster (if any)
Node clusterAll nodes in the cluster, node cluster
+ +

Get an action by UUID

+
import dockercloud
+
+action = dockercloud.Action.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+action, err := dockercloud.GetAction("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(action)
+
+
GET /api/audit/v1/action/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud action inspect 7eaf7fff
+
+ +

Get all the details of an specific action

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/audit/v1/action/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the action to retrieve
+ +

Get the logs of an action

+ +
+

Example log line

+
+
{
+    "type": "log",
+    "log": "Log line from the action",
+    "timestamp": 1433779324
+}
+
+
import dockercloud
+
+def log_handler(message):
+    print message
+
+action = dockercloud.Action.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+action.logs(tail=300, follow=True, log_handler=log_handler)
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+c := make(chan dockercloud.Logs)
+action, err := dockercloud.GetAction("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+    log.Println(err)
+}
+
+go action.GetLogs(c)
+
+for {
+    log.Println(<-c)
+}
+
+
GET /api/audit/v1/action/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/logs/ HTTP/1.1
+Host: ws.cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Connection: Upgrade
+Upgrade: websocket
+
+
docker-cloud action logs 7eaf7fff-882c-4f3d-9a8f-a22317ac00ce
+
+ +

Get the logs of the specified action.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s STREAM API

+ +

HTTP Request

+ +

GET /api/audit/v1/action/(uuid)/logs/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the action to retrieve logs
+ +

Query Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
tailNumber of lines to show from the end of the logs (default: 300)
followWhether to stream logs or close the connection immediately (default: true)
+ +

Cancel an action

+
POST /api/audit/v1/action/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/cancel/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+action, err := dockercloud.GetAction("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+action, err = action.Cancel()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(action)
+
+ +

Cancels an action in Pending or In progress state.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/audit/v1/action/(uuid)/cancel/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the action to cancel
+ +

Retry an action

+
import dockercloud
+
+def log_handler(message):
+  print message
+
+action = dockercloud.Action.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+action.logs(tail=300, follow=True, log_handler=log_handler)
+
+
POST /api/audit/v1/action/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/retry/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+action, err := dockercloud.GetAction("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+action, err = action.Retry()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(action)
+
+
docker-cloud action logs 7eaf7fff-882c-4f3d-9a8f-a22317ac00ce
+
+ +

Retries an action in Success, Failed or Canceled state.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/audit/v1/action/(uuid)/retry/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the action to retry
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/availabilityzone.html b/apidocs/docker-cloud/includes/availabilityzone.html new file mode 100644 index 0000000000..50dbeb9038 --- /dev/null +++ b/apidocs/docker-cloud/includes/availabilityzone.html @@ -0,0 +1,196 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Availability Zones

+ +

Availability Zone

+ +
+

Example

+
+
{
+    "available": true,
+    "name": "ap-northeast-1a",
+    "region": "/api/infra/v1/region/az/ap-northeast-1/",
+    "resource_uri": "/api/infra/v1/az/aws/ap-northeast-1/ap-northeast-1a/"
+}
+
+ +

An Availability Zone is an isolated location inside a region. Providers that support availability zones: AWS

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
availableWhether the availability zone is currently available for new node deployments
nameAn identifier for the availability zone
regionThe resource URI of the region where the availability zone is allocated
resource_uriA unique API endpoint that represents the zone
+ +

List all availability zones

+
import dockercloud
+
+az = dockercloud.AZ.list()
+
+
GET /api/infra/v1/az/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+az, err := dockercloud.ListAZ()
+if err != nil {
+    log.Println(err)
+}
+
+log.Println(az)
+
+
docker-cloud nodecluster az
+
+ +

Lists all availability zones from all regions of all supported cloud providers. Returns a list of Availability Zone objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/az/

+ +

Query Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
nameFilter by availability zone name
regionFilter by resource URI of the target region
+ +

Get an individual availability zone

+
import dockercloud
+
+az = dockercloud.AZ.fetch("aws/sa-east-1/sa-east-1a")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+az, err := dockercloud.GetAZ("aws/sa-east-1/sa-east-1a")
+if err != nil {
+    log.Println(err)
+}
+
+log.Println(az)
+
+
GET /api/infra/v1/az/aws/sa-east-1/sa-east-1a/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+ +

Get all the details of a specific availability zone

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/az/(provider.name)/(region.name)/(name)/

+ +

Path Parameters

+ + + + + + + + + + + + + + + + + + + +
ParameterDescription
nameThe name of the availability zone to retrieve
providerThe name of the provider
regionThe name of the region
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/container.html b/apidocs/docker-cloud/includes/container.html new file mode 100644 index 0000000000..fc1a525191 --- /dev/null +++ b/apidocs/docker-cloud/includes/container.html @@ -0,0 +1,1183 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Containers

+ +

Container

+ +
+

Example

+
+
{
+    "autodestroy": "OFF",
+    "autorestart": "OFF",
+    "bindings": [
+        {
+            "volume": "/api/infra/v1/volume/1863e34d-6a7d-4945-aefc-8f27a4ab1a9e/",
+            "host_path": null,
+            "container_path": "/data",
+            "rewritable": true
+        },
+        {
+            "volume": null,
+            "host_path": "/etc",
+            "container_path": "/etc",
+            "rewritable": true
+        }
+    ],
+    "cap_add": [
+        "ALL"
+    ],
+    "cap_drop": [
+        "NET_ADMIN",
+        "SYS_ADMIN"
+    ],
+    "container_envvars": [
+        {
+            "key": "DB_1_ENV_DEBIAN_FRONTEND",
+            "value": "noninteractive"
+        },
+        {
+            "key": "DB_1_ENV_MYSQL_PASS",
+            "value": "**Random**"
+        },
+        {
+            "key": "DB_1_ENV_MYSQL_USER",
+            "value": "admin"
+        },
+        {
+            "key": "DB_1_ENV_PATH",
+            "value": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+        },
+        {
+            "key": "DB_1_ENV_REPLICATION_MASTER",
+            "value": "**False**"
+        },
+        {
+            "key": "DB_1_ENV_REPLICATION_PASS",
+            "value": "replica"
+        },
+        {
+            "key": "DB_1_ENV_REPLICATION_SLAVE",
+            "value": "**False**"
+        },
+        {
+            "key": "DB_1_ENV_REPLICATION_USER",
+            "value": "replica"
+        },
+        {
+            "key": "DB_1_PORT",
+            "value": "tcp://172.16.0.3:3306"
+        },
+        {
+            "key": "DB_1_PORT_3306_TCP",
+            "value": "tcp://172.16.0.3:3306"
+        },
+        {
+            "key": "DB_1_PORT_3306_TCP_ADDR",
+            "value": "172.16.0.3"
+        },
+        {
+            "key": "DB_1_PORT_3306_TCP_PORT",
+            "value": "3306"
+        },
+        {
+            "key": "DB_1_PORT_3306_TCP_PROTO",
+            "value": "tcp"
+        },
+        {
+            "key": "DB_ENV_DEBIAN_FRONTEND",
+            "value": "noninteractive"
+        },
+        {
+            "key": "DB_ENV_MYSQL_PASS",
+            "value": "**Random**"
+        },
+        {
+            "key": "DB_ENV_MYSQL_USER",
+            "value": "admin"
+        },
+        {
+            "key": "DB_ENV_PATH",
+            "value": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+        },
+        {
+            "key": "DB_ENV_REPLICATION_MASTER",
+            "value": "**False**"
+        },
+        {
+            "key": "DB_ENV_REPLICATION_PASS",
+            "value": "replica"
+        },
+        {
+            "key": "DB_ENV_REPLICATION_SLAVE",
+            "value": "**False**"
+        },
+        {
+            "key": "DB_ENV_REPLICATION_USER",
+            "value": "replica"
+        },
+        {
+            "key": "DB_PASS",
+            "value": "szVaPz925B7I"
+        },
+        {
+            "key": "DB_PORT",
+            "value": "tcp://172.16.0.3:3306"
+        },
+        {
+            "key": "DB_PORT_3306_TCP",
+            "value": "tcp://172.16.0.3:3306"
+        },
+        {
+            "key": "DB_PORT_3306_TCP_ADDR",
+            "value": "172.16.0.3"
+        },
+        {
+            "key": "DB_PORT_3306_TCP_PORT",
+            "value": "3306"
+        },
+        {
+            "key": "DB_PORT_3306_TCP_PROTO",
+            "value": "tcp"
+        },
+        {
+            "key": "DB_DOCKERCLOUD_API_URL",
+            "value": "https://cloud.docker.com/api/app/v1/service/c0fed1dc-c528-40c9-aa4c-dc00672ebcbf/"
+        }
+    ],
+    "container_ports": [
+        {
+            "endpoint_uri": "http://wordpress-stackable-1.admin.cont.dockerapp.io:49153/",
+            "inner_port": 80,
+            "outer_port": 49153,
+            "port_name": "http",
+            "protocol": "tcp",
+            "published": true,
+            "uri_protocol": "http"
+        }
+    ],
+    "cpu_shares": 100,
+    "cpuset": "0,1",
+    "cgroup_parent": "m-executor-abcd",
+    "deployed_datetime": "Thu, 16 Oct 2014 12:04:08 +0000",
+    "destroyed_datetime": null,
+    "devices": [
+        "/dev/ttyUSB0:/dev/ttyUSB0"
+    ],
+    "dns": [
+        "8.8.8.8"
+    ],
+    "dns_search": [
+        "example.com",
+        "c1dd4e1e-1356-411c-8613-e15146633640.local.dockerapp.io"
+    ],
+    "domainname": "domainname",
+    "entrypoint": "",
+    "exit_code": null,
+    "exit_code_msg": null,
+    "extra_hosts": [
+        "onehost:50.31.209.229"
+    ],
+    "hostname": "hostname",
+    "image_name": "tutum/wordpress-stackable:latest",
+    "labels": {
+        "com.example.description": "Accounting webapp",
+        "com.example.department": "Finance",
+        "com.example.label-with-empty-value": ""
+    },
+    "linked_to_container": [
+        {
+            "endpoints": {
+                "3306/tcp": "tcp://172.16.0.3:3306"
+            },
+            "from_container": "/api/app/v1/container/c1dd4e1e-1356-411c-8613-e15146633640/",
+            "name": "DB_1",
+            "to_container": "/api/app/v1/container/ba434e1e-1234-411c-8613-e15146633640/"
+        }
+    ],
+    "link_variables": {
+        "WORDPRESS_STACKABLE_1_ENV_DB_HOST": "**LinkMe**",
+        "WORDPRESS_STACKABLE_1_ENV_DB_NAME": "wordpress",
+        "WORDPRESS_STACKABLE_1_ENV_DB_PASS": "szVaPz925B7I",
+        "WORDPRESS_STACKABLE_1_ENV_DB_PORT": "**LinkMe**",
+        "WORDPRESS_STACKABLE_1_ENV_DB_USER": "admin",
+        "WORDPRESS_STACKABLE_1_ENV_DEBIAN_FRONTEND": "noninteractive",
+        "WORDPRESS_STACKABLE_1_ENV_HOME": "/",
+        "WORDPRESS_STACKABLE_1_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+        "WORDPRESS_STACKABLE_1_PORT": "tcp://172.16.0.2:80",
+        "WORDPRESS_STACKABLE_1_PORT_80_TCP": "tcp://172.16.0.2:80",
+        "WORDPRESS_STACKABLE_1_PORT_80_TCP_ADDR": "172.16.0.2",
+        "WORDPRESS_STACKABLE_1_PORT_80_TCP_PORT": "80",
+        "WORDPRESS_STACKABLE_1_PORT_80_TCP_PROTO": "tcp",
+        "WORDPRESS_STACKABLE_ENV_DB_HOST": "**LinkMe**",
+        "WORDPRESS_STACKABLE_ENV_DB_NAME": "wordpress",
+        "WORDPRESS_STACKABLE_ENV_DB_PASS": "szVaPz925B7I",
+        "WORDPRESS_STACKABLE_ENV_DB_PORT": "**LinkMe**",
+        "WORDPRESS_STACKABLE_ENV_DB_USER": "admin",
+        "WORDPRESS_STACKABLE_ENV_DEBIAN_FRONTEND": "noninteractive",
+        "WORDPRESS_STACKABLE_ENV_HOME": "/",
+        "WORDPRESS_STACKABLE_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+        "WORDPRESS_STACKABLE_PORT": "tcp://172.16.0.2:80",
+        "WORDPRESS_STACKABLE_PORT_80_TCP": "tcp://172.16.0.2:80",
+        "WORDPRESS_STACKABLE_PORT_80_TCP_ADDR": "172.16.0.2",
+        "WORDPRESS_STACKABLE_PORT_80_TCP_PORT": "80",
+        "WORDPRESS_STACKABLE_PORT_80_TCP_PROTO": "tcp"
+    },
+    "mac_address": "02:42:ac:11:65:43",
+    "memory": 1024,
+    "memory_swap": 4096,
+    "name": "wordpress-stackable",
+    "net": "bridge",
+    "node": "/api/infra/v1/node/9691c44e-3155-4ca2-958d-c9571aac0a14/",
+    "pid": "none",
+    "private_ip": "10.7.0.1",
+    "privileged": false,
+    "public_dns": "wordpress-stackable-1.admin.cont.dockerapp.io",
+    "read_only": true,
+    "resource_uri": "/api/app/v1/container/c1dd4e1e-1356-411c-8613-e15146633640/",
+    "roles": ["global"],
+    "run_command": "/run-wordpress.sh",
+    "security_opt": [
+        "label:user:USER",
+        "label:role:ROLE"
+    ],
+    "service": "/api/app/v1/service/adeebc1b-1b81-4af0-b8f2-cefffc69d7fb/",
+    "started_datetime": "Thu, 16 Oct 2014 12:04:08 +0000",
+    "state": "Running",
+    "stdin_open": false,
+    "stopped_datetime": null,
+    "synchronized": true,
+    "tty": false,
+    "user": "root",
+    "uuid": "c1dd4e1e-1356-411c-8613-e15146633640",
+    "working_dir": "/app"
+}
+
+ +

A container is a representation of a Docker container in a node.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
uuidA unique identifier for the container generated automatically on creation
resource_uriA unique API endpoint that represents the container
image_nameThe Docker image name and tag of the container
bindingsA list of volume bindings that the container has mounted (see table Container Binding attributes below)
nameA user provided name for the container (inherited from the service)
nodeThe resource URI of the node where this container is running
serviceThe resource URI of the service which this container is part of
public_dnsThe external FQDN of the container
stateThe state of the container (see table Container states below)
synchronizedFlag indicating if the container is synchronized with the current service definition.
exit_codeThe numeric exit code of the container (if applicable, null otherwise)
exit_code_msgA string representation of the exit code of the container (if applicable, null otherwise)
deployed_datetimeThe date and time of the last deployment of the container (if applicable, null otherwise)
started_datetimeThe date and time of the last start operation on the container (if applicable, null otherwise)
stopped_datetimeThe date and time of the last stop operation on the container (if applicable, null otherwise)
destroyed_datetimeThe date and time of the terminate operation on the container (if applicable, null otherwise)
container_portsList of published ports of this container (see table Container Port attributes below)
container_envvarsList of user-defined environment variables set on the containers of the service, which will override the container environment variables (see table Container Environment Variable attributes below)
labelsContainer metadata in form of dictionary
working_dirWorking directory for running binaries within a container
userUser used on the container on launch
hostnameHostname used on the container on launch
domainnameDomainname used on the container on launch
mac_addressEthernet device’s MAC address used on the container on launch
cgroup_nameOptional parent cgroup for the container.
ttyIf the container has the tty enable
stdin_openIf the container has stdin opened
dnsContainer custom DNS servers
dns_searchContainer custom DNS search domain
cap_addContainer added capabilities
cap_dropContainer dropped capabilities
devicesList of container device mappings
extra_hostsList of container hostname mappings
secuirty_optLabeling scheme of this container
entrypointEntrypoint used on the container on launch
run_commandRun command used on the container on launch
cpu_sharesThe relative CPU priority of the container (see Runtime Constraints on CPU and Memory for more information)
cpusetCPUs in which execution is allowed
memoryThe memory limit of the container in MB (see Runtime Constraints on CPU and Memory for more information)
memory_swapTotal memory limit (memory + swap) of the container in MB
autorestartWhether to restart the container automatically if it stops (see Crash recovery for more information)
autodestroyWhether to terminate the container automatically if it stops (see Autodestroy for more information)
rolesList of Docker Cloud roles asigned to this container (see API roles for more information))
linked_to_containerList of IP addresses of the linked containers (see table Container Link attributes below and Service links for more information)
link_variablesList of environment variables that would be exposed in any container that is linked to this one
privilegedWhether the container has Docker’s privileged flag set or not (see Runtime privilege for more information)
read_onlyWhether the container filesystem is read-only or not
private_ipIP address of the container on the overlay network. This IP will be reachable from any other container.
netNetwork mode set on the container (see table Network Modes below, more information ../../reference/run/#network-settings)
pidPID (Process) Namespace mode for the container (more information ../../reference/run/#pid-settings-pid)
+ +

Container Binding attributes

+ + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
host_pathThe host path of the volume
container_pathThe container path where the volume is mounted
rewritabletrue is the volume has writable permissions
volumeThe resource URI of the volume
+ +

Container Port attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
protocolThe protocol of the port, either tcp or udp
inner_portThe published port number inside the container
outer_portThe published port number in the node public network interface
port_nameName of the service associated to this port
uri_protocolThe protocol to be used in the endpoint for this port (i.e. http)
endpoint_uriThe URI of the endpoint for this port
publishedWhether the port has been published in the host public network interface or not. Non-published ports can only be accessed via links.
+ +

Container Environment Variable attributes

+ + + + + + + + + + + + + + + +
AttributeDescription
keyThe name of the environment variable
valueThe value of the environment variable
+ +

Container States

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StateDescription
StartingThe container is being deployed or started (from Stopped). No actions allowed in this state.
RunningThe container is deployed and running. Possible actions in this state: stop, terminate.
StoppingThe container is being stopped. No actions allowed in this state.
StoppedThe container is stopped. Possible actions in this state: start, terminate.
TerminatingThe container is being deleted. No actions allowed in this state.
TerminatedThe container has been deleted. No actions allowed in this state.
+ +

Network Modes

+ + + + + + + + + + + + + + + +
StrategyDescription
bridgeCreates a new network stack for the container on the docker bridge.
hostUses the host network stack inside the container.
+ +

Container Last Metric attributes

+ + + + + + + + + + + + + + + + + + + +
AttributeDescription
cpuCPU percentage usage
memoryMemory usage in bytes
diskDisk storage usage in bytes
+ + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
nameThe name given to the link
from_containerThe resource URI of the “client” container
to_containerThe resource URI of the “server” container being linked
endpointsA dictionary with the endpoints (protocol, IP and port) to be used to reach each of the “server” container exposed ports
+ +

List all containers

+
import dockercloud
+
+containers = dockercloud.Container.list()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+containerList, err := dockercloud.ListContainers()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(containerList)
+
+
GET /api/app/v1/container/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud container ps
+
+ +

Lists all current and recently terminated containers. Returns a list of Container objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/app/v1/container/

+ +

Query Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
uuidFilter by UUID
stateFilter by state. Possible values: Starting, Running, Stopping, Stopped, Terminating, Terminated
nameFilter by container name
serviceFilter by resource URI of the target service.
nodeFilter by resource URI of the target node.
+ +

Get an existing container

+
import dockercloud
+
+container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+container, err := dockerckoud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(container)
+
+
GET /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud container inspect 7eaf7fff
+
+ +

Get all the details of an specific container

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/app/v1/container/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the container to retrieve
+ +

Get the logs of a container

+ +
+

Example log line

+
+
{
+    "type": "log",
+    "log": "Log line from the container",
+    "streamType": "stdout",
+    "timestamp": 1433779324
+}
+
+
import dockercloud
+
+def log_handler(message):
+    print message
+
+container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+container.logs(tail=300, follow=True, log_handler=log_handler)
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+container, err := dockercloud.GetContainer("447ecddc-2890-4ea2-849b-99392e0dd7a6")
+
+if err != nil {
+    log.Fatal(err)
+}
+c := make(chan dockercloud.Logs)
+
+go container.Logs(c)
+    for {
+        s := <-c
+        log.Println(s)
+    }
+
+
GET /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/logs/ HTTP/1.1
+Host: ws.cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Connection: Upgrade
+Upgrade: websocket
+
+
docker-cloud container logs 7eaf7fff
+
+ +

Get the logs of the specified container.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s STREAM API

+ +

HTTP Request

+ +

GET /api/app/v1/container/(uuid)/logs/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the container to retrieve logs
+ +

Query Parameters

+ + + + + + + + + + + + + + + + + + + +
ParameterDescription
tailNumber of lines to show from the end of the logs (default: 300)
followWhether to stream logs or close the connection immediately (default: true)
serviceFilter by service (resource URI)
+ +

Start a container

+
import dockercloud
+
+container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+container.start()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+    log.Println(err)
+}
+
+if err = container.Start(); err != nil {
+  log.Println(err)
+}
+
+
POST /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/start/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud container start 7eaf7fff
+
+ +

Starts a stopped container.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/container/(uuid)/start/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the container to start
+ +

Stop a container

+
import dockercloud
+
+container = dockerlcoud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+container.stop()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+    log.Println(err)
+}
+
+if err = container.Stop(); err != nil {
+       log.Println(err)
+   }
+
+
POST /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/stop/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud container stop 7eaf7fff
+
+ +

Stops a running container.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/container/(uuid)/stop/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the container to stop
+ +

Redeploy a container

+
import dockercloud
+
+container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+container.redeploy()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+    log.Println(err)
+}
+//Redeploy(dockercloud.ReuseVolumesOption{Reuse: true) to reuse the existing volumes
+//Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}) to not reuse the existing volumes
+if err = container.Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}); err != nil {
+  log.Println(err)
+}
+
+
POST /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/start/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud container redeploy 7eaf7fff
+
+ +

Redeploys a container.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/container/(uuid)/redeploy/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the container to redeploy
+ +

Query Parameters

+ + + + + + + + + + + +
ParameterDescription
reuse_volumesWheather to reuse container volumes for this redeploy operation or not (default: true).
+ +

Terminate a container

+
import dockercloud
+
+container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+container.delete()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+    log.Println(err)
+}
+
+if err = container.Terminate(); err != nil {
+       log.Println(err)
+   }
+
+
DELETE /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud container terminate 7eaf7fff
+
+ +

Terminates the specified container. This is not reversible. All data stored in the container will be permanently deleted.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

DELETE /api/app/v1/container/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the container to terminate
+ +

Execute command inside a container

+
import dockercloud
+
+def msg_handler(message):
+    print message
+
+container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+container.execute("ls", handler=msg_handler)
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+c := make(chan dockercloud.Exec)
+
+container.Exec("ls", c)
+
+
+
GET /api/app/v1/container/(uuid)/exec/ HTTP/1.1
+Host: ws.cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Connection: Upgrade
+Upgrade: websocket
+
+
docker-cloud exec 7eaf7fff ls
+
+ +

Executes a command inside the specified running container, creating a bi-directional stream for the process’ standard input and output. This endpoint can be connected to using a bi-directional Secure Web Socket wss://ws.cloud.docker.com/api/app/v1/container/(uuid)/exec/

+ +

Endpoint Type

+ +

Available in Docker Cloud’s STREAM API

+ +

HTTP Request

+ +

GET /api/app/v1/container/(uuid)/exec/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the container where the command will be executed
+ +

Query Parameters

+ + + + + + + + + + + +
ParameterDescription
commandCommand to be executed (default: sh)
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/dockercloud-events.html b/apidocs/docker-cloud/includes/dockercloud-events.html new file mode 100644 index 0000000000..18de3d3ad5 --- /dev/null +++ b/apidocs/docker-cloud/includes/dockercloud-events.html @@ -0,0 +1,237 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Docker Cloud Events

+ +

Docker Cloud Event

+ +
+

Example

+
+
{
+    "type": "action",
+    "action": "update",
+    "parents": [
+        "/api/app/v1/container/0b0e3538-88df-4f07-9aed-3a3cc4175076/"
+    ],
+    "resource_uri": "/api/app/v1/action/49f0efe8-a704-4a10-b02f-f96344fabadd/",
+    "state": "Success",
+    "uuid": "093ba3bb-08dd-48f0-8f12-4d3b85ef85b3",
+    "datetime": "2016-02-01T16:47:28Z"
+}
+
+ +

Docker Cloud events are generated every time any of the following objects is created or changes state:

+ +
    +
  • Stack
  • +
  • Service
  • +
  • Container
  • +
  • Node Cluster
  • +
  • Node
  • +
  • Action
  • +
+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
typeType of object that was created or updated. For possible values, check the events types table below.
actionType of action that was executed on the object. Posible values: create, update or delete
parentsList of resource URIs (REST API) of the parents of the object, according to the “Parent-child hierarchy” table below
resource_uriResource URI (REST API) of the object that was created or updated. You can do a GET operation on this URL to fetch its details
stateThe current state of the object
uuidUnique identifier for the event
datetimeDate and time of the event in ISO 8601 format
+ +

Event types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescription
stackWhenever a Stack is created or updated
serviceWhenever a Service is created or updated
containerWhenever a Container is created or updated
nodeclusterWhenever a Node Cluster is created or updated
nodeWhenever a Node is created or updated
actionWhenever a Action is created or updated
errorSent when an error occurs on the websocket connection or as part of the authentication process
+ +

Parent-child hierarchy

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Object typeParent types
Stack(None)
ServiceStack
ContainerService, Stack, Node, Node Cluster
Node Cluster(None)
NodeNode Cluster
Action(object to which the action applies to)
+ +

Listen to new Docker Cloud Events

+
import dockercloud
+
+def process_event(event):
+    print event
+
+events = dockercloud.Events()
+events.on_message(process_event)
+events.run_forever()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+c := make(chan dockercloud.Event)
+e := make(chan error)
+
+go dockercloud.Events(c, e)
+
+for {
+    select {
+        case event := <-c:
+            log.Println(event)
+        case err := <-e:
+            log.Println(err)
+    }
+}
+
+
GET /api/audit/v1/events/ HTTP/1.1
+Host: ws.cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Connection: Upgrade
+Upgrade: websocket
+
+
docker-cloud event
+
+ +

Listens for new Docker Cloud Events

+ +

Endpoint Type

+ +

Available in Docker Cloud’s STREAM API

+ +

HTTP Request

+ +

GET /api/audit/v1/events/

+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/node.html b/apidocs/docker-cloud/includes/node.html new file mode 100644 index 0000000000..97c00fa348 --- /dev/null +++ b/apidocs/docker-cloud/includes/node.html @@ -0,0 +1,560 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Nodes

+ +

Node

+ +
+

Example

+
+
{
+    "availability_zone": "/api/infra/v1/az/testing-provider/testing-region/testing-az/",
+    "cpu": 1,
+    "current_num_containers": 4,
+    "deployed_datetime": "Tue, 16 Sep 2014 17:01:15 +0000",
+    "destroyed_datetime": null,
+    "disk": 60,
+    "docker_execdriver": "native-0.2",
+    "docker_graphdriver": "aufs",
+    "docker_version": "1.5.0",
+    "external_fqdn": "fc1a5bb9-user.node.dockerapp.io",
+    "last_seen": "Thu, 25 Sep 2014 13:14:44 +0000",
+    "memory": 1792,
+    "nickname": "fc1a5bb9-user.node.dockerapp.io",
+    "node_cluster": "/api/infra/v1/nodecluster/d787a4b7-d525-4061-97a0-f423e8f1d229/",
+    "node_type": "/api/infra/v1/nodetype/testing-provider/testing-type/",
+    "public_ip": "10.45.2.11",
+    "region": "/api/infra/v1/region/testing-provider/testing-region/",
+    "resource_uri": "/api/infra/v1/node/fc1a5bb9-17f5-4819-b667-8c7cd819e949/",
+    "state": "Deployed",
+    "tags": [
+        {"name": "tag_one"},
+        {"name": "tag-two"}
+    ],
+    "tunnel": "https://tunnel01.cloud.docker.com:12345",
+    "uuid": "fc1a5bb9-17f5-4819-b667-8c7cd819e949"
+}
+
+ +

A node is a virtual machine provided by a cloud provider where containers can be deployed.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
availability_zoneThe resource URI of the availability zone where the node is deployed, if any
uuidA unique identifier for the node generated automatically on creation
resource_uriA unique API endpoint that represents the node
external_fqdnAn automatically generated FQDN for the node. Containers deployed on this node will inherit this FQDN.
stateThe state of the node. See the below table for a list of possible states.
node_clusterThe resource URI of the node cluster to which this node belongs to (if applicable)
node_typeThe resource URI of the node type used for the node
regionThe resource URI of the region where the node is deployed
docker_execdriverDocker’s execution driver used in the node
docker_graphdriverDocker’s storage driver used in the node
docker_versionDocker’s version used in the node
cpuNode number of CPUs
diskNode storage size in GB
memoryNode memory in MB
current_num_containersThe actual number of containers deployed in this node
last_seenDate and time of the last time the node was contacted by Docker Cloud
public_ipThe public IP allocated to the node
tunnelIf the node does not accept incoming connections to port 2375, the address of the reverse tunnel to access the docker daemon, or null otherwise
deployed_datetimeThe date and time when this node cluster was deployed
destroyed_datetimeThe date and time when this node cluster was terminated (if applicable)
tagsList of tags to identify the node when deploying services (see Tags for more information)
nicknameA user-friendly name for the node (external_fqdn by default)
+ +

Node states

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StateDescription
DeployingThe node is being deployed in the cloud provider. No actions allowed in this state.
DeployedThe node is deployed and provisioned and is ready to deploy containers. Possible actions in this state: terminate, docker-upgrade.
UnreachableThe node is deployed but Docker Cloud cannot connect to the docker daemon. Possible actions in this state: health-check and terminate.
UpgradingThe node docker daemon is being upgraded. No actions allowed in this state.
TerminatingThe node is being terminated in the cloud provider. No actions allowed in this state.
TerminatedThe node has been terminated and is no longer present in the cloud provider. No actions allowed in this state.
+ +

Node Last Metric attributes

+ + + + + + + + + + + + + + + + + + + +
AttributeDescription
cpuCPU percentage usage
memoryMemory usage in bytes
diskDisk storage usage in bytes
+ +

List all nodes

+
import dockercloud
+
+nodes = dockercloud.Node.list()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+nodeList, err := dockercloud.ListNodes()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(nodeList)
+
+
GET /api/infra/v1/node/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud node ls
+
+ +

Lists all current and recently terminated nodes. Returns a list of Node objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/node/

+ +

Query Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
uuidFilter by UUID
stateFilter by state. Possible values: Deploying, Deployed, Unreachable, Upgrading, Terminating, Terminated
node_clusterFilter by resource URI of the target node cluster
node_typeFilter by resource URI of the target node type
regionFilter by resource URI of the target region
docker_versionFilter by Docker engine version running in the nodes
+ +

Get an existing node

+
import dockercloud
+
+node = dockercloud.Node.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+node, err := dockercloud.GetNode("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(node)
+
+
GET /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud node inspect 7eaf7fff
+
+ +

Get all the details of an specific node

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/node/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the node to retrieve
+ +

Update a node

+
import dockercloud
+
+node = dockercloud.Node.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+node.tags.add(["tag-1"])
+node.save()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+node, err := dockercloud.GetNode("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+    log.Println(err)
+}
+
+if err = node.Update(dockercloud.Node{Tags: []string{ {Name: "tag-1"}}}); err != nil {
+            log.Println(err)
+}
+
+
PATCH /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+{"tags": [{"name": "tag-1"}], "nickname": "dev node"}
+
+
docker-cloud tag add -t tag-1 7eaf7fff
+docker-cloud tag set -t tag-2 7eaf7fff
+
+ +

Names the node with a user-friendly name and/or replaces the old tags for the new list provided.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

PATCH /api/infra/v1/node/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the node to retrieve
+ +

JSON Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
nickname(optional) A user-friendly name for the node (external_fqdn by default)
tags(optional) List of tags the node will have. This operation replaces the user tag list.
+ +

Upgrade Docker Daemon

+
import dockercloud
+
+node = dockercloud.Node.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+node.upgrade_docker()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+node, err := dockercloud.GetNode("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = node.Upgrade(); err != nil {
+       log.Println(err)
+   }
+
+
POST /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/docker-upgrade/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud node upgrade 7eaf7fff
+
+ +

Upgrades the docker daemon of the node. This will restart your containers on that node. See Docker upgrade for more information.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/infra/v1/node/(uuid)/docker-upgrade/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the node to upgrade
+ +

Perform a health check of a node

+
POST /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/health-check/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+ +

Tests connectivity between Docker Cloud and the node. Updates the node status to Deployed if the check was successful, or to Unreachable otherwise.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/infra/v1/node/(uuid)/health-check/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the node to perform the health check to
+ +

Terminate a node

+
import dockercloud
+
+node = dockercloud.Node.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+node.delete()
+
+
DELETE /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+node, err := dockercloud.GetNode("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = node.Terminate(); err != nil {
+   log.Println(err)
+}
+
+
docker-cloud node rm 7eaf7fff
+
+ +

Terminates the specified node.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

DELETE /api/infra/v1/node/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the node to terminate
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/nodecluster.html b/apidocs/docker-cloud/includes/nodecluster.html new file mode 100644 index 0000000000..0b1089efa5 --- /dev/null +++ b/apidocs/docker-cloud/includes/nodecluster.html @@ -0,0 +1,589 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Node Clusters

+ +

Node Cluster

+ +
+

Example

+
+
{
+    "current_num_nodes": 1,
+    "deployed_datetime": "Tue, 16 Sep 2014 17:01:15 +0000",
+    "destroyed_datetime": null,
+    "disk": 60,
+    "nickname": "my test cluster",
+    "name": "TestCluster",
+    "node_type": "/api/infra/v1/nodetype/aws/t2.micro/",
+    "nodes": [
+        "/api/infra/v1/node/75d20367-0948-4f10-8ba4-ffb4d16ed3c6/"
+    ],
+    "region": "/api/infra/v1/region/aws/us-east-1/",
+    "resource_uri": "/api/infra/v1/nodecluster/5516df0b-721e-4470-b350-741ff22e63a0/",
+    "state": "Deployed",
+    "tags": [
+        {"name": "tag_one"},
+        {"name": "tag-two"},
+        {"name": "tagthree3"}
+    ],
+    "target_num_nodes": 2,
+    "uuid": "5516df0b-721e-4470-b350-741ff22e63a0",
+    "provider_options": {
+        "vpc": {
+            "id": "vpc-aa1c70d4",
+            "subnets": ["subnet-aaa7d94f", "subnet-aa15fa64"],
+            "security_groups": ["sg-aa1c70d4"]
+        },
+        "iam": {
+            "instance_profile_name": "my_instance_profile"
+        }
+    }
+}
+
+ +

A node cluster is a group of nodes that share the same provider, region and/or availability zone, and node type. They are on the same private network.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
uuidA unique identifier for the node cluster generated automatically on creation
resource_uriA unique API endpoint that represents the node cluster
nameA user provided name for the node cluster
stateThe state of the node cluster. See the below table for a list of possible states.
node_typeThe resource URI of the node type used for the node cluster
diskThe size of the disk where images and containers are stored (in GB)
nodesA list of resource URIs of the Node objects on the node cluster
regionThe resource URI of the Region object where the node cluster is deployed
target_num_nodesThe desired number of nodes for the node cluster
current_num_nodesThe actual number of nodes in the node cluster. This may differ from target_num_nodes if the node cluster is being deployed or scaled
deployed_datetimeThe date and time when this node cluster was deployed
destroyed_datetimeThe date and time when this node cluster was terminated (if applicable)
tagsList of tags to identify the node cluster nodes when deploying services (see Tags for more information)
provider_optionsProvider-specific extra options for the deployment of the node (see Provider options table below for more information)
nicknameA user-friendly name for the node cluster (name by default)
+ +

Node Cluster states

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StateDescription
InitThe node cluster has been created and has no deployed containers yet. Possible actions in this state: deploy, terminate.
DeployingAll nodes in the cluster are either deployed or being deployed. No actions allowed in this state.
DeployedAll nodes in the cluster are deployed and provisioned. Possible actions in this state: terminate.
Partly deployedOne or more nodes of the cluster are deployed and running. Possible actions in this state: terminate.
ScalingThe cluster is either deploying new nodes or terminating existing ones responding to a scaling request. No actions allowed in this state.
TerminatingAll nodes in the cluster are either being terminated or already terminated. No actions allowed in this state.
TerminatedThe node cluster and all its nodes have been terminated. No actions allowed in this state.
Empty clusterThere are no nodes deployed in this cluster. Possible actions in this state: terminate.
+ +

Provider options

+ +

You can specify the following options when using the Amazon Web Services provider:

+ +
    +
  • vpc: VPC-related options (optional) + +
      +
    • id: AWS VPC identifier of the target VPC where the nodes of the cluster will be deployed (required)
    • +
    • subnets: a list of target subnet indentifiers inside selected VPC. If you specify more than one subnet, Docker Cloud will balance among all of them following a high-availability schema (optional)
    • +
    • security_groups: the security group that will be applied to every node of the cluster (optional)
    • +
  • +
  • iam: IAM-related options (optional) + +
      +
    • instance_profile_name: name of the instance profile (container for instance an IAM role) to attach to every node of the cluster (required)
    • +
  • +
+ +

List all node clusters

+
import dockercloud
+
+nodeclusters = dockercloud.NodeCluster.list()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+nodeclusters, err := dockercloud.ListNodeClusters()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(nodeclusters)
+
+
GET /api/infra/v1/nodecluster/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud nodecluster ls
+
+ +

Lists all current and recently terminated node clusters. Returns a list of NodeCluster objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/nodecluster/

+ +

Query Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
uuidFilter by UUID
stateFilter by state. Possible values: Init, Deploying, Deployed, Partly deployed, Scaling, Terminating, Terminated, Empty cluster
nameFilter by node cluster name
regionFilter by resource URI of the target region
node_typeFilter by resource URI of the target node type
+ +

Create a new node cluster

+
import dockercloud
+
+region = dockercloud.Region.fetch("digitalocean/lon1")
+node_type = dockercloud.NodeType.fetch("digitalocean/1gb")
+nodecluster = dockercloud.NodeCluster.create(name="my_cluster", node_type=node_type, region=region, disk=60)
+nodecluster.save()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+nodecluster, err := dockercloud.CreateNodeCluster(dockercloud.NodeCreateRequest{Name: "my_cluster", Region: "/api/infra/v1/region/digitalocean/lon1/", NodeType: "/api/infra/v1/nodetype/digitalocean/1gb/", Target_num_nodes: 2})
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(nodecluster)
+
+
POST /api/infra/v1/nodecluster/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+Content-Type: application/json
+
+{"name": "my_cluster", "region": "/api/infra/v1/region/digitalocean/lon1/", "node_type": "/api/infra/v1/nodetype/digitalocean/1gb/", "disk": 60}
+
+
docker-cloud nodecluster create my_cluster digitalocean lon1 1gb
+
+ +

Creates a new node cluster without deploying it.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/infra/v1/nodecluster/

+ +

JSON Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
name(required) A user provided name for the node cluster
node_type(required) The resource URI of the node type to be used for the node cluster
region(required) The resource URI of the region where the node cluster is to be deployed
disk(optional) The size of the volume to create where images and containers will be stored, in GB (default: 60). Not available for Digital Ocean. To create Softlayer nodes you must select one of the following sizes (in GBs): 10, 20, 25, 30, 40, 50, 75, 100, 125, 150, 175, 200, 250, 300, 350, 400, 500, 750, 1000, 1500 or 2000
nickname(optional) A user-friendly name for the node cluster (name by default)
target_num_nodes(optional) The desired number of nodes for the node cluster (default: 1)
tags(optional) List of tags of the node cluster to be used when deploying services see Tags for more information) (default: [])
provider_optionsProvider-specific extra options for the deployment of the node (see table Provider options above for more information)
+ +

Get an existing node cluster

+
import dockercloud
+
+service = dockercloud.NodeCluster.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+nodecluster, err := dockercloud.GetNodeCluster("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(nodecluster)
+
+
GET /api/infra/v1/nodecluster/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud nodecluster inspect 7eaf7fff
+
+ +

Get all the details of an specific node cluster

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/nodecluster/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the node cluster to retrieve
+ +

Deploy a node cluster

+
import dockercloud
+
+nodecluster = dockercloud.NodeCluster.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+nodecluster.deploy()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+nodecluster, err := dockercloud.GetNodeCluster("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = nodecluster.Deploy(); err != nil {
+   log.Println(err)
+}
+
+
POST /api/infra/v1/nodecluster/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/deploy/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+ +

Deploys and provisions a recently created node cluster in the specified region and cloud provider.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/infra/v1/nodecluster/(uuid)/deploy/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the node cluster to deploy
+ +

Update an existing node cluster

+
import dockercloud
+
+nodecluster = dockercloud.NodeCluster.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+nodecluster.target_num_nodes = 3
+nodecluster.tags.add("tag-1")
+nodecluster.save()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+nodecluster, err := dockercloud.GetNodeCluster("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = nodecluster.Update(dockercloud.NodeCreateRequest{Target_num_nodes: 4}); err != nil {
+   log.Println(err)
+}
+
+
PATCH /api/infra/v1/nodecluster/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+Content-Type: application/json
+
+{"target_num_nodes": 3, "tags": [{"name": "tag-1"}]}
+
+
docker-cloud nodecluster scale 7eaf7fff 3
+docker-cloud tag add -t tag-1 7eaf7fff
+docker-cloud tag set -t tag-2 7eaf7fff
+
+ +

Updates the node cluster details and applies the changes automatically.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

PATCH /api/infra/v1/nodecluster/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the node cluster to update
+ +

JSON Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
target_num_nodes(optional) The number of nodes to scale this node cluster to
tags(optional) List of tags the node cluster (and nodes within the node cluster) will have. This operation replaces the user tag list.
+ +

Terminate a node cluster

+
import dockercloud
+
+nodecluster = dockercloud.NodeCluster.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+nodecluster.delete()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+nodecluster, err := dockercloud.GetNodeCluster("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = nodecluster.Terminate(); err != nil {
+   log.Println(err)
+}
+
+
DELETE /api/infra/v1/nodecluster/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
dockercloud nodecluster rm 7eaf7fff
+
+ +

Terminates all the nodes in a node cluster and the node cluster itself. This is not reversible.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

DELETE /api/infra/v1/nodecluster/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the node cluster to terminate
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/nodetype.html b/apidocs/docker-cloud/includes/nodetype.html new file mode 100644 index 0000000000..1707bc8c21 --- /dev/null +++ b/apidocs/docker-cloud/includes/nodetype.html @@ -0,0 +1,222 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Node Types

+ +

Node Type

+ +
+

Example

+
+
{
+    "availability_zones": [],
+    "available": true,
+    "label": "1GB",
+    "name": "1gb",
+    "provider": "/api/infra/v1/provider/digitalocean/",
+    "regions": [
+        "/api/infra/v1/region/digitalocean/ams1/",
+        "/api/infra/v1/region/digitalocean/sfo1/",
+        "/api/infra/v1/region/digitalocean/nyc2/",
+        "/api/infra/v1/region/digitalocean/ams2/",
+        "/api/infra/v1/region/digitalocean/sgp1/",
+        "/api/infra/v1/region/digitalocean/lon1/",
+        "/api/infra/v1/region/digitalocean/nyc3/",
+        "/api/infra/v1/region/digitalocean/nyc1/"
+    ],
+    "resource_uri": "/api/infra/v1/nodetype/digitalocean/1gb/"
+}
+
+ +

A node type is a representation of an instance size supported by a certain cloud provider in a certain region and/or availability zone.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
resource_uriA unique API endpoint that represents the node type
nameAn identifier for the node type
labelA user-friendly name for the node type
regionsA list of resource URIs of the regions to which this node type can be deployed to
availability_zonesA list of resource URIs of the availability zones to which this node type can be deployed to
providerThe resource URI of the provider of the node type
availableWhether the node type is currently available for new node deployments
+ +

List all node types

+
import dockercloud
+
+nodetypes = dockercloud.NodeType.list()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+nodetypeList, err := dockercloud.ListNodeTypes()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(nodetypeList)
+
+
GET /api/infra/v1/nodetype/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud nodecluster nodetype
+
+ +

Lists all node types of all supported cloud providers. Returns a list of NodeType objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/nodetype/

+ +

Query Parameters

+ + + + + + + + + + + + + + + + + + + +
ParameterDescription
nameFilter by node type name
regionsFilter by resource URI of the target regions
availability_zonesFilter by resource URI of the target availability zones
+ +

Get an individual node type

+
import dockercloud
+
+nodetype = dockercloud.NodeType.fetch("digitalocean/1gb")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+nodetype, err := dockercloud.GetNodeType("digitalocean","1gb")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(nodetype)
+
+
GET /api/infra/v1/nodetype/digitalocean/1gb/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+ +

Get all the details of a specific node type

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/nodetype/(provider.name)/(name)/

+ +

Path Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
nameThe name of the node type to retrieve
provider.nameThe name of the provider of the node type
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/provider.html b/apidocs/docker-cloud/includes/provider.html new file mode 100644 index 0000000000..391f43a01f --- /dev/null +++ b/apidocs/docker-cloud/includes/provider.html @@ -0,0 +1,201 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Providers

+ +

Provider

+ +
+

Example

+
+
{
+    "available": true,
+    "label": "Digital Ocean",
+    "name": "digitalocean",
+    "regions": [
+        "/api/infra/v1/region/digitalocean/ams1/",
+        "/api/infra/v1/region/digitalocean/ams2/",
+        "/api/infra/v1/region/digitalocean/ams3/",
+        "/api/infra/v1/region/digitalocean/lon1/",
+        "/api/infra/v1/region/digitalocean/nyc1/",
+        "/api/infra/v1/region/digitalocean/nyc2/",
+        "/api/infra/v1/region/digitalocean/nyc3/",
+        "/api/infra/v1/region/digitalocean/sfo1/",
+        "/api/infra/v1/region/digitalocean/sgp1/"
+    ],
+    "resource_uri": "/api/infra/v1/provider/digitalocean/"
+}
+
+ +

A provider is a representation of a cloud provider supported by Docker Cloud. Providers have one or more regions where nodes are deployed.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
resource_uriA unique API endpoint that represents the provider
nameA unique identifier for the provider
labelA user-friendly name for the provider
regionsA list of resource URIs of the regions available in this provider
availableWhether the provider is currently available for new node deployments
+ +

List all providers

+
import dockercloud
+
+providers = dockercloud.Provider.list()
+
+
GET /api/infra/v1/provider/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+providerList, err := dockercloud.ListProviders()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(providerList)
+
+
docker-cloud nodecluster provider
+
+ +

Lists all supported cloud providers. Returns a list of Provider objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/provider/

+ +

Query Parameters

+ + + + + + + + + + + +
ParameterDescription
nameFilter by provider name
+ +

Get an individual provider

+
import dockercloud
+
+provider = dockercloud.Provider.fetch("digitalocean")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+provider, err := dockercloud.GetProvider("digitalocean")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(provider)
+
+
GET /api/infra/v1/provider/digitalocean/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+ +

Get all the details of a specific provider

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/provider/(name)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
nameThe name of the provider to retrieve
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/region.html b/apidocs/docker-cloud/includes/region.html new file mode 100644 index 0000000000..fa42f26285 --- /dev/null +++ b/apidocs/docker-cloud/includes/region.html @@ -0,0 +1,218 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Regions

+ +

Region

+ +
+

Example

+
+
{
+    "availability_zones": [],
+    "available": true,
+    "label": "Amsterdam 2",
+    "name": "ams2",
+    "node_types": [
+        "/api/infra/v1/nodetype/digitalocean/1gb/",
+        "/api/infra/v1/nodetype/digitalocean/2gb/",
+        "/api/infra/v1/nodetype/digitalocean/4gb/",
+        "/api/infra/v1/nodetype/digitalocean/8gb/",
+        "/api/infra/v1/nodetype/digitalocean/16gb/",
+        "/api/infra/v1/nodetype/digitalocean/32gb/",
+        "/api/infra/v1/nodetype/digitalocean/48gb/",
+        "/api/infra/v1/nodetype/digitalocean/64gb/"
+    ],
+    "provider": "/api/infra/v1/provider/digitalocean/",
+    "resource_uri": "/api/infra/v1/region/digitalocean/ams2/"
+}
+
+ +

A region is a representation of an entire or a subset of a data center of a cloud provider. It can contain availability zones (depending on the provider) and one or more node types.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
resource_uriA unique API endpoint that represents the region
nameAn identifier for the region
labelA user-friendly name for the region
node_typesA list of resource URIs of the node types available in the region
availability_zonesA list of resource URIs of the availability zones available in the region
providerThe resource URI of the provider of the region
availableWhether the region is currently available for new node deployments
+ +

List all regions

+
import dockercloud
+
+regions = dockercloud.Region.list()
+
+
GET /api/infra/v1/region/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+regionList, err := dockercloud.ListRegions()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(regionList)
+
+
docker-cloud nodecluster region
+
+ +

Lists all regions of all supported cloud providers. Returns a list of Region objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/region/

+ +

Query Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
nameFilter by region name
providerFilter by resource URI of the target provider
+ +

Get an individual region

+
import dockercloud
+
+region = dockercloud.Region.fetch("digitalocean/lon1")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+region, err := dockercloud.GetRegion("digitalocean","lon1")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(region)
+
+
GET /api/infra/v1/region/digitalocean/lon1/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+ +

Get all the details of a specific region

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/region/(provider.name)/(name)/

+ +

Path Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
nameThe name of the region to retrieve
provider.nameThe name of the provider of the region
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/registry.html b/apidocs/docker-cloud/includes/registry.html new file mode 100644 index 0000000000..93e49d2216 --- /dev/null +++ b/apidocs/docker-cloud/includes/registry.html @@ -0,0 +1,178 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Registries

+ +

Registry

+ +
+

Example

+
+
{
+  "host": "registry-1.docker.io",
+  "is_docker_registry": true,
+  "is_ssl": true,
+  "name": "Docker Hub",
+  "port": 443,
+  "resource_uri": "/api/repo/v1/registry/registry-1.docker.io/",
+}
+
+ +

Represents a registry where repositories are hosted.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
resource_uriA unique API endpoint that represents the registry
nameHuman-readable name of the registry
hostFQDN of the registry, i.e. registry-1.docker.io
is_docker_registryWhether this registry is run by Docker
is_sslWhether this registry has SSL activated or not
portThe port number where the registry is listening to
+ +

List all registries

+
GET /api/repo/v1/registry/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+ +

Lists all current registries. Returns a list of Registry objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/repo/v1/registry/

+ +

Query Parameters

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
uuidFilter by UUID
nameFilter by registry name
hostFilter by registry host
is_docker_registryFilter by whether the registry is run by Docker or not. Possible values: ‘true’ or 'false’
+ +

Get an existing registry

+
GET /api/repo/v1/registry/registry-1.docker.io/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+ +

Gets all the details of an specific registry

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/v1/registry/(host)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
hostThe host of the registry to retrieve
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/repository.html b/apidocs/docker-cloud/includes/repository.html new file mode 100644 index 0000000000..8897ac6839 --- /dev/null +++ b/apidocs/docker-cloud/includes/repository.html @@ -0,0 +1,358 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

External Repositories

+ +

External Repository

+ +
+

Example

+
+
{
+  "in_use": false, 
+  "name": "quay.io/tutum/ubuntu", 
+  "registry": "/api/repo/v1/registry/quay.io/", 
+  "resource_uri": "/api/repo/v1/repository/quay.io/tutum/ubuntu/", 
+}
+
+ +

The repository endpoint is used to add and remove existing repositories on third party registries to be used in deployments and builds.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
resource_uriA unique API endpoint that represents the repository
nameName of the repository, i.e. quay.io/tutum/ubuntu
in_useIf the image is being used by any of your services
registryResource URI of the registry where this image is hosted
+ +

List all external repositories

+
import dockercloud
+
+repositories = dockercloud.Repository.list()
+
+
GET /api/repo/v1/repository/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+repositoriesList, err := dockercloud.ListRepositories()
+
+if err != nil {
+    log.Println(err)
+}
+
+log.Pringln(repositoriesList)
+
+
docker-cloud repository ls
+
+ +

Lists all added repositories from third party registries. Returns a list of Repository objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/repo/v1/repository/

+ +

Query Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
nameFilter by image name
registryFilter by resource URI of the target repository registry
+ +

Add a new external repository

+
import dockercloud
+
+repository = dockercloud.Repository.create(name="registry.local/user1/image1", username=username, password=password)
+repository.save()
+
+
POST /api/repo/v1/repository/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+Content-Type: application/json
+
+{"name": "registry.local/user1/image1", "username": "username", "password": "password"}
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+image, err := dockercloud.CreateImage(dockercloud.ImageCreateRequest{
+  Name: "registry.local/user1/image1",
+  Username: "username",
+  Password: "password"
+})
+
+
docker-cloud repository register -u username -p password registry.local/user1/image1
+
+ +

Adds an existing repository on a third party registry.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/repo/v1/repository/

+ +

JSON Parameters

+ + + + + + + + + + + + + + + + + + + +
ParameterDescription
nameName of the repository, i.e. ‘quay.io/tutum/hello-world’
usernameUsername to authenticate with the third party registry
passwordPassword to authenticate with the third party registry
+ +

Get an external repository details

+
import dockercloud
+
+repository = dockercloud.Repository.fetch("registry.local/user1/image1")
+
+
GET /api/repo/v1/repository/registry.local/user1/image1/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+repository, err = dockercloud.GetRepository("registry.local/user1/image1")
+
+if err != nil {
+    log.Println(err)
+}
+
+log.Println(repository)
+
+
docker-cloud repository inspect registry.local/user1/image1
+
+ +

Gets all the details of an specific repository

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/repo/v1/repository/(name)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
nameThe name of the repository to retrieve
+ +

Update credentials of an external repository

+
import dockercloud
+
+repository = dockercloud.Repository.fetch("registry.local/user1/image1")
+repository.username = "new username"
+repository.password = "new password"
+repository.save()
+
+
PATCH /api/repo/v1/repository/registry.local/user1/image1/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+Content-Type: application/json
+
+{"username": "username", "password": "password"}
+
+
docker-cloud repository update -n "new username" -p "new password" registry.local/user1/image1
+
+ +

Updates the external repository credentials.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

PATCH /api/repo/v1/repository/(name)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
nameThe name of the repository to update
+ +

JSON Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
usernameUsername to authenticate with the private registry
passwordPassword to authenticate with the private registry
+ +

Remove an external repository

+
import dockercloud
+
+repository = dockercloud.Repository.fetch("registry.local/user1/image1")
+repository.delete()
+
+
DELETE /api/repo/v1/repository/registry.local/user1/image1/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+repository, err = dockercloud.GetRepository("registry.local/user1/image1")
+
+if err != nil {
+    log.Println(err)
+}
+
+repository.Remove()
+
+
docker-cloud repository rm registry.local/user1/image1
+
+ +

Removes the external repository from Docker Cloud. It won’t remove the repository from the third party registry where it’s stored.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

DELETE /api/repo/v1/repository/registry.local/user1/image1/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
nameThe name of the external repository to remove
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/service.html b/apidocs/docker-cloud/includes/service.html new file mode 100644 index 0000000000..26a66e7c00 --- /dev/null +++ b/apidocs/docker-cloud/includes/service.html @@ -0,0 +1,1479 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Services

+ +

Service

+ +
+

Example

+
+
{
+  "autodestroy": "OFF",
+  "autoredeploy": false,
+  "autorestart": "ON_FAILURE",
+  "bindings": [
+    {
+        "host_path": null,
+        "container_path": "/tmp",
+        "rewritable": true,
+        "volumes_from": null
+    },
+    {
+        "host_path": "/etc",
+        "container_path": "/etc",
+        "rewritable": true,
+        "volumes_from": null
+    },
+    {
+        "host_path": null,
+        "container_path": null,
+        "rewritable": true,
+        "volumes_from": "/api/app/v1/service/2f4f54e5-9d3b-4ac1-85ad-a2d4ff25a179/"
+    }
+  ],
+  "cap_add": [
+    "ALL"
+  ],
+  "cap_drop": [
+    "NET_ADMIN",
+    "SYS_ADMIN"
+  ],
+  "container_envvars": [
+    {
+      "key": "DB_PASS",
+      "value": "test"
+    }
+  ],
+  "container_ports": [
+    {
+      "endpoint_uri": "http://wordpress-stackable.admin.srv.dockerapp.io:80/",
+      "inner_port": 80,
+      "outer_port": 80,
+      "port_name": "http",
+      "protocol": "tcp",
+      "published": true
+    }
+  ],
+  "containers": [
+    "/api/app/v1/container/6f8ee454-9dc3-4387-80c3-57aac1be3cc6/",
+    "/api/app/v1/container/fdf9c116-7c08-4a60-b0ce-c54ca72c2f25/"
+  ],
+  "cpu_shares": 100,
+  "cpuset": "0,1",
+  "cgroup_parent": "m-executor-abcd",
+  "current_num_containers": 2,
+  "deployed_datetime": "Mon, 13 Oct 2014 11:01:43 +0000",
+  "deployment_strategy": "EMPTIEST_NODE",
+  "destroyed_datetime": null,
+  "devices": [
+    "/dev/ttyUSB0:/dev/ttyUSB0"
+  ],
+  "dns": [
+    "8.8.8.8"
+  ],
+  "dns_search": [
+    "example.com"
+  ],
+  "domainname": "domainname",
+  "entrypoint": "",
+  "extra_hosts": [
+    "onehost:50.31.209.229"
+  ],
+  "hostname": "hostname",
+  "image_name": "tutum/wordpress-stackable:latest",
+  "nickname": "wordpress-stackable",
+  "labels": {
+    "com.example.description": "Accounting webapp",
+    "com.example.department": "Finance",
+    "com.example.label-with-empty-value": ""
+  },
+  "link_variables": {
+    "WORDPRESS_STACKABLE_1_ENV_DB_HOST": "**LinkMe**",
+    "WORDPRESS_STACKABLE_1_ENV_DB_NAME": "wordpress",
+    "WORDPRESS_STACKABLE_1_ENV_DB_PASS": "szVaPz925B7I",
+    "WORDPRESS_STACKABLE_1_ENV_DB_PORT": "**LinkMe**",
+    "WORDPRESS_STACKABLE_1_ENV_DB_USER": "admin",
+    "WORDPRESS_STACKABLE_1_ENV_DEBIAN_FRONTEND": "noninteractive",
+    "WORDPRESS_STACKABLE_1_ENV_HOME": "/",
+    "WORDPRESS_STACKABLE_1_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+    "WORDPRESS_STACKABLE_1_PORT": "tcp://wordpress-stackable-1.admin.cont.dockerapp.io:49153",
+    "WORDPRESS_STACKABLE_1_PORT_80_TCP": "tcp://wordpress-stackable-1.admin.cont.dockerapp.io:49153",
+    "WORDPRESS_STACKABLE_1_PORT_80_TCP_ADDR": "wordpress-stackable-1.admin.cont.dockerapp.io",
+    "WORDPRESS_STACKABLE_1_PORT_80_TCP_PORT": "49153",
+    "WORDPRESS_STACKABLE_1_PORT_80_TCP_PROTO": "tcp",
+    "WORDPRESS_STACKABLE_2_ENV_DB_HOST": "**LinkMe**",
+    "WORDPRESS_STACKABLE_2_ENV_DB_NAME": "wordpress",
+    "WORDPRESS_STACKABLE_2_ENV_DB_PASS": "szVaPz925B7I",
+    "WORDPRESS_STACKABLE_2_ENV_DB_PORT": "**LinkMe**",
+    "WORDPRESS_STACKABLE_2_ENV_DB_USER": "admin",
+    "WORDPRESS_STACKABLE_2_ENV_DEBIAN_FRONTEND": "noninteractive",
+    "WORDPRESS_STACKABLE_2_ENV_HOME": "/",
+    "WORDPRESS_STACKABLE_2_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+    "WORDPRESS_STACKABLE_2_PORT": "tcp://wordpress-stackable-2.admin.cont.dockerapp.io:49154",
+    "WORDPRESS_STACKABLE_2_PORT_80_TCP": "tcp://wordpress-stackable-2.admin.cont.dockerapp.io:49154",
+    "WORDPRESS_STACKABLE_2_PORT_80_TCP_ADDR": "wordpress-stackable-2.admin.cont.dockerapp.io",
+    "WORDPRESS_STACKABLE_2_PORT_80_TCP_PORT": "49154",
+    "WORDPRESS_STACKABLE_2_PORT_80_TCP_PROTO": "tcp",
+    "WORDPRESS_STACKABLE_ENV_DB_HOST": "**LinkMe**",
+    "WORDPRESS_STACKABLE_ENV_DB_NAME": "wordpress",
+    "WORDPRESS_STACKABLE_ENV_DB_PASS": "szVaPz925B7I",
+    "WORDPRESS_STACKABLE_ENV_DB_PORT": "**LinkMe**",
+    "WORDPRESS_STACKABLE_ENV_DB_USER": "admin",
+    "WORDPRESS_STACKABLE_ENV_DEBIAN_FRONTEND": "noninteractive",
+    "WORDPRESS_STACKABLE_ENV_HOME": "/",
+    "WORDPRESS_STACKABLE_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
+    "WORDPRESS_STACKABLE_PORT": "tcp://wordpress-stackable-1.admin.cont.dockerapp.io:49153",
+    "WORDPRESS_STACKABLE_PORT_80_TCP": "tcp://wordpress-stackable-1.admin.cont.dockerapp.io:49153",
+    "WORDPRESS_STACKABLE_PORT_80_TCP_ADDR": "wordpress-stackable-1.admin.cont.dockerapp.io",
+    "WORDPRESS_STACKABLE_PORT_80_TCP_PORT": "49153",
+    "WORDPRESS_STACKABLE_PORT_80_TCP_PROTO": "tcp",
+    "WORDPRESS_STACKABLE_DOCKERCLOUD_API_URL": "https://cloud.docker.com/api/app/v1/service/adeebc1b-1b81-4af0-b8f2-cefffc69d7fb/"
+  },
+  "linked_from_service": [],
+  "linked_to_service": [
+    {
+      "from_service": "/api/app/v1/service/09cbcf8d-a727-40d9-b420-c8e18b7fa55b/",
+      "name": "DB",
+      "to_service": "/api/app/v1/service/72f175bd-390b-46e3-9463-830aca32ce3e/"
+    }
+  ],
+  "mac_address": "02:42:ac:11:65:43",
+  "memory": 2048,
+  "memory_swap": 8192,
+  "name": "wordpress-stackable",
+  "net": "bridge",
+  "privileged": false,
+  "public_dns": "wordpress-stackable.admin.svc.dockerapp.io",
+  "read_only": true,
+  "resource_uri": "/api/app/v1/service/09cbcf8d-a727-40d9-b420-c8e18b7fa55b/",
+  "roles": ["global"],
+  "run_command": "/run-wordpress.sh",
+  "running_num_containers": 1,
+  "security_opt": [
+  ],
+  "sequential_deployment": false,
+  "started_datetime": "Mon, 13 Oct 2014 11:01:43 +0000",
+  "state": "Partly running",
+  "stack": "/api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/",
+  "stdin_open": false,
+  "stopped_datetime": null,
+  "stopped_num_containers": 0,
+  "synchronized": true,
+  "tags": [
+        {"name": "tag_one"},
+        {"name": "tag-two"},
+        {"name": "tagthree3"}
+  ],
+  "target_num_containers": 2,
+  "tty": false,
+  "user": "root",
+  "uuid": "09cbcf8d-a727-40d9-b420-c8e18b7fa55b",
+  "working_dir": "/app"
+}
+
+ +

A service is a template used to deploy one or more containers.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
uuidA unique identifier for the service generated automatically on creation
resource_uriA unique API endpoint that represents the service
image_nameThe Docker image name and tag used for the service containers
nameA user provided name for the service. This name will be inherited by the service containers and will be used in endpoint URLs, environment variable names, etc.
public_dnsAn external FQDN that resolves to all IPs of the nodes where the service containers are running on (as an A record with multiple IP entries which will be used by clients in a round-robin fashion). If the service is not publishing any ports, this FQDN will fail to resolve.
stateThe state of the service (see table Service states below)
netNetwork mode to set on the containers (see table Network Modes below, more information ../../docker-cloud/apps/service-links/)
pidSet the PID (Process) Namespace mode for the containers (more information ../../reference/run/#pid-settings-pid)
synchronizedFlag indicating if the current service definition is synchronized with the current containers.
deployed_datetimeThe date and time of the last deployment of the service (if applicable, null otherwise)
started_datetimeThe date and time of the last start operation on the service (if applicable, null otherwise)
stopped_datetimeThe date and time of the last stop operation on the service (if applicable, null otherwise)
destroyed_datetimeThe date and time of the terminate operation on the service (if applicable, null otherwise)
target_num_containersThe requested number of containers to deploy for the service
current_num_containersThe actual number of containers deployed for the service
running_num_containersThe actual number of containers deployed for the service in Running state
stopped_num_containersThe actual number of containers deployed for the service in Stopped state
stackResource URIs of the stack that the service belongs to
containersList of resource URIs of the containers launched as part of the service
container_portsList of ports to be published on the containers of this service (see table Service Port attributes below)
container_envvarsList of user-defined environment variables to set on the containers of the service, which will override the image environment variables (see table Service Environment Variable attributes below)
labelsMetadata in form of dictionary used for every container of this service
working_dirWorking directory for running binaries within a container of this service
userSet the user used on containers of this service (root by default)
hostnameSet the hostname used on containers of this service
domainnameSet the domainname used on containers of this service
mac_addressEthernet device’s MAC address used on containers of this service
cgroup_nameOptional parent cgroup used on containers of this service.
ttyIf the containers of this service have the tty enable (false by default)
stdin_openIf the containers of this service have stdin opened (false by default)
dnsCustom DNS servers for containers of this service
dns_searchCustom DNS search domain for containers of this service
cap_addAdded capabilities for containers of this service
cap_dropDropped capabilities for containers of this service
devicesList of device mappings for containers of this service
extra_hostsList of hostname mappings for containers of this service
secuirty_optLabeling scheme for containers of this service
entrypointEntrypoint to be set on the containers launched as part of the service, which will override the image entrypoint
run_commandRun command to be set on the containers launched as part of the service, which will override the image run command
sequential_deploymentWhether the containers for this service should be deployed in sequence, linking each of them to the previous containers (see Service scaling for more information)
cpu_sharesThe relative CPU priority of the containers of the service (see Runtime Constraints on CPU and Memory for more information)
cpusetCPUs in which to allow execution
memoryThe memory limit of the containers of the service in MB (see Runtime Constraints on CPU and Memory for more information)
memory_swapTotal memory limit (memory + swap) of the containers of the service in MB
linked_from_serviceA list of services that are linked to this one (see table Related services attributes below)
linked_to_serviceA list of services that the service is linked to (see table Related services attributes below)
bindingsA list of volume bindings that the service has mounted (see table Service binding attributes below)
autorestartWhether to restart the containers of the service automatically if they stop (see Crash recovery for more information)
autodestroyWhether to terminate the containers of the service automatically if they stop (see Autodestroy for more information)
rolesList of Docker Cloud roles assigned to this service (see Service links for more information)
link_variablesList of environment variables that would be exposed in the containers if they are linked to this service
privilegedWhether to start the containers with Docker’s privileged flag set or not, which allows containers to access all devices on the host among other things (see Runtime privilege for more information)
read_onlyWhether the filesystem of every service container is read-only or not (false by default)
deployment_strategyContainer distribution among nodes (see table Deployment strategies below and Deployment strategies for more information)
tagsList of tags to be used to deploy the service (see Tags for more information)
autoredeployWhether to redeploy the containers of the service when its image is updated in Docker Cloud registry (see Docker Cloud’s private registry for more information)
nicknameA user-friendly name for the service (name by default)
+ +

Service binding attributes

+ + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
host_pathThe host path of the volume
container_pathThe container path where the volume is mounted
rewritabletrue is the volume has writable permissions
volumes_fromThe resource URI of the service
+ +

Service Port attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
protocolThe protocol of the port, either tcp or udp
inner_portThe published port number inside the container
outer_portThe published port number in the node public network interface
port_nameName of the service associated to this port
endpoint_uriThe URI of the service endpoint for this port
publishedWhether the port has been published in the host public network interface or not. Non-published ports can only be accessed via links.
+ +

Service Environment Variable attributes

+ + + + + + + + + + + + + + + +
AttributeDescription
keyThe name of the environment variable
valueThe value of the environment variable
+ + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
nameThe link name
from_serviceThe resource URI of the origin of the link
to_serviceThe resource URI of the target of the link
+ +

Service states

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StateDescription
Not runningThe service has been created and has no deployed containers yet. Possible actions in this state: start, terminate.
StartingAll containers for the service are either starting or already running. No actions allowed in this state.
RunningAll containers for the service are deployed and running. Possible actions in this state: stop, redeploy, terminate.
Partly runningOne or more containers of the service are deployed and running. Possible actions in this state: stop, redeploy, terminate.
ScalingThe service is either deploying new containers or destroying existing ones responding to a scaling request. No actions allowed in this state.
RedeployingThe service is redeploying all its containers with the updated configuration. No actions allowed in this state.
StoppingAll containers for the service are either stopping or already stopped. No actions allowed in this state.
StoppedAll containers for the service are stopped. Possible actions in this state: start, redeploy, terminate.
TerminatingAll containers for the service are either being terminated or already terminated. No actions allowed in this state.
TerminatedThe service and all its containers have been terminated. No actions allowed in this state.
+ +

Deployment strategies

+ + + + + + + + + + + + + + + + + + + +
StrategyDescription
EMPTIEST_NODEIt will deploy containers to the node with the lower total amount of running containers (default).
HIGH_AVAILABILITYIt will deploy containers to the node with the lower amount of running containers of the same service.
EVERY_NODEIt will deploy one container on every node. The service won’t be able to scale manually. New containers will be deployed to new nodes automatically.
+ +

Network Modes

+ + + + + + + + + + + + + + + +
StrategyDescription
bridgeCreates a new network stack for the container on the docker bridge.
hostUses the host network stack inside the container.
+ +

List all services

+
import dockercloud
+
+services = dockercloud.Service.list()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+serviceList, err := dockercloud.ListServices()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(serviceList)
+
+
GET /api/app/v1/service/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud service ps
+
+ +

Lists all current and recently terminated services. Returns a list of Service objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/app/v1/service/

+ +

Query Parameters

+ + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
uuidFilter by UUID
stateFilter by state. Possible values: Not running, Starting, Running, Partly running, Scaling, Redeploying, Stopping, Stopped, Terminating, Terminated
nameFilter by service name
stackFilter by resource URI of the target stack.
+ +

Create a new service

+
import dockercloud
+
+service = dockercloud.Service.create(image="tutum/hello-world", name="my-new-app", target_num_containers=2)
+service.save()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.CreateService(dockercloud.ServiceCreateRequest{Image: "tutum/hello-world",  Name: "my-new-app", Target_num_containers: 2})
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(service)
+
+
POST /api/app/v1/service/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+Content-Type: application/json
+
+{"image": "tutum/hello-world", "name": "my-new-app", "target_num_containers": 2}
+
+
docker-cloud service create -t 2 --name my-new-app tutum/hello-world
+
+ +

Creates a new service without starting it.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/service/

+ +

JSON Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
image(required) The image used to deploy this service in docker format, i.e. tutum/hello-world
name(optional) A human-readable name for the service, i.e. my-hello-world-app (default: image without namespace)
target_num_containers(optional) The number of containers to run for this service initially (default: 1)
run_command(optional) The command used to start the containers of this service, overriding the value specified in the image, i.e. /run.sh (default: null)
entrypoint(optional) The command prefix used to start the containers of this service, overriding the value specified in the image, i.e. /usr/sbin/sshd (default: null)
container_ports(optional) An array of objects with port information to be published in the containers for this service, which will be added to the image port information, i.e. [{"protocol": "tcp", "inner_port": 80, "outer_port": 80}] (default: []) (See table Service Port attributes below)
container_envvars(optional) An array of objects with environment variables to be added in the service containers on launch (overriding any image-defined environment variables), i.e. [{"key": "DB_PASSWORD", "value": "mypass"}] (default: []) (See table Service Environment Variable attributes below)
linked_to_service(optional) An array of service resource URIs to link this service to, including the link name, i.e. [{"to_service": "/api/app/v1/service/80ff1635-2d56-478d-a97f-9b59c720e513/", "name": "db"}] (default: []) (See table Related services attributes below)
bindings(optional) An array of bindings this service has to mount, i.e. [{"volumes_from": "/api/app/v1/service/80ff1635-2d56-478d-a97f-9b59c720e513/", "rewritable": true}] (default: []) (See table Related bindings attributes below)
autorestart(optional) Whether the containers for this service should be restarted if they stop, i.e. ALWAYS (default: OFF, possible values: OFF, ON_FAILURE, ALWAYS) (see Crash recovery for more information)
autodestroy(optional) Whether the containers should be terminated if they stop, i.e. OFF (default: OFF, possible values: OFF, ON_SUCCESS, ALWAYS) (see Autodestroy for more information)
sequential_deployment(optional) Whether the containers should be launched and scaled in sequence, i.e. true (default: false) (see Service scaling for more information)
roles(optional) A list of Docker Cloud API roles to grant the service, i.e. ["global"] (default: [], possible values: global) (see Service links for more information)
privileged(optional) Whether to start the containers with Docker’s privileged flag set or not, i.e. false (default: false) (see Runtime privilege for more information)
deployment_strategy(optional) Container distribution among nodes (default: EMPTIEST_NODE, see table Deployment strategies above and Deployment strategies for more information)
tags(optional) A list of tags to be used to deploy the service (see Tags for more information) (default: [])
autoredeploy(optional) Whether to redeploy the containers of the service when its image is updated in Docker Cloud registry (default: false) (see Docker Cloud’s private registry for more information)
net(optional) Set the network mode to the containers (default: bridge, possible values: bridge, host)
pid(optional) Set the PID (Process) Namespace mode for the containers (default: none value, possible values: none, host)
working_dir(optional) Working directory for running binaries within a container of this service (default: /)
nickname(optional) A user-friendly name for the service (name by default)
+ + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
host_path(optional) The host path of the volume
container_path(required if volumes_from is omitted) The container path where the volume is mounted
rewritable(optional) true is the volume has writable permissions (default: true)
volumes_from(required if container_path is omitted) The resource URI of the service
+ +

Service Port attributes

+ + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
protocol(required) The protocol of the port, either tcp or udp
inner_port(required) The port number inside the container to be published
outer_port(optional) The port number in the node public network interface to be published (default: dynamic allocation if published is true)
published(optional) Whether to publish the port in the host public network interface or not. Non-published ports can only be accessed via links. (default: false)
+ +

Service Environment Variable attributes

+ + + + + + + + + + + + + + + +
AttributeDescription
key(required) The name of the environment variable
value(required) The value of the environment variable
+ + + + + + + + + + + + + + + + + +
AttributeDescription
to_service(required) The resource URI of the target of the link
name(optional) The link name
+ +

Get an existing service

+
import dockercloud
+
+service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(service)
+
+
GET /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud service inspect 7eaf7fff
+
+ +

Get all the details of an specific service

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/app/v1/service/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service to retrieve
+ +

Get the logs of a service

+ +
+

Example log line

+
+
{
+    "type": "log",
+    "source": "wordpress-stackable-1",
+    "log": "Log line from the container indicated by 'source'",
+    "streamType": "stdout",
+    "timestamp": 1433779324
+}
+
+
import dockercloud
+
+def log_handler(message):
+    print message
+
+service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+service.logs(tail=300, follow=True, log_handler=log_handler)
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+c := make(chan Logs)
+
+go service.Logs(c)
+    for {
+        s := <-c
+        log.Println(s)
+    }
+
+
GET /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/logs/ HTTP/1.1
+Host: ws.cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Connection: Upgrade
+Upgrade: websocket
+
+
docker-cloud service logs 7eaf7fff
+
+ +

Get the aggregated logs of all the containers of the service.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s STREAM API

+ +

HTTP Request

+ +

GET /api/app/v1/service/(uuid)/logs/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service to retrieve logs
+ +

Query Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
tailNumber of lines to show from the end of the logs (default: 300)
followWhether to stream logs or close the connection immediately (default: true)
+ +

Update an existing service

+
import dockercloud
+
+service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+service.target_num_containers = 3
+service.tags.append({"name":"tag-1"})
+service.save()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = service.Update(dockercloud.ServiceCreateRequest{Target_num_containers: 3}); err != nil {
+   log.Println(err)
+}
+
+
PATCH /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+Content-Type: application/json
+
+{"autorestart": "ON_FAILURE", "autodestroy": "OFF", "container_envvars": [{"key": "DB_PASSWORD", "value": "mypass"}],
+"container_ports": [{"protocol": "tcp", "inner_port": 80, "outer_port": 80}], "cpu_shares": 512,
+"entrypoint": "/usr/sbin/sshd", "image": "tutum/hello-world",
+"linked_to_service": [{"to_service": "/api/app/v1/service/80ff1635-2d56-478d-a97f-9b59c720e513/", "name": "db"}],
+"memory": 2048, "privileged": True, "roles": ["global"], "run_command": "/run.sh", "sequential_deployment": False,
+"tags": [{"name": "tag-1"}], "target_num_containers": 3, "autoredeploy": False}
+
+
+
docker-cloud service scale 7eaf7fff 3
+docker-cloud tag add -t tag-1 7eaf7fff
+docker-cloud tag set -t tag-2 7eaf7fff
+
+ +

Updates the service details.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

PATCH /api/app/v1/service/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service to update
+ +

JSON Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
autorestart(optional) Whether the containers for this service should be restarted if they stop, i.e. ALWAYS (possible values: OFF, ON_FAILURE, ALWAYS) (see Crash recovery for more information)
autodestroy(optional) Whether the containers should be terminated if they stop, i.e. OFF (possible values: OFF, ON_SUCCESS, ALWAYS) (see Autodestroy for more information)
container_envvars(optional) An array of objects with environment variables to be added in the service containers on launch (overriding any image-defined environment variables), i.e. [{"key": "DB_PASSWORD", "value": "mypass"}] (See table Service Environment Variable attributes)
container_ports(optional) An array of objects with port information to be published in the containers for this service, which will be added to the image port information, i.e. [{"protocol": "tcp", "inner_port": 80, "outer_port": 80}] (See table Service Port attributes)
cpu_shares(optional) The relative CPU priority of the containers the service describes (see Runtime Constraints on CPU and Memory for more information)
entrypoint(optional) The command prefix used to start the containers of this service, overriding the value specified in the image, i.e. /usr/sbin/sshd
image(optional) The image used to deploy this service in docker format, i.e. tutum/hello-world, tutum/ubuntu:5.6. If no tag is indicated, it will be set to latest by default
linked_to_service(optional) An array of service resource URIs to link this service to, including the link name, i.e. [{"to_service": "/api/app/v1/service/80ff1635-2d56-478d-a97f-9b59c720e513/", "name": "db"}] (See table Related services attributes below)
memory(optional) The memory limit of the containers of the service in MB (see Runtime Constraints on CPU and Memory for more information)
privileged(optional) Whether to start the containers with Docker’s privileged flag set or not, i.e. false (see Runtime privilege for more information)
roles(optional) A list of Docker Cloud API roles to grant the service, i.e. ["global"] (possible values: global) (see Service links for more information)
run_command(optional) The command used to start the containers of this service, overriding the value specified in the image, i.e. /run.sh
sequential_deployment(optional) Whether the containers should be launched and scaled in sequence, i.e. true (see Service scaling for more information)
tags(optional) List of new tags the service will have. This operation replaces the tag list
target_num_containers(optional) The number of containers to scale this service to
deployment_strategy(optional) Container distribution among nodes. A service cannot be updated to or from a deployment strategy of EVERY_NODE. (See table Deployment strategies above and Deployment strategies for more information)
autoredeployWhether to redeploy the containers of the service when its image is updated in Docker Cloud registry (see Docker Cloud’s private registry for more information)
net(optional) Set the network mode to the containers (default: bridge, possible values: bridge, host)
pid(optional) Set the PID (Process) Namespace mode for the containers (default: none value, possible values: none, host)
working_dir(optional) Working directory for running binaries within a container of this service (default: /)
nickname(optional) A user-friendly name for the service (name by default)
+ +

Start a service

+
import dockercloud
+
+service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+service.start()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = service.Start(); err != nil {
+   log.Println(err)
+}
+
+
POST /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/start/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud service start 7eaf7fff
+
+ +

Starts all containers in a stopped or partly running service.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/service/(uuid)/start/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service to start
+ +

Stop a service

+
import dockercloud
+
+service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+service.stop()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = service.Stop(); err != nil {
+   log.Println(err)
+}
+
+
POST /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/stop/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud service stop 7eaf7fff
+
+ +

Stops all containers in a running or partly running service.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/service/(uuid)/stop/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service to stop
+ +

Scale a service

+
import dockercloud
+
+service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+service.target_num_containers = 3
+service.save()
+service.scale()
+
+
POST /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/scale/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud service scale 7eaf7fff-882c-4f3d-9a8f-a22317ac00ce 3
+
+ +

Scales the service to its current target_num_containers field.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/service/(uuid)/scale/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service to scale
+ +

Redeploy a service

+
import dockercloud
+
+service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+service.redeploy()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+//Redeploy(dockercloud.ReuseVolumesOption{Reuse: true}) to reuse the existing volumes
+//Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}) to not reuse the existing volumes
+if err = service.Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}); err != nil {
+   log.Println(err)
+}
+
+
POST /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/redeploy/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud service redeploy 7eaf7fff
+
+ +

Redeploys all containers in the service with the current service configuration.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/service/(uuid)/redeploy/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service to redeploy
+ +

Query Parameters

+ + + + + + + + + + + +
ParameterDescription
reuse_volumesWheather to reuse container volumes for this redeploy operation or not (default: true).
+ +

Terminate a service

+
import dockercloud
+
+service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+service.delete()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = service.Terminate(); err != nil {
+   log.Println(err)
+}
+
+
DELETE /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud service terminate 7eaf7fff
+
+ +

Terminate all the containers in a service and the service itself. This is not reversible. All the data stored in all containers of the service will be permanently deleted.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

DELETE /api/app/v1/service/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service to terminate
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/stack.html b/apidocs/docker-cloud/includes/stack.html new file mode 100644 index 0000000000..e62384203f --- /dev/null +++ b/apidocs/docker-cloud/includes/stack.html @@ -0,0 +1,695 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Stacks

+ +

Stack

+ +
+

Example

+
+
{
+  "deployed_datetime": "Mon, 13 Oct 2014 11:01:43 +0000",
+  "destroyed_datetime": null,
+  "nickname": "deployment stack",
+  "name": "dockercloud-app",
+  "resource_uri": "/api/app/v1/stack/7fe7ec85-58be-4904-81da-de2219098d7c/",
+  "services": [
+    "/api/app/v1/service/09cbcf8d-a727-40d9-b420-c8e18b7fa55b/"
+  ],
+  "state": "Running",
+  "synchronized": true,
+  "uuid": "09cbcf8d-a727-40d9-b420-c8e18b7fa55b"
+}
+
+ +

A stack is a logical grouping of closely related services, that may be linked with one another.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
uuidA unique identifier for the stack generated automatically on creation
resource_uriA unique API endpoint that represents the stack
nameA user provided name for the stack.
stateThe state of the stack (see table Stack states below)
synchronizedFlag indicating if the current stack definition is synchronized with their services.
servicesList of service resource URIs belonging to the stack
deployed_datetimeThe date and time of the last deployment of the stack (if applicable, null otherwise)
destroyed_datetimeThe date and time of the terminate operation on the stack (if applicable, null otherwise)
nicknameA user-friendly name for the stack (name by default)
+ +

Stack states

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StateDescription
Not RunningThe stack has been created and has no deployed services yet. Possible actions in this state: start, terminate.
StartingAll services for the stack are either starting or already running. No actions allowed in this state.
RunningAll services for the service are deployed and running. Possible actions in this state: redeploy, terminate.
Partly runningOne or more services of the stack are deployed and running. Possible actions in this state: redeploy, terminate.
StoppingAll services for the stack are either stopping or already stopped. No actions allowed in this state.
StoppedAll services for the service are stopped. Possible actions in this state: start, redeploy, terminate.
RedeployingThe stack is redeploying all its services with the updated configuration. No actions allowed in this state.
TerminatingAll services for the stack are either being terminated or already terminated. No actions allowed in this state.
TerminatedThe stack and all its services have been terminated. No actions allowed in this state.
+ +

List all stacks

+
import dockercloud
+
+stacks = dockercloud.Stack.list()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+stackList, err := dockercloud.ListStacks()
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(stackList)
+
+
GET /api/app/v1/stack/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud stack ls
+
+ +

Lists all current and recently terminated stacks. Returns a list of Stack objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/app/v1/stack/

+ +

Query Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
uuidFilter by UUID
nameFilter by stack name
+ +

Create a new stack

+
import dockercloud
+
+stack = dockercloud.Stack.create(name="my-new-stack", services=[{"name": "hello-word", "image": "tutum/hello-world", "target_num_containers": 2}])
+stack.save()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+stack, err := dockercloud.CreateStack(dockercloud.StackCreateRequest{Name: "my-new-stack", Services: []dockercloud.ServiceCreateRequest{ {Image: "tutum/hello-world", Name: "test", Target_num_containers: 2}}})
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(stack)
+
+
POST /api/app/v1/stack/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+Content-Type: application/json
+
+{
+    "name": "my-new-stack",
+    "services": [
+        {
+            "name": "hello-word",
+            "image": "tutum/hello-world",
+            "target_num_containers": 2,
+            "linked_to_service": [
+                {
+                    "to_service": "database",
+                    "name": "DB"
+                }
+            ]
+        },
+        {
+            "name": "database",
+            "image": "tutum/mysql"
+        }
+    ]
+}
+
+
docker-cloud stack create --name hello-world -f docker-compose.yml
+
+ +

Creates a new stack without starting it. Note that the JSON syntax is abstracted by both, the Docker Cloud CLI and our UI, in order to use Stack YAML files.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/stack/

+ +

JSON Parameters

+ + + + + + + + + + + + + + + + + + + +
ParameterDescription
name(required) A human-readable name for the stack, i.e. my-hello-world-stack
nickname(optional) A user-friendly name for the stack (name by default)
services(optional) List of services belonging to the stack. Each service accepts the same parameters as a Create new service operation (default: []) plus the ability to refer “links” and “volumes-from” by the name of another service in the stack (see example).
+ +

Export an existing stack

+
import dockercloud
+
+stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
+stack.export()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = stack.Export(); err != nil {
+   log.Println(err)
+}
+
+
GET /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/export/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud stack export 46aca402
+
+ +

Get a JSON representation of the stack following the Stack YAML representation.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/app/v1/stack/(uuid)/export/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the stack to retrieve
+ +

Get an existing stack

+
import dockercloud
+
+stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(stack)
+
+
GET /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud stack inspect 46aca402-2109-4a70-a378-760cfed43816
+
+ +

Get all the details of an specific stack

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/app/v1/stack/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the stack to retrieve
+ +

Update an existing stack

+
import dockercloud
+
+stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
+stack.services = {"services": [{"name": "hello-word", "image": "tutum/hello-world", "target_num_containers": 2}]}
+stack.save()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = stack.Update(dockercloud.StackCreateRequest{Services: []dockercloud.ServiceCreateRequest{ {Name: "hello-world", Image: "tutum/hello-world", Target_num_containers: 2}}}); err != nil {
+   log.Println(err)
+}
+
+
PATCH /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+Content-Type: application/json
+
+{
+    "services": [
+        {
+            "name": "hello-word",
+            "image": "tutum/hello-world",
+            "target_num_containers": 3,
+            "linked_to_service": [
+                {
+                    "to_service": "database",
+                    "name": "DB"
+                }
+            ]
+        },
+        {
+            "name": "database",
+            "image": "tutum/mysql"
+        }
+    ]
+}
+
+
docker-cloud stack update -f docker-compose.yml 46aca402
+
+ +

Updates the details of every service in the stack.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

PATCH /api/app/v1/stack/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the stack to update
+ +

JSON Parameters

+ + + + + + + + + + + +
ParameterDescription
services(optional) List of services belonging to the stack. Each service accepts the same parameters as a Update an existing service operation (default: []) plus the ability to refer “links” and “volumes-from” by the name of another service in the stack (see example).
+ +

Stop a stack

+
import dockercloud
+
+stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
+stack.stop()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = stack.Stop(); err != nil {
+   log.Println(err)
+}
+
+
POST /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/stop/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud stack stop 46aca402-2109-4a70-a378-760cfed43816
+
+ +

Stops the services in the stack.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/stack/(uuid)/stop/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the stack to stop
+ +

Start a stack

+
import dockercloud
+
+stack = dockercloud.Stack.fetch()
+stack.start()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = stack.Start(); err != nil {
+   log.Println(err)
+}
+
+
POST /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/start/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud stack start 46aca402
+
+ +

Starts the services in the stack.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/stack/(uuid)/start/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the stack to start
+ +

Redeploy a stack

+
import dockercloud
+
+stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
+stack.redeploy()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
+
+if err != nil {
+  log.Println(err)
+}
+
+//Redeploy(dockercloud.ReuseVolumesOption{Reuse: true}) to reuse the existing volumes
+//Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}) to not reuse the existing volumes
+if err = stack.Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}); err != nil {
+   log.Println(err)
+}
+
+
POST /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/redeploy/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud stack redeploy 46aca402
+
+ +

Redeploys all the services in the stack.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/stack/(uuid)/redeploy/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the stack to redeploy
+ +

Query Parameters

+ + + + + + + + + + + +
ParameterDescription
reuse_volumesWheather to reuse container volumes for this redeploy operation or not (default: true).
+ +

Terminate a stack

+
import dockercloud
+
+stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
+stack.delete()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
+
+if err != nil {
+  log.Println(err)
+}
+
+if err = stack.Terminate(); err != nil {
+   log.Println(err)
+}
+
+
DELETE /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud stack terminate 46aca402
+
+ +

Terminate all the services in a the stack and the stack itself.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

DELETE /api/app/v1/stack/(uuid)/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the stack to terminate
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/tag.html b/apidocs/docker-cloud/includes/tag.html new file mode 100644 index 0000000000..c56bec4170 --- /dev/null +++ b/apidocs/docker-cloud/includes/tag.html @@ -0,0 +1,121 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Tags

+ +

Tag

+ +
+

Example

+
+
{
+    "name": "byon=false",
+    "origin": "tutum"
+}
+
+ +

Tags are used to target the deployment of services to a specific set of nodes. Learn more

+ +

Attributes

+ + + + + + + + + + + + + + + +
AttributeDescription
nameName of the tag
originPossible values: user, tutum
+ +

List all node tags

+
GET /api/infra/v1/tag/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud tag ls 7eaf7fff-882c
+
+ +

Lists all tags used by all nodes. Returns a list of Tag objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/infra/v1/tag/

+ +

Query Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
nameFilter by name
originFilter by origin. Possible values: user, tutum
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/includes/triggers.html b/apidocs/docker-cloud/includes/triggers.html new file mode 100644 index 0000000000..b44f4ea437 --- /dev/null +++ b/apidocs/docker-cloud/includes/triggers.html @@ -0,0 +1,389 @@ + + + + + + + API Documentation + + + + + + + + + + + + NAV + + + +
+ +
+
+
+
+
+
+

Triggers

+ +

Service triggers

+ +
+

Example

+
+
{
+  "url": "/api/app/v1/service/82d4a246-52d8-468d-903d-9da9ef05ff28/trigger/0224815a-c156-44e4-92d7-997c69354438/call/",
+  "operation": "REDEPLOY",
+  "name": "docker_trigger",
+  "resource_uri": "/api/app/v1/service/82d4a246-52d8-468d-903d-9da9ef05ff28/trigger/0224815a-c156-44e4-92d7-997c69354438/"
+}
+
+ +

Triggers are URLs that will start a redeploy of the service whenever a POST request is sent to them. They require no authorization headers, so they should be treated as access tokens. Triggers can be revoked if they are leaked or no longer used for security purposes. See Triggers for more information.

+ +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescription
urlAddress to be used to call the trigger with a POST request
nameA user provided name for the trigger
operationThe operation that the trigger call performs (see table Operations below)
resource_uriA unique API endpoint that represents the trigger
+ +

Operations

+ + + + + + + + + + + + + + + +
OperationDescription
REDEPLOYPerforms a redeploy service operation.
SCALEUPPerforms a scale up service operation.
+ +

List all triggers

+
import dockercloud
+
+service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
+trigger = dockercloud.Trigger.fetch(service)
+trigger.list()
+
+
GET /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
+
+    if err != nil {
+        log.Println(err)
+    }
+
+trigger, err := service.ListTriggers()
+
+  if err != nil {
+    log.Println(err)
+  }
+
+    log.Println(trigger)
+
+
docker-cloud trigger list 61a29874-9134-48f9-b460-f37d4bec4826
+
+ +

Lists all current triggers the service has associated to. Returns a list of Service Trigger objects.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/app/v1/service/(uuid)/trigger/

+ +

Path Parameters

+ + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service the triggers are associated to
+ +

Create a new trigger

+
import dockercloud
+
+service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
+trigger = dockercloud.Trigger.fetch(service)
+trigger.add(name="mytrigger_name", operation="REDEPLOY")
+trigger.save()
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
+
+if err != nil {
+  log.Println(err)
+}
+
+trigger, err := service.CreateTrigger(dockercloud.TriggerCreateRequest{Name: "test-trigger", Operation: "REDEPLOY"})
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(trigger)
+
+
POST /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+Content-Type: application/json
+
+{"name": "mytrigger_name", "operation": "REDEPLOY"}
+
+
docker-cloud trigger create --name mytrigger_name --operation REDEPLOY 61a29874-9134-48f9-b460-f37d4bec4826
+
+ +

Creates a new service trigger.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/service/(uuid)/trigger/

+ +

JSON Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
name(optional) A user provided name for the trigger
operation(optional) The operation to be performed by the trigger (default: “REDEPLOY”)
+ +

Get an existing trigger

+
import dockercloud
+
+service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
+trigger = dockercloud.Trigger.fetch(service)
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
+
+if err != nil {
+  log.Println(err)
+}
+
+trigger, err := service.GetTrigger("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+if err != nil {
+  log.Println(err)
+}
+
+log.Println(trigger)
+
+
GET /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+ +

Get all the details of an specific trigger

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

GET /api/app/v1/service/(uuid)/trigger/(trigger_uuid)/

+ +

Path Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the service the triggers are associated to
trigger_uuidThe UUID of the trigger to retrieve
+ +

Delete a trigger

+
import dockercloud
+
+service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
+trigger = dockercloud.Trigger.fetch(service)
+trigger.delete("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
+
+if err != nil {
+  log.Println(err)
+}
+
+service.DeleteTrigger("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+
DELETE /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
+Host: cloud.docker.com
+Authorization: Basic dXNlcm5hbWU6YXBpa2V5
+Accept: application/json
+
+
docker-cloud trigger rm 61a29874-9134-48f9-b460-f37d4bec4826 7eaf7fff-882c-4f3d-9a8f-a22317ac00ce
+
+ +

Deletes specific trigger. It will be no longer available to be called.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

DELETE /api/app/v1/service/(uuid)/trigger/(trigger_uuid)/

+ +

Path Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the associated service
trigger_uuidThe UUID of the trigger to delete
+ +

Call a trigger

+
import dockercloud
+
+service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
+trigger = dockercloud.Trigger.fetch(service)
+trigger.call("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+
import "github.com/docker/go-dockercloud/dockercloud"
+
+service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
+
+if err != nil {
+  log.Println(err)
+}
+
+service.CallTrigger("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
+
+
POST /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/call/ HTTP/1.1
+Host: cloud.docker.com
+Accept: application/json
+
+ +

Executes the trigger. For SCALEUP triggers, the number of containers to scale up can be passed at the end of the trigger call url, for example /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/call/3/.

+ +

Endpoint Type

+ +

Available in Docker Cloud’s REST API

+ +

HTTP Request

+ +

POST /api/app/v1/service/(uuid)/trigger/(trigger_uuid)/call/

+ +

Path Parameters

+ + + + + + + + + + + + + + + +
ParameterDescription
uuidThe UUID of the associated service
trigger_uuidThe UUID of the trigger to call
+ +
+
+
+
+
+ + + + +
+ + diff --git a/apidocs/docker-cloud/index.html b/apidocs/docker-cloud/index.html new file mode 100644 index 0000000000..07094e54d5 --- /dev/null +++ b/apidocs/docker-cloud/index.html @@ -0,0 +1,6545 @@ + + + + + + + Docker Cloud API reference + + + + + + + + + + + + + NAV + + + +
+ +
+ http + go + python + CLI +
+ +
    +
    +
    +
    +
    +
    +
    +

    Introduction

    + +

    Docker Cloud currently offers a HTTP REST API and a Websocket Stream API which are used by both the Web UI and the CLI. This API documentation contains all API operations currently supported in the platform and provides examples of how to execute them using our Command Line Interface (CLI), Python SDK and Go SDK.

    + +

    Authentication

    + +

    In order to be able to make requests to the Docker Cloud API, you should first obtain an ApiKey for your account. For this, log into Docker Cloud, click on the menu on the upper right corner of the screen, select Account info and then select API keys.

    + +

    REST API

    +
    import dockercloud
    +dockercloud.user = "username"
    +dockercloud.apikey = "apikey"
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +dockercloud.User = "username"
    +dockercloud.ApiKey = "apikey"
    +
    +
    GET /api/app/v1/service/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    export DOCKERCLOUD_USER=username
    +export DOCKERCLOUD_APIKEY=apikey
    +
    + +
    +

    Make sure to replace username with your username and apikey with your API key.

    +
    + +

    The Docker Cloud REST API is reachable through the following hostname:

    + +

    https://cloud.docker.com/

    + +

    All requests should be sent to this endpoint using Basic authentication using your API key as password:

    + +

    Authorization: Basic dXNlcm5hbWU6YXBpa2V5

    + +

    HTTP responses are given in JSON format, so the following Accept header is required for every API call:

    + +

    Accept: application/json

    + +

    Stream API

    +
    import websocket
    +import base64
    +
    +header = "Authorization: Basic %s" % base64.b64encode("%s:%s" % (username, password))
    +ws = websocket.WebSocketApp('wss://ws.cloud.docker.com/v1/events', header=[header])
    +
    +
    import "github.com/gorilla/websocket"
    +import "encoding/base64"
    +
    +var StreamUrl = "wss://ws.cloud.docker.com:443/v1/events"
    +
    +sEnc := base64.StdEncoding.EncodeToString([]byte(User + ":" + ApiKey))
    +header := http.Header{}
    +header.Add("Authorization", fmt.Sprintf("Basic %s", sEnc))
    +
    +var Dialer websocket.Dialer
    +ws, _, err := Dialer.Dial(url, header)
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +
    GET /api/audit/v1/events HTTP/1.1
    +Host: ws.cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Connection: Upgrade
    +Upgrade: websocket
    +
    +
    export DOCKERCLOUD_USER=username
    +export DOCKERCLOUD_APIKEY=apikey
    +
    + +
    +

    Make sure to replace username with your username and apikey with your API key.

    +
    + +

    The Docker Cloud Stream API is reachable through the following hostname:

    + +

    wss://ws.cloud.docker.com/

    + +

    The Stream API requires the same authentication mechanism as the REST API:

    + +

    Authorization: Basic dXNlcm5hbWU6YXBpa2V5

    + +

    API roles

    + +
    +

    The CLI and the SDKs will detect this environment variable and automatically use it

    +
    + +

    If you give an API role to a container, the environment variable DOCKERCLOUD_AUTH inside the container will have the contents of the Authorization header that you can use to authenticate against the REST or Stream APIs:

    + +

    curl -H "Authorization: $DOCKERCLOUD_AUTH" https://cloud.docker.com/api/app/v1/service/

    + +

    Actions

    + +

    Action

    + +
    +

    Example

    +
    +
    {
    +    "action": "Cluster Create",
    +    "end_date": "Wed, 17 Sep 2014 08:26:22 +0000",
    +    "ip": "56.78.90.12",
    +    "is_user_action": true,
    +    "can_be_canceled": false,
    +    "location": "New York, USA",
    +    "method": "POST",
    +    "object": "/api/infra/v1/cluster/eea638f4-b77a-4183-b241-22dbd7866f22/",
    +    "path": "/api/infra/v1/cluster/",
    +    "resource_uri": "/api/audit/v1/action/6246c558-976c-4df6-ba60-eb1a344a17af/",
    +    "start_date": "Wed, 17 Sep 2014 08:26:22 +0000",
    +    "state": "Success",
    +    "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/7.0.6 Safari/537.78.2",
    +    "uuid": "6246c558-976c-4df6-ba60-eb1a344a17af"
    +}
    +
    + +

    An action represents an API call by a user. Details of the API call such as timestamp, origin IP address, and user agent are logged in the action object.

    + +

    Simple API calls that do not require asynchronous execution will return immediately with the appropiate HTTP error code and an action object will be created either in Success or Failed states. API calls that do require asynchronous execution will return HTTP code 202 Accepted immediately and create an action object in In progress state, which will change to Success or Failed state depending on the outcome of the operation being performed. In both cases the response will include a X-DockerCloud-Action-URI header with the resource URI of the created action.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    resource_uriA unique API endpoint that represents the action
    uuidA unique identifier for the action generated automatically on creation
    objectThe API object (resource URI) to which the action applies to
    actionName of the operation performed/being performed
    methodHTTP method used to access the API
    pathHTTP path of the API accessed
    user_agentThe user agent provided by the client when accessing the API endpoint
    start_dateDate and time when the API call was performed and the operation started processing
    end_dateDate and time when the API call finished processing
    stateState of the operation (see table below)
    ipIP address of the user that performed the API call
    locationGeographic location of the IP address of the user that performed the API call
    is_user_actionIf the action has been triggered by the user
    can_be_canceledIf the action can be canceled by the user in the middle of its execution
    can_be_retriedIf the action can be retried by the user
    + +

    Action states

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    StateDescription
    PendingThe action needed asynchronous execution and it is waiting for an in progress action
    In progressThe action needed asynchronous execution and is being performed
    CancelingThe action is being canceled by user request
    CanceledThe action has been canceled
    SuccessThe action was executed successfully
    FailedThere was an issue when the action was being performed. Check the logs for more information.
    + +

    List all actions

    +
    import dockercloud
    +
    +actions = dockercloud.Action.list()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +actionList, err := dockercloud.ListActions()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(actionList)
    +
    +
    GET /api/audit/v1/action/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud action ls
    +
    + +

    Lists all actions in chronological order. Returns a list of Action objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/audit/v1/action/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidFilter by UUID.
    stateFilter by state. Possible values: In progress, Success, Failed
    start_dateFilter by start date. Valid filtering values are start_date__gte (after or on the date supplied) and start_date__lte (before or on the date supplied)
    end_dateFilter by end date. Valid filtering values are end_date__gte (after or on the date supplied) and end_date__lte (before or on the date supplied)
    objectFilter by resource URI of the related object. This filter can only be combined with ‘include_related’ filter
    include_relatedThere is a parent-child relationship between Docker Cloud objects, described in table Relationships between Docker Cloud objects. If set to 'true’, will include the actions of the related objects to the object specified in “object” filter parameter. Possible values: 'true’ or 'false’
    + +

    Relationships between Docker Cloud objects

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ObjectRelationships
    ContainerContainer, service, stack (if any)
    ServiceAll containers in the service, service, stack (if any)
    StackAll services in the stack, all containers in every service in the stack, stack
    NodeNode, node cluster (if any)
    Node clusterAll nodes in the cluster, node cluster
    + +

    Get an action by UUID

    +
    import dockercloud
    +
    +action = dockercloud.Action.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +action, err := dockercloud.GetAction("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(action)
    +
    +
    GET /api/audit/v1/action/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud action inspect 7eaf7fff
    +
    + +

    Get all the details of an specific action

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/audit/v1/action/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the action to retrieve
    + +

    Get the logs of an action

    + +
    +

    Example log line

    +
    +
    {
    +    "type": "log",
    +    "log": "Log line from the action",
    +    "timestamp": 1433779324
    +}
    +
    +
    import dockercloud
    +
    +def log_handler(message):
    +    print message
    +
    +action = dockercloud.Action.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +action.logs(tail=300, follow=True, log_handler=log_handler)
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +c := make(chan dockercloud.Logs)
    +action, err := dockercloud.GetAction("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +go action.GetLogs(c)
    +
    +for {
    +    log.Println(<-c)
    +}
    +
    +
    GET /api/audit/v1/action/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/logs/ HTTP/1.1
    +Host: ws.cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Connection: Upgrade
    +Upgrade: websocket
    +
    +
    docker-cloud action logs 7eaf7fff-882c-4f3d-9a8f-a22317ac00ce
    +
    + +

    Get the logs of the specified action.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s STREAM API

    + +

    HTTP Request

    + +

    GET /api/audit/v1/action/(uuid)/logs/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the action to retrieve logs
    + +

    Query Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    tailNumber of lines to show from the end of the logs (default: 300)
    followWhether to stream logs or close the connection immediately (default: true)
    + +

    Cancel an action

    +
    POST /api/audit/v1/action/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/cancel/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +action, err := dockercloud.GetAction("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +action, err = action.Cancel()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(action)
    +
    + +

    Cancels an action in Pending or In progress state.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/audit/v1/action/(uuid)/cancel/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the action to cancel
    + +

    Retry an action

    +
    import dockercloud
    +
    +def log_handler(message):
    +  print message
    +
    +action = dockercloud.Action.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +action.logs(tail=300, follow=True, log_handler=log_handler)
    +
    +
    POST /api/audit/v1/action/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/retry/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +action, err := dockercloud.GetAction("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +action, err = action.Retry()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(action)
    +
    +
    docker-cloud action logs 7eaf7fff-882c-4f3d-9a8f-a22317ac00ce
    +
    + +

    Retries an action in Success, Failed or Canceled state.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/audit/v1/action/(uuid)/retry/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the action to retry
    + +

    Providers

    + +

    Provider

    + +
    +

    Example

    +
    +
    {
    +    "available": true,
    +    "label": "Digital Ocean",
    +    "name": "digitalocean",
    +    "regions": [
    +        "/api/infra/v1/region/digitalocean/ams1/",
    +        "/api/infra/v1/region/digitalocean/ams2/",
    +        "/api/infra/v1/region/digitalocean/ams3/",
    +        "/api/infra/v1/region/digitalocean/lon1/",
    +        "/api/infra/v1/region/digitalocean/nyc1/",
    +        "/api/infra/v1/region/digitalocean/nyc2/",
    +        "/api/infra/v1/region/digitalocean/nyc3/",
    +        "/api/infra/v1/region/digitalocean/sfo1/",
    +        "/api/infra/v1/region/digitalocean/sgp1/"
    +    ],
    +    "resource_uri": "/api/infra/v1/provider/digitalocean/"
    +}
    +
    + +

    A provider is a representation of a cloud provider supported by Docker Cloud. Providers have one or more regions where nodes are deployed.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    resource_uriA unique API endpoint that represents the provider
    nameA unique identifier for the provider
    labelA user-friendly name for the provider
    regionsA list of resource URIs of the regions available in this provider
    availableWhether the provider is currently available for new node deployments
    + +

    List all providers

    +
    import dockercloud
    +
    +providers = dockercloud.Provider.list()
    +
    +
    GET /api/infra/v1/provider/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +providerList, err := dockercloud.ListProviders()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(providerList)
    +
    +
    docker-cloud nodecluster provider
    +
    + +

    Lists all supported cloud providers. Returns a list of Provider objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/provider/

    + +

    Query Parameters

    + + + + + + + + + + + +
    ParameterDescription
    nameFilter by provider name
    + +

    Get an individual provider

    +
    import dockercloud
    +
    +provider = dockercloud.Provider.fetch("digitalocean")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +provider, err := dockercloud.GetProvider("digitalocean")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(provider)
    +
    +
    GET /api/infra/v1/provider/digitalocean/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    + +

    Get all the details of a specific provider

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/provider/(name)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    nameThe name of the provider to retrieve
    + +

    Regions

    + +

    Region

    + +
    +

    Example

    +
    +
    {
    +    "availability_zones": [],
    +    "available": true,
    +    "label": "Amsterdam 2",
    +    "name": "ams2",
    +    "node_types": [
    +        "/api/infra/v1/nodetype/digitalocean/1gb/",
    +        "/api/infra/v1/nodetype/digitalocean/2gb/",
    +        "/api/infra/v1/nodetype/digitalocean/4gb/",
    +        "/api/infra/v1/nodetype/digitalocean/8gb/",
    +        "/api/infra/v1/nodetype/digitalocean/16gb/",
    +        "/api/infra/v1/nodetype/digitalocean/32gb/",
    +        "/api/infra/v1/nodetype/digitalocean/48gb/",
    +        "/api/infra/v1/nodetype/digitalocean/64gb/"
    +    ],
    +    "provider": "/api/infra/v1/provider/digitalocean/",
    +    "resource_uri": "/api/infra/v1/region/digitalocean/ams2/"
    +}
    +
    + +

    A region is a representation of an entire or a subset of a data center of a cloud provider. It can contain availability zones (depending on the provider) and one or more node types.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    resource_uriA unique API endpoint that represents the region
    nameAn identifier for the region
    labelA user-friendly name for the region
    node_typesA list of resource URIs of the node types available in the region
    availability_zonesA list of resource URIs of the availability zones available in the region
    providerThe resource URI of the provider of the region
    availableWhether the region is currently available for new node deployments
    + +

    List all regions

    +
    import dockercloud
    +
    +regions = dockercloud.Region.list()
    +
    +
    GET /api/infra/v1/region/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +regionList, err := dockercloud.ListRegions()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(regionList)
    +
    +
    docker-cloud nodecluster region
    +
    + +

    Lists all regions of all supported cloud providers. Returns a list of Region objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/region/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    nameFilter by region name
    providerFilter by resource URI of the target provider
    + +

    Get an individual region

    +
    import dockercloud
    +
    +region = dockercloud.Region.fetch("digitalocean/lon1")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +region, err := dockercloud.GetRegion("digitalocean","lon1")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(region)
    +
    +
    GET /api/infra/v1/region/digitalocean/lon1/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    + +

    Get all the details of a specific region

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/region/(provider.name)/(name)/

    + +

    Path Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    nameThe name of the region to retrieve
    provider.nameThe name of the provider of the region
    + +

    Availability Zones

    + +

    Availability Zone

    + +
    +

    Example

    +
    +
    {
    +    "available": true,
    +    "name": "ap-northeast-1a",
    +    "region": "/api/infra/v1/region/az/ap-northeast-1/",
    +    "resource_uri": "/api/infra/v1/az/aws/ap-northeast-1/ap-northeast-1a/"
    +}
    +
    + +

    An Availability Zone is an isolated location inside a region. Providers that support availability zones: AWS

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    availableWhether the availability zone is currently available for new node deployments
    nameAn identifier for the availability zone
    regionThe resource URI of the region where the availability zone is allocated
    resource_uriA unique API endpoint that represents the zone
    + +

    List all availability zones

    +
    import dockercloud
    +
    +az = dockercloud.AZ.list()
    +
    +
    GET /api/infra/v1/az/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +az, err := dockercloud.ListAZ()
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +log.Println(az)
    +
    +
    docker-cloud nodecluster az
    +
    + +

    Lists all availability zones from all regions of all supported cloud providers. Returns a list of Availability Zone objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/az/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    nameFilter by availability zone name
    regionFilter by resource URI of the target region
    + +

    Get an individual availability zone

    +
    import dockercloud
    +
    +az = dockercloud.AZ.fetch("aws/sa-east-1/sa-east-1a")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +az, err := dockercloud.GetAZ("aws/sa-east-1/sa-east-1a")
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +log.Println(az)
    +
    +
    GET /api/infra/v1/az/aws/sa-east-1/sa-east-1a/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    + +

    Get all the details of a specific availability zone

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/az/(provider.name)/(region.name)/(name)/

    + +

    Path Parameters

    + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    nameThe name of the availability zone to retrieve
    providerThe name of the provider
    regionThe name of the region
    + +

    Node Types

    + +

    Node Type

    + +
    +

    Example

    +
    +
    {
    +    "availability_zones": [],
    +    "available": true,
    +    "label": "1GB",
    +    "name": "1gb",
    +    "provider": "/api/infra/v1/provider/digitalocean/",
    +    "regions": [
    +        "/api/infra/v1/region/digitalocean/ams1/",
    +        "/api/infra/v1/region/digitalocean/sfo1/",
    +        "/api/infra/v1/region/digitalocean/nyc2/",
    +        "/api/infra/v1/region/digitalocean/ams2/",
    +        "/api/infra/v1/region/digitalocean/sgp1/",
    +        "/api/infra/v1/region/digitalocean/lon1/",
    +        "/api/infra/v1/region/digitalocean/nyc3/",
    +        "/api/infra/v1/region/digitalocean/nyc1/"
    +    ],
    +    "resource_uri": "/api/infra/v1/nodetype/digitalocean/1gb/"
    +}
    +
    + +

    A node type is a representation of an instance size supported by a certain cloud provider in a certain region and/or availability zone.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    resource_uriA unique API endpoint that represents the node type
    nameAn identifier for the node type
    labelA user-friendly name for the node type
    regionsA list of resource URIs of the regions to which this node type can be deployed to
    availability_zonesA list of resource URIs of the availability zones to which this node type can be deployed to
    providerThe resource URI of the provider of the node type
    availableWhether the node type is currently available for new node deployments
    + +

    List all node types

    +
    import dockercloud
    +
    +nodetypes = dockercloud.NodeType.list()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +nodetypeList, err := dockercloud.ListNodeTypes()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(nodetypeList)
    +
    +
    GET /api/infra/v1/nodetype/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud nodecluster nodetype
    +
    + +

    Lists all node types of all supported cloud providers. Returns a list of NodeType objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/nodetype/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    nameFilter by node type name
    regionsFilter by resource URI of the target regions
    availability_zonesFilter by resource URI of the target availability zones
    + +

    Get an individual node type

    +
    import dockercloud
    +
    +nodetype = dockercloud.NodeType.fetch("digitalocean/1gb")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +nodetype, err := dockercloud.GetNodeType("digitalocean","1gb")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(nodetype)
    +
    +
    GET /api/infra/v1/nodetype/digitalocean/1gb/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    + +

    Get all the details of a specific node type

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/nodetype/(provider.name)/(name)/

    + +

    Path Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    nameThe name of the node type to retrieve
    provider.nameThe name of the provider of the node type
    + +

    Node Clusters

    + +

    Node Cluster

    + +
    +

    Example

    +
    +
    {
    +    "current_num_nodes": 1,
    +    "deployed_datetime": "Tue, 16 Sep 2014 17:01:15 +0000",
    +    "destroyed_datetime": null,
    +    "disk": 60,
    +    "nickname": "my test cluster",
    +    "name": "TestCluster",
    +    "node_type": "/api/infra/v1/nodetype/aws/t2.micro/",
    +    "nodes": [
    +        "/api/infra/v1/node/75d20367-0948-4f10-8ba4-ffb4d16ed3c6/"
    +    ],
    +    "region": "/api/infra/v1/region/aws/us-east-1/",
    +    "resource_uri": "/api/infra/v1/nodecluster/5516df0b-721e-4470-b350-741ff22e63a0/",
    +    "state": "Deployed",
    +    "tags": [
    +        {"name": "tag_one"},
    +        {"name": "tag-two"},
    +        {"name": "tagthree3"}
    +    ],
    +    "target_num_nodes": 2,
    +    "uuid": "5516df0b-721e-4470-b350-741ff22e63a0",
    +    "provider_options": {
    +        "vpc": {
    +            "id": "vpc-aa1c70d4",
    +            "subnets": ["subnet-aaa7d94f", "subnet-aa15fa64"],
    +            "security_groups": ["sg-aa1c70d4"]
    +        },
    +        "iam": {
    +            "instance_profile_name": "my_instance_profile"
    +        }
    +    }
    +}
    +
    + +

    A node cluster is a group of nodes that share the same provider, region and/or availability zone, and node type. They are on the same private network.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    uuidA unique identifier for the node cluster generated automatically on creation
    resource_uriA unique API endpoint that represents the node cluster
    nameA user provided name for the node cluster
    stateThe state of the node cluster. See the below table for a list of possible states.
    node_typeThe resource URI of the node type used for the node cluster
    diskThe size of the disk where images and containers are stored (in GB)
    nodesA list of resource URIs of the Node objects on the node cluster
    regionThe resource URI of the Region object where the node cluster is deployed
    target_num_nodesThe desired number of nodes for the node cluster
    current_num_nodesThe actual number of nodes in the node cluster. This may differ from target_num_nodes if the node cluster is being deployed or scaled
    deployed_datetimeThe date and time when this node cluster was deployed
    destroyed_datetimeThe date and time when this node cluster was terminated (if applicable)
    tagsList of tags to identify the node cluster nodes when deploying services (see Tags for more information)
    provider_optionsProvider-specific extra options for the deployment of the node (see Provider options table below for more information)
    nicknameA user-friendly name for the node cluster (name by default)
    + +

    Node Cluster states

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    StateDescription
    InitThe node cluster has been created and has no deployed containers yet. Possible actions in this state: deploy, terminate.
    DeployingAll nodes in the cluster are either deployed or being deployed. No actions allowed in this state.
    DeployedAll nodes in the cluster are deployed and provisioned. Possible actions in this state: terminate.
    Partly deployedOne or more nodes of the cluster are deployed and running. Possible actions in this state: terminate.
    ScalingThe cluster is either deploying new nodes or terminating existing ones responding to a scaling request. No actions allowed in this state.
    TerminatingAll nodes in the cluster are either being terminated or already terminated. No actions allowed in this state.
    TerminatedThe node cluster and all its nodes have been terminated. No actions allowed in this state.
    Empty clusterThere are no nodes deployed in this cluster. Possible actions in this state: terminate.
    + +

    Provider options

    + +

    You can specify the following options when using the Amazon Web Services provider:

    + +
      +
    • vpc: VPC-related options (optional) + +
        +
      • id: AWS VPC identifier of the target VPC where the nodes of the cluster will be deployed (required)
      • +
      • subnets: a list of target subnet indentifiers inside selected VPC. If you specify more than one subnet, Docker Cloud will balance among all of them following a high-availability schema (optional)
      • +
      • security_groups: the security group that will be applied to every node of the cluster (optional)
      • +
    • +
    • iam: IAM-related options (optional) + +
        +
      • instance_profile_name: name of the instance profile (container for instance an IAM role) to attach to every node of the cluster (required)
      • +
    • +
    + +

    List all node clusters

    +
    import dockercloud
    +
    +nodeclusters = dockercloud.NodeCluster.list()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +nodeclusters, err := dockercloud.ListNodeClusters()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(nodeclusters)
    +
    +
    GET /api/infra/v1/nodecluster/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud nodecluster ls
    +
    + +

    Lists all current and recently terminated node clusters. Returns a list of NodeCluster objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/nodecluster/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidFilter by UUID
    stateFilter by state. Possible values: Init, Deploying, Deployed, Partly deployed, Scaling, Terminating, Terminated, Empty cluster
    nameFilter by node cluster name
    regionFilter by resource URI of the target region
    node_typeFilter by resource URI of the target node type
    + +

    Create a new node cluster

    +
    import dockercloud
    +
    +region = dockercloud.Region.fetch("digitalocean/lon1")
    +node_type = dockercloud.NodeType.fetch("digitalocean/1gb")
    +nodecluster = dockercloud.NodeCluster.create(name="my_cluster", node_type=node_type, region=region, disk=60)
    +nodecluster.save()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +nodecluster, err := dockercloud.CreateNodeCluster(dockercloud.NodeCreateRequest{Name: "my_cluster", Region: "/api/infra/v1/region/digitalocean/lon1/", NodeType: "/api/infra/v1/nodetype/digitalocean/1gb/", Target_num_nodes: 2})
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(nodecluster)
    +
    +
    POST /api/infra/v1/nodecluster/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +Content-Type: application/json
    +
    +{"name": "my_cluster", "region": "/api/infra/v1/region/digitalocean/lon1/", "node_type": "/api/infra/v1/nodetype/digitalocean/1gb/", "disk": 60}
    +
    +
    docker-cloud nodecluster create my_cluster digitalocean lon1 1gb
    +
    + +

    Creates a new node cluster without deploying it.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/infra/v1/nodecluster/

    + +

    JSON Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    name(required) A user provided name for the node cluster
    node_type(required) The resource URI of the node type to be used for the node cluster
    region(required) The resource URI of the region where the node cluster is to be deployed
    disk(optional) The size of the volume to create where images and containers will be stored, in GB (default: 60). Not available for Digital Ocean. To create Softlayer nodes you must select one of the following sizes (in GBs): 10, 20, 25, 30, 40, 50, 75, 100, 125, 150, 175, 200, 250, 300, 350, 400, 500, 750, 1000, 1500 or 2000
    nickname(optional) A user-friendly name for the node cluster (name by default)
    target_num_nodes(optional) The desired number of nodes for the node cluster (default: 1)
    tags(optional) List of tags of the node cluster to be used when deploying services see Tags for more information) (default: [])
    provider_optionsProvider-specific extra options for the deployment of the node (see table Provider options above for more information)
    + +

    Get an existing node cluster

    +
    import dockercloud
    +
    +service = dockercloud.NodeCluster.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +nodecluster, err := dockercloud.GetNodeCluster("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(nodecluster)
    +
    +
    GET /api/infra/v1/nodecluster/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud nodecluster inspect 7eaf7fff
    +
    + +

    Get all the details of an specific node cluster

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/nodecluster/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the node cluster to retrieve
    + +

    Deploy a node cluster

    +
    import dockercloud
    +
    +nodecluster = dockercloud.NodeCluster.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +nodecluster.deploy()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +nodecluster, err := dockercloud.GetNodeCluster("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = nodecluster.Deploy(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    POST /api/infra/v1/nodecluster/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/deploy/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    + +

    Deploys and provisions a recently created node cluster in the specified region and cloud provider.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/infra/v1/nodecluster/(uuid)/deploy/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the node cluster to deploy
    + +

    Update an existing node cluster

    +
    import dockercloud
    +
    +nodecluster = dockercloud.NodeCluster.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +nodecluster.target_num_nodes = 3
    +nodecluster.tags.add("tag-1")
    +nodecluster.save()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +nodecluster, err := dockercloud.GetNodeCluster("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = nodecluster.Update(dockercloud.NodeCreateRequest{Target_num_nodes: 4}); err != nil {
    +   log.Println(err)
    +}
    +
    +
    PATCH /api/infra/v1/nodecluster/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +Content-Type: application/json
    +
    +{"target_num_nodes": 3, "tags": [{"name": "tag-1"}]}
    +
    +
    docker-cloud nodecluster scale 7eaf7fff 3
    +docker-cloud tag add -t tag-1 7eaf7fff
    +docker-cloud tag set -t tag-2 7eaf7fff
    +
    + +

    Updates the node cluster details and applies the changes automatically.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    PATCH /api/infra/v1/nodecluster/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the node cluster to update
    + +

    JSON Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    target_num_nodes(optional) The number of nodes to scale this node cluster to
    tags(optional) List of tags the node cluster (and nodes within the node cluster) will have. This operation replaces the user tag list.
    + +

    Terminate a node cluster

    +
    import dockercloud
    +
    +nodecluster = dockercloud.NodeCluster.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +nodecluster.delete()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +nodecluster, err := dockercloud.GetNodeCluster("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = nodecluster.Terminate(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    DELETE /api/infra/v1/nodecluster/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    dockercloud nodecluster rm 7eaf7fff
    +
    + +

    Terminates all the nodes in a node cluster and the node cluster itself. This is not reversible.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    DELETE /api/infra/v1/nodecluster/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the node cluster to terminate
    + +

    Nodes

    + +

    Node

    + +
    +

    Example

    +
    +
    {
    +    "availability_zone": "/api/infra/v1/az/testing-provider/testing-region/testing-az/",
    +    "cpu": 1,
    +    "current_num_containers": 4,
    +    "deployed_datetime": "Tue, 16 Sep 2014 17:01:15 +0000",
    +    "destroyed_datetime": null,
    +    "disk": 60,
    +    "docker_execdriver": "native-0.2",
    +    "docker_graphdriver": "aufs",
    +    "docker_version": "1.5.0",
    +    "external_fqdn": "fc1a5bb9-user.node.dockerapp.io",
    +    "last_seen": "Thu, 25 Sep 2014 13:14:44 +0000",
    +    "memory": 1792,
    +    "nickname": "fc1a5bb9-user.node.dockerapp.io",
    +    "node_cluster": "/api/infra/v1/nodecluster/d787a4b7-d525-4061-97a0-f423e8f1d229/",
    +    "node_type": "/api/infra/v1/nodetype/testing-provider/testing-type/",
    +    "public_ip": "10.45.2.11",
    +    "region": "/api/infra/v1/region/testing-provider/testing-region/",
    +    "resource_uri": "/api/infra/v1/node/fc1a5bb9-17f5-4819-b667-8c7cd819e949/",
    +    "state": "Deployed",
    +    "tags": [
    +        {"name": "tag_one"},
    +        {"name": "tag-two"}
    +    ],
    +    "tunnel": "https://tunnel01.cloud.docker.com:12345",
    +    "uuid": "fc1a5bb9-17f5-4819-b667-8c7cd819e949"
    +}
    +
    + +

    A node is a virtual machine provided by a cloud provider where containers can be deployed.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    availability_zoneThe resource URI of the availability zone where the node is deployed, if any
    uuidA unique identifier for the node generated automatically on creation
    resource_uriA unique API endpoint that represents the node
    external_fqdnAn automatically generated FQDN for the node. Containers deployed on this node will inherit this FQDN.
    stateThe state of the node. See the below table for a list of possible states.
    node_clusterThe resource URI of the node cluster to which this node belongs to (if applicable)
    node_typeThe resource URI of the node type used for the node
    regionThe resource URI of the region where the node is deployed
    docker_execdriverDocker’s execution driver used in the node
    docker_graphdriverDocker’s storage driver used in the node
    docker_versionDocker’s version used in the node
    cpuNode number of CPUs
    diskNode storage size in GB
    memoryNode memory in MB
    current_num_containersThe actual number of containers deployed in this node
    last_seenDate and time of the last time the node was contacted by Docker Cloud
    public_ipThe public IP allocated to the node
    tunnelIf the node does not accept incoming connections to port 2375, the address of the reverse tunnel to access the docker daemon, or null otherwise
    deployed_datetimeThe date and time when this node cluster was deployed
    destroyed_datetimeThe date and time when this node cluster was terminated (if applicable)
    tagsList of tags to identify the node when deploying services (see Tags for more information)
    nicknameA user-friendly name for the node (external_fqdn by default)
    + +

    Node states

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    StateDescription
    DeployingThe node is being deployed in the cloud provider. No actions allowed in this state.
    DeployedThe node is deployed and provisioned and is ready to deploy containers. Possible actions in this state: terminate, docker-upgrade.
    UnreachableThe node is deployed but Docker Cloud cannot connect to the docker daemon. Possible actions in this state: health-check and terminate.
    UpgradingThe node docker daemon is being upgraded. No actions allowed in this state.
    TerminatingThe node is being terminated in the cloud provider. No actions allowed in this state.
    TerminatedThe node has been terminated and is no longer present in the cloud provider. No actions allowed in this state.
    + +

    Node Last Metric attributes

    + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    cpuCPU percentage usage
    memoryMemory usage in bytes
    diskDisk storage usage in bytes
    + +

    List all nodes

    +
    import dockercloud
    +
    +nodes = dockercloud.Node.list()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +nodeList, err := dockercloud.ListNodes()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(nodeList)
    +
    +
    GET /api/infra/v1/node/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud node ls
    +
    + +

    Lists all current and recently terminated nodes. Returns a list of Node objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/node/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidFilter by UUID
    stateFilter by state. Possible values: Deploying, Deployed, Unreachable, Upgrading, Terminating, Terminated
    node_clusterFilter by resource URI of the target node cluster
    node_typeFilter by resource URI of the target node type
    regionFilter by resource URI of the target region
    docker_versionFilter by Docker engine version running in the nodes
    + +

    Get an existing node

    +
    import dockercloud
    +
    +node = dockercloud.Node.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +node, err := dockercloud.GetNode("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(node)
    +
    +
    GET /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud node inspect 7eaf7fff
    +
    + +

    Get all the details of an specific node

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/infra/v1/node/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the node to retrieve
    + +

    Update a node

    +
    import dockercloud
    +
    +node = dockercloud.Node.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +node.tags.add(["tag-1"])
    +node.save()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +node, err := dockercloud.GetNode("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +if err = node.Update(dockercloud.Node{Tags: []string{ {Name: "tag-1"}}}); err != nil {
    +            log.Println(err)
    +}
    +
    +
    PATCH /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +{"tags": [{"name": "tag-1"}], "nickname": "dev node"}
    +
    +
    docker-cloud tag add -t tag-1 7eaf7fff
    +docker-cloud tag set -t tag-2 7eaf7fff
    +
    + +

    Names the node with a user-friendly name and/or replaces the old tags for the new list provided.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    PATCH /api/infra/v1/node/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the node to retrieve
    + +

    JSON Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    nickname(optional) A user-friendly name for the node (external_fqdn by default)
    tags(optional) List of tags the node will have. This operation replaces the user tag list.
    + +

    Upgrade Docker Daemon

    +
    import dockercloud
    +
    +node = dockercloud.Node.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +node.upgrade_docker()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +node, err := dockercloud.GetNode("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = node.Upgrade(); err != nil {
    +       log.Println(err)
    +   }
    +
    +
    POST /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/docker-upgrade/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud node upgrade 7eaf7fff
    +
    + +

    Upgrades the docker daemon of the node. This will restart your containers on that node. See Docker upgrade for more information.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/infra/v1/node/(uuid)/docker-upgrade/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the node to upgrade
    + +

    Perform a health check of a node

    +
    POST /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/health-check/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    + +

    Tests connectivity between Docker Cloud and the node. Updates the node status to Deployed if the check was successful, or to Unreachable otherwise.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/infra/v1/node/(uuid)/health-check/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the node to perform the health check to
    + +

    Terminate a node

    +
    import dockercloud
    +
    +node = dockercloud.Node.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +node.delete()
    +
    +
    DELETE /api/infra/v1/node/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +node, err := dockercloud.GetNode("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = node.Terminate(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    docker-cloud node rm 7eaf7fff
    +
    + +

    Terminates the specified node.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    DELETE /api/infra/v1/node/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the node to terminate
    + +

    Registries

    + +

    Registry

    + +
    +

    Example

    +
    +
    {
    +  "host": "registry-1.docker.io",
    +  "is_docker_registry": true,
    +  "is_ssl": true,
    +  "name": "Docker Hub",
    +  "port": 443,
    +  "resource_uri": "/api/repo/v1/registry/registry-1.docker.io/",
    +}
    +
    + +

    Represents a registry where repositories are hosted.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    resource_uriA unique API endpoint that represents the registry
    nameHuman-readable name of the registry
    hostFQDN of the registry, i.e. registry-1.docker.io
    is_docker_registryWhether this registry is run by Docker
    is_sslWhether this registry has SSL activated or not
    portThe port number where the registry is listening to
    + +

    List all registries

    +
    GET /api/repo/v1/registry/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    + +

    Lists all current registries. Returns a list of Registry objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/repo/v1/registry/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidFilter by UUID
    nameFilter by registry name
    hostFilter by registry host
    is_docker_registryFilter by whether the registry is run by Docker or not. Possible values: ‘true’ or 'false’
    + +

    Get an existing registry

    +
    GET /api/repo/v1/registry/registry-1.docker.io/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    + +

    Gets all the details of an specific registry

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/v1/registry/(host)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    hostThe host of the registry to retrieve
    + +

    External Repositories

    + +

    External Repository

    + +
    +

    Example

    +
    +
    {
    +  "in_use": false, 
    +  "name": "quay.io/tutum/ubuntu", 
    +  "registry": "/api/repo/v1/registry/quay.io/", 
    +  "resource_uri": "/api/repo/v1/repository/quay.io/tutum/ubuntu/", 
    +}
    +
    + +

    The repository endpoint is used to add and remove existing repositories on third party registries to be used in deployments and builds.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    resource_uriA unique API endpoint that represents the repository
    nameName of the repository, i.e. quay.io/tutum/ubuntu
    in_useIf the image is being used by any of your services
    registryResource URI of the registry where this image is hosted
    + +

    List all external repositories

    +
    import dockercloud
    +
    +repositories = dockercloud.Repository.list()
    +
    +
    GET /api/repo/v1/repository/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +repositoriesList, err := dockercloud.ListRepositories()
    +
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +log.Pringln(repositoriesList)
    +
    +
    docker-cloud repository ls
    +
    + +

    Lists all added repositories from third party registries. Returns a list of Repository objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/repo/v1/repository/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    nameFilter by image name
    registryFilter by resource URI of the target repository registry
    + +

    Add a new external repository

    +
    import dockercloud
    +
    +repository = dockercloud.Repository.create(name="registry.local/user1/image1", username=username, password=password)
    +repository.save()
    +
    +
    POST /api/repo/v1/repository/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +Content-Type: application/json
    +
    +{"name": "registry.local/user1/image1", "username": "username", "password": "password"}
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +image, err := dockercloud.CreateImage(dockercloud.ImageCreateRequest{
    +  Name: "registry.local/user1/image1",
    +  Username: "username",
    +  Password: "password"
    +})
    +
    +
    docker-cloud repository register -u username -p password registry.local/user1/image1
    +
    + +

    Adds an existing repository on a third party registry.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/repo/v1/repository/

    + +

    JSON Parameters

    + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    nameName of the repository, i.e. ‘quay.io/tutum/hello-world’
    usernameUsername to authenticate with the third party registry
    passwordPassword to authenticate with the third party registry
    + +

    Get an external repository details

    +
    import dockercloud
    +
    +repository = dockercloud.Repository.fetch("registry.local/user1/image1")
    +
    +
    GET /api/repo/v1/repository/registry.local/user1/image1/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +repository, err = dockercloud.GetRepository("registry.local/user1/image1")
    +
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +log.Println(repository)
    +
    +
    docker-cloud repository inspect registry.local/user1/image1
    +
    + +

    Gets all the details of an specific repository

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/repo/v1/repository/(name)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    nameThe name of the repository to retrieve
    + +

    Update credentials of an external repository

    +
    import dockercloud
    +
    +repository = dockercloud.Repository.fetch("registry.local/user1/image1")
    +repository.username = "new username"
    +repository.password = "new password"
    +repository.save()
    +
    +
    PATCH /api/repo/v1/repository/registry.local/user1/image1/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +Content-Type: application/json
    +
    +{"username": "username", "password": "password"}
    +
    +
    docker-cloud repository update -n "new username" -p "new password" registry.local/user1/image1
    +
    + +

    Updates the external repository credentials.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    PATCH /api/repo/v1/repository/(name)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    nameThe name of the repository to update
    + +

    JSON Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    usernameUsername to authenticate with the private registry
    passwordPassword to authenticate with the private registry
    + +

    Remove an external repository

    +
    import dockercloud
    +
    +repository = dockercloud.Repository.fetch("registry.local/user1/image1")
    +repository.delete()
    +
    +
    DELETE /api/repo/v1/repository/registry.local/user1/image1/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +repository, err = dockercloud.GetRepository("registry.local/user1/image1")
    +
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +repository.Remove()
    +
    +
    docker-cloud repository rm registry.local/user1/image1
    +
    + +

    Removes the external repository from Docker Cloud. It won’t remove the repository from the third party registry where it’s stored.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    DELETE /api/repo/v1/repository/registry.local/user1/image1/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    nameThe name of the external repository to remove
    + +

    Stacks

    + +

    Stack

    + +
    +

    Example

    +
    +
    {
    +  "deployed_datetime": "Mon, 13 Oct 2014 11:01:43 +0000",
    +  "destroyed_datetime": null,
    +  "nickname": "deployment stack",
    +  "name": "dockercloud-app",
    +  "resource_uri": "/api/app/v1/stack/7fe7ec85-58be-4904-81da-de2219098d7c/",
    +  "services": [
    +    "/api/app/v1/service/09cbcf8d-a727-40d9-b420-c8e18b7fa55b/"
    +  ],
    +  "state": "Running",
    +  "synchronized": true,
    +  "uuid": "09cbcf8d-a727-40d9-b420-c8e18b7fa55b"
    +}
    +
    + +

    A stack is a logical grouping of closely related services, that may be linked with one another.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    uuidA unique identifier for the stack generated automatically on creation
    resource_uriA unique API endpoint that represents the stack
    nameA user provided name for the stack.
    stateThe state of the stack (see table Stack states below)
    synchronizedFlag indicating if the current stack definition is synchronized with their services.
    servicesList of service resource URIs belonging to the stack
    deployed_datetimeThe date and time of the last deployment of the stack (if applicable, null otherwise)
    destroyed_datetimeThe date and time of the terminate operation on the stack (if applicable, null otherwise)
    nicknameA user-friendly name for the stack (name by default)
    + +

    Stack states

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    StateDescription
    Not RunningThe stack has been created and has no deployed services yet. Possible actions in this state: start, terminate.
    StartingAll services for the stack are either starting or already running. No actions allowed in this state.
    RunningAll services for the service are deployed and running. Possible actions in this state: redeploy, terminate.
    Partly runningOne or more services of the stack are deployed and running. Possible actions in this state: redeploy, terminate.
    StoppingAll services for the stack are either stopping or already stopped. No actions allowed in this state.
    StoppedAll services for the service are stopped. Possible actions in this state: start, redeploy, terminate.
    RedeployingThe stack is redeploying all its services with the updated configuration. No actions allowed in this state.
    TerminatingAll services for the stack are either being terminated or already terminated. No actions allowed in this state.
    TerminatedThe stack and all its services have been terminated. No actions allowed in this state.
    + +

    List all stacks

    +
    import dockercloud
    +
    +stacks = dockercloud.Stack.list()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +stackList, err := dockercloud.ListStacks()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(stackList)
    +
    +
    GET /api/app/v1/stack/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud stack ls
    +
    + +

    Lists all current and recently terminated stacks. Returns a list of Stack objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/app/v1/stack/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidFilter by UUID
    nameFilter by stack name
    + +

    Create a new stack

    +
    import dockercloud
    +
    +stack = dockercloud.Stack.create(name="my-new-stack", services=[{"name": "hello-word", "image": "tutum/hello-world", "target_num_containers": 2}])
    +stack.save()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +stack, err := dockercloud.CreateStack(dockercloud.StackCreateRequest{Name: "my-new-stack", Services: []dockercloud.ServiceCreateRequest{ {Image: "tutum/hello-world", Name: "test", Target_num_containers: 2}}})
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(stack)
    +
    +
    POST /api/app/v1/stack/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +Content-Type: application/json
    +
    +{
    +    "name": "my-new-stack",
    +    "services": [
    +        {
    +            "name": "hello-word",
    +            "image": "tutum/hello-world",
    +            "target_num_containers": 2,
    +            "linked_to_service": [
    +                {
    +                    "to_service": "database",
    +                    "name": "DB"
    +                }
    +            ]
    +        },
    +        {
    +            "name": "database",
    +            "image": "tutum/mysql"
    +        }
    +    ]
    +}
    +
    +
    docker-cloud stack create --name hello-world -f docker-compose.yml
    +
    + +

    Creates a new stack without starting it. Note that the JSON syntax is abstracted by both, the Docker Cloud CLI and our UI, in order to use Stack YAML files.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/stack/

    + +

    JSON Parameters

    + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    name(required) A human-readable name for the stack, i.e. my-hello-world-stack
    nickname(optional) A user-friendly name for the stack (name by default)
    services(optional) List of services belonging to the stack. Each service accepts the same parameters as a Create new service operation (default: []) plus the ability to refer “links” and “volumes-from” by the name of another service in the stack (see example).
    + +

    Export an existing stack

    +
    import dockercloud
    +
    +stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
    +stack.export()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = stack.Export(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    GET /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/export/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud stack export 46aca402
    +
    + +

    Get a JSON representation of the stack following the Stack YAML representation.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/app/v1/stack/(uuid)/export/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the stack to retrieve
    + +

    Get an existing stack

    +
    import dockercloud
    +
    +stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(stack)
    +
    +
    GET /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud stack inspect 46aca402-2109-4a70-a378-760cfed43816
    +
    + +

    Get all the details of an specific stack

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/app/v1/stack/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the stack to retrieve
    + +

    Update an existing stack

    +
    import dockercloud
    +
    +stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
    +stack.services = {"services": [{"name": "hello-word", "image": "tutum/hello-world", "target_num_containers": 2}]}
    +stack.save()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = stack.Update(dockercloud.StackCreateRequest{Services: []dockercloud.ServiceCreateRequest{ {Name: "hello-world", Image: "tutum/hello-world", Target_num_containers: 2}}}); err != nil {
    +   log.Println(err)
    +}
    +
    +
    PATCH /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +Content-Type: application/json
    +
    +{
    +    "services": [
    +        {
    +            "name": "hello-word",
    +            "image": "tutum/hello-world",
    +            "target_num_containers": 3,
    +            "linked_to_service": [
    +                {
    +                    "to_service": "database",
    +                    "name": "DB"
    +                }
    +            ]
    +        },
    +        {
    +            "name": "database",
    +            "image": "tutum/mysql"
    +        }
    +    ]
    +}
    +
    +
    docker-cloud stack update -f docker-compose.yml 46aca402
    +
    + +

    Updates the details of every service in the stack.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    PATCH /api/app/v1/stack/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the stack to update
    + +

    JSON Parameters

    + + + + + + + + + + + +
    ParameterDescription
    services(optional) List of services belonging to the stack. Each service accepts the same parameters as a Update an existing service operation (default: []) plus the ability to refer “links” and “volumes-from” by the name of another service in the stack (see example).
    + +

    Stop a stack

    +
    import dockercloud
    +
    +stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
    +stack.stop()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = stack.Stop(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    POST /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/stop/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud stack stop 46aca402-2109-4a70-a378-760cfed43816
    +
    + +

    Stops the services in the stack.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/stack/(uuid)/stop/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the stack to stop
    + +

    Start a stack

    +
    import dockercloud
    +
    +stack = dockercloud.Stack.fetch()
    +stack.start()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = stack.Start(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    POST /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/start/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud stack start 46aca402
    +
    + +

    Starts the services in the stack.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/stack/(uuid)/start/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the stack to start
    + +

    Redeploy a stack

    +
    import dockercloud
    +
    +stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
    +stack.redeploy()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +//Redeploy(dockercloud.ReuseVolumesOption{Reuse: true}) to reuse the existing volumes
    +//Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}) to not reuse the existing volumes
    +if err = stack.Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}); err != nil {
    +   log.Println(err)
    +}
    +
    +
    POST /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/redeploy/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud stack redeploy 46aca402
    +
    + +

    Redeploys all the services in the stack.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/stack/(uuid)/redeploy/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the stack to redeploy
    + +

    Query Parameters

    + + + + + + + + + + + +
    ParameterDescription
    reuse_volumesWheather to reuse container volumes for this redeploy operation or not (default: true).
    + +

    Terminate a stack

    +
    import dockercloud
    +
    +stack = dockercloud.Stack.fetch("46aca402-2109-4a70-a378-760cfed43816")
    +stack.delete()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +stack, err := dockercloud.GetStack("46aca402-2109-4a70-a378-760cfed43816")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = stack.Terminate(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    DELETE /api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud stack terminate 46aca402
    +
    + +

    Terminate all the services in a the stack and the stack itself.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    DELETE /api/app/v1/stack/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the stack to terminate
    + +

    Services

    + +

    Service

    + +
    +

    Example

    +
    +
    {
    +  "autodestroy": "OFF",
    +  "autoredeploy": false,
    +  "autorestart": "ON_FAILURE",
    +  "bindings": [
    +    {
    +        "host_path": null,
    +        "container_path": "/tmp",
    +        "rewritable": true,
    +        "volumes_from": null
    +    },
    +    {
    +        "host_path": "/etc",
    +        "container_path": "/etc",
    +        "rewritable": true,
    +        "volumes_from": null
    +    },
    +    {
    +        "host_path": null,
    +        "container_path": null,
    +        "rewritable": true,
    +        "volumes_from": "/api/app/v1/service/2f4f54e5-9d3b-4ac1-85ad-a2d4ff25a179/"
    +    }
    +  ],
    +  "cap_add": [
    +    "ALL"
    +  ],
    +  "cap_drop": [
    +    "NET_ADMIN",
    +    "SYS_ADMIN"
    +  ],
    +  "container_envvars": [
    +    {
    +      "key": "DB_PASS",
    +      "value": "test"
    +    }
    +  ],
    +  "container_ports": [
    +    {
    +      "endpoint_uri": "http://wordpress-stackable.admin.srv.dockerapp.io:80/",
    +      "inner_port": 80,
    +      "outer_port": 80,
    +      "port_name": "http",
    +      "protocol": "tcp",
    +      "published": true
    +    }
    +  ],
    +  "containers": [
    +    "/api/app/v1/container/6f8ee454-9dc3-4387-80c3-57aac1be3cc6/",
    +    "/api/app/v1/container/fdf9c116-7c08-4a60-b0ce-c54ca72c2f25/"
    +  ],
    +  "cpu_shares": 100,
    +  "cpuset": "0,1",
    +  "cgroup_parent": "m-executor-abcd",
    +  "current_num_containers": 2,
    +  "deployed_datetime": "Mon, 13 Oct 2014 11:01:43 +0000",
    +  "deployment_strategy": "EMPTIEST_NODE",
    +  "destroyed_datetime": null,
    +  "devices": [
    +    "/dev/ttyUSB0:/dev/ttyUSB0"
    +  ],
    +  "dns": [
    +    "8.8.8.8"
    +  ],
    +  "dns_search": [
    +    "example.com"
    +  ],
    +  "domainname": "domainname",
    +  "entrypoint": "",
    +  "extra_hosts": [
    +    "onehost:50.31.209.229"
    +  ],
    +  "hostname": "hostname",
    +  "image_name": "tutum/wordpress-stackable:latest",
    +  "nickname": "wordpress-stackable",
    +  "labels": {
    +    "com.example.description": "Accounting webapp",
    +    "com.example.department": "Finance",
    +    "com.example.label-with-empty-value": ""
    +  },
    +  "link_variables": {
    +    "WORDPRESS_STACKABLE_1_ENV_DB_HOST": "**LinkMe**",
    +    "WORDPRESS_STACKABLE_1_ENV_DB_NAME": "wordpress",
    +    "WORDPRESS_STACKABLE_1_ENV_DB_PASS": "szVaPz925B7I",
    +    "WORDPRESS_STACKABLE_1_ENV_DB_PORT": "**LinkMe**",
    +    "WORDPRESS_STACKABLE_1_ENV_DB_USER": "admin",
    +    "WORDPRESS_STACKABLE_1_ENV_DEBIAN_FRONTEND": "noninteractive",
    +    "WORDPRESS_STACKABLE_1_ENV_HOME": "/",
    +    "WORDPRESS_STACKABLE_1_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    +    "WORDPRESS_STACKABLE_1_PORT": "tcp://wordpress-stackable-1.admin.cont.dockerapp.io:49153",
    +    "WORDPRESS_STACKABLE_1_PORT_80_TCP": "tcp://wordpress-stackable-1.admin.cont.dockerapp.io:49153",
    +    "WORDPRESS_STACKABLE_1_PORT_80_TCP_ADDR": "wordpress-stackable-1.admin.cont.dockerapp.io",
    +    "WORDPRESS_STACKABLE_1_PORT_80_TCP_PORT": "49153",
    +    "WORDPRESS_STACKABLE_1_PORT_80_TCP_PROTO": "tcp",
    +    "WORDPRESS_STACKABLE_2_ENV_DB_HOST": "**LinkMe**",
    +    "WORDPRESS_STACKABLE_2_ENV_DB_NAME": "wordpress",
    +    "WORDPRESS_STACKABLE_2_ENV_DB_PASS": "szVaPz925B7I",
    +    "WORDPRESS_STACKABLE_2_ENV_DB_PORT": "**LinkMe**",
    +    "WORDPRESS_STACKABLE_2_ENV_DB_USER": "admin",
    +    "WORDPRESS_STACKABLE_2_ENV_DEBIAN_FRONTEND": "noninteractive",
    +    "WORDPRESS_STACKABLE_2_ENV_HOME": "/",
    +    "WORDPRESS_STACKABLE_2_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    +    "WORDPRESS_STACKABLE_2_PORT": "tcp://wordpress-stackable-2.admin.cont.dockerapp.io:49154",
    +    "WORDPRESS_STACKABLE_2_PORT_80_TCP": "tcp://wordpress-stackable-2.admin.cont.dockerapp.io:49154",
    +    "WORDPRESS_STACKABLE_2_PORT_80_TCP_ADDR": "wordpress-stackable-2.admin.cont.dockerapp.io",
    +    "WORDPRESS_STACKABLE_2_PORT_80_TCP_PORT": "49154",
    +    "WORDPRESS_STACKABLE_2_PORT_80_TCP_PROTO": "tcp",
    +    "WORDPRESS_STACKABLE_ENV_DB_HOST": "**LinkMe**",
    +    "WORDPRESS_STACKABLE_ENV_DB_NAME": "wordpress",
    +    "WORDPRESS_STACKABLE_ENV_DB_PASS": "szVaPz925B7I",
    +    "WORDPRESS_STACKABLE_ENV_DB_PORT": "**LinkMe**",
    +    "WORDPRESS_STACKABLE_ENV_DB_USER": "admin",
    +    "WORDPRESS_STACKABLE_ENV_DEBIAN_FRONTEND": "noninteractive",
    +    "WORDPRESS_STACKABLE_ENV_HOME": "/",
    +    "WORDPRESS_STACKABLE_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    +    "WORDPRESS_STACKABLE_PORT": "tcp://wordpress-stackable-1.admin.cont.dockerapp.io:49153",
    +    "WORDPRESS_STACKABLE_PORT_80_TCP": "tcp://wordpress-stackable-1.admin.cont.dockerapp.io:49153",
    +    "WORDPRESS_STACKABLE_PORT_80_TCP_ADDR": "wordpress-stackable-1.admin.cont.dockerapp.io",
    +    "WORDPRESS_STACKABLE_PORT_80_TCP_PORT": "49153",
    +    "WORDPRESS_STACKABLE_PORT_80_TCP_PROTO": "tcp",
    +    "WORDPRESS_STACKABLE_DOCKERCLOUD_API_URL": "https://cloud.docker.com/api/app/v1/service/adeebc1b-1b81-4af0-b8f2-cefffc69d7fb/"
    +  },
    +  "linked_from_service": [],
    +  "linked_to_service": [
    +    {
    +      "from_service": "/api/app/v1/service/09cbcf8d-a727-40d9-b420-c8e18b7fa55b/",
    +      "name": "DB",
    +      "to_service": "/api/app/v1/service/72f175bd-390b-46e3-9463-830aca32ce3e/"
    +    }
    +  ],
    +  "mac_address": "02:42:ac:11:65:43",
    +  "memory": 2048,
    +  "memory_swap": 8192,
    +  "name": "wordpress-stackable",
    +  "net": "bridge",
    +  "privileged": false,
    +  "public_dns": "wordpress-stackable.admin.svc.dockerapp.io",
    +  "read_only": true,
    +  "resource_uri": "/api/app/v1/service/09cbcf8d-a727-40d9-b420-c8e18b7fa55b/",
    +  "roles": ["global"],
    +  "run_command": "/run-wordpress.sh",
    +  "running_num_containers": 1,
    +  "security_opt": [
    +  ],
    +  "sequential_deployment": false,
    +  "started_datetime": "Mon, 13 Oct 2014 11:01:43 +0000",
    +  "state": "Partly running",
    +  "stack": "/api/app/v1/stack/46aca402-2109-4a70-a378-760cfed43816/",
    +  "stdin_open": false,
    +  "stopped_datetime": null,
    +  "stopped_num_containers": 0,
    +  "synchronized": true,
    +  "tags": [
    +        {"name": "tag_one"},
    +        {"name": "tag-two"},
    +        {"name": "tagthree3"}
    +  ],
    +  "target_num_containers": 2,
    +  "tty": false,
    +  "user": "root",
    +  "uuid": "09cbcf8d-a727-40d9-b420-c8e18b7fa55b",
    +  "working_dir": "/app"
    +}
    +
    + +

    A service is a template used to deploy one or more containers.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    uuidA unique identifier for the service generated automatically on creation
    resource_uriA unique API endpoint that represents the service
    image_nameThe Docker image name and tag used for the service containers
    nameA user provided name for the service. This name will be inherited by the service containers and will be used in endpoint URLs, environment variable names, etc.
    public_dnsAn external FQDN that resolves to all IPs of the nodes where the service containers are running on (as an A record with multiple IP entries which will be used by clients in a round-robin fashion). If the service is not publishing any ports, this FQDN will fail to resolve.
    stateThe state of the service (see table Service states below)
    netNetwork mode to set on the containers (see table Network Modes below, more information ../../docker-cloud/apps/service-links/)
    pidSet the PID (Process) Namespace mode for the containers (more information ../../reference/run/#pid-settings-pid)
    synchronizedFlag indicating if the current service definition is synchronized with the current containers.
    deployed_datetimeThe date and time of the last deployment of the service (if applicable, null otherwise)
    started_datetimeThe date and time of the last start operation on the service (if applicable, null otherwise)
    stopped_datetimeThe date and time of the last stop operation on the service (if applicable, null otherwise)
    destroyed_datetimeThe date and time of the terminate operation on the service (if applicable, null otherwise)
    target_num_containersThe requested number of containers to deploy for the service
    current_num_containersThe actual number of containers deployed for the service
    running_num_containersThe actual number of containers deployed for the service in Running state
    stopped_num_containersThe actual number of containers deployed for the service in Stopped state
    stackResource URIs of the stack that the service belongs to
    containersList of resource URIs of the containers launched as part of the service
    container_portsList of ports to be published on the containers of this service (see table Service Port attributes below)
    container_envvarsList of user-defined environment variables to set on the containers of the service, which will override the image environment variables (see table Service Environment Variable attributes below)
    labelsMetadata in form of dictionary used for every container of this service
    working_dirWorking directory for running binaries within a container of this service
    userSet the user used on containers of this service (root by default)
    hostnameSet the hostname used on containers of this service
    domainnameSet the domainname used on containers of this service
    mac_addressEthernet device’s MAC address used on containers of this service
    cgroup_nameOptional parent cgroup used on containers of this service.
    ttyIf the containers of this service have the tty enable (false by default)
    stdin_openIf the containers of this service have stdin opened (false by default)
    dnsCustom DNS servers for containers of this service
    dns_searchCustom DNS search domain for containers of this service
    cap_addAdded capabilities for containers of this service
    cap_dropDropped capabilities for containers of this service
    devicesList of device mappings for containers of this service
    extra_hostsList of hostname mappings for containers of this service
    secuirty_optLabeling scheme for containers of this service
    entrypointEntrypoint to be set on the containers launched as part of the service, which will override the image entrypoint
    run_commandRun command to be set on the containers launched as part of the service, which will override the image run command
    sequential_deploymentWhether the containers for this service should be deployed in sequence, linking each of them to the previous containers (see Service scaling for more information)
    cpu_sharesThe relative CPU priority of the containers of the service (see Runtime Constraints on CPU and Memory for more information)
    cpusetCPUs in which to allow execution
    memoryThe memory limit of the containers of the service in MB (see Runtime Constraints on CPU and Memory for more information)
    memory_swapTotal memory limit (memory + swap) of the containers of the service in MB
    linked_from_serviceA list of services that are linked to this one (see table Related services attributes below)
    linked_to_serviceA list of services that the service is linked to (see table Related services attributes below)
    bindingsA list of volume bindings that the service has mounted (see table Service binding attributes below)
    autorestartWhether to restart the containers of the service automatically if they stop (see Crash recovery for more information)
    autodestroyWhether to terminate the containers of the service automatically if they stop (see Autodestroy for more information)
    rolesList of Docker Cloud roles assigned to this service (see Service links for more information)
    link_variablesList of environment variables that would be exposed in the containers if they are linked to this service
    privilegedWhether to start the containers with Docker’s privileged flag set or not, which allows containers to access all devices on the host among other things (see Runtime privilege for more information)
    read_onlyWhether the filesystem of every service container is read-only or not (false by default)
    deployment_strategyContainer distribution among nodes (see table Deployment strategies below and Deployment strategies for more information)
    tagsList of tags to be used to deploy the service (see Tags for more information)
    autoredeployWhether to redeploy the containers of the service when its image is updated in Docker Cloud registry (see Docker Cloud’s private registry for more information)
    nicknameA user-friendly name for the service (name by default)
    + +

    Service binding attributes

    + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    host_pathThe host path of the volume
    container_pathThe container path where the volume is mounted
    rewritabletrue is the volume has writable permissions
    volumes_fromThe resource URI of the service
    + +

    Service Port attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    protocolThe protocol of the port, either tcp or udp
    inner_portThe published port number inside the container
    outer_portThe published port number in the node public network interface
    port_nameName of the service associated to this port
    endpoint_uriThe URI of the service endpoint for this port
    publishedWhether the port has been published in the host public network interface or not. Non-published ports can only be accessed via links.
    + +

    Service Environment Variable attributes

    + + + + + + + + + + + + + + + +
    AttributeDescription
    keyThe name of the environment variable
    valueThe value of the environment variable
    + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    nameThe link name
    from_serviceThe resource URI of the origin of the link
    to_serviceThe resource URI of the target of the link
    + +

    Service states

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    StateDescription
    Not runningThe service has been created and has no deployed containers yet. Possible actions in this state: start, terminate.
    StartingAll containers for the service are either starting or already running. No actions allowed in this state.
    RunningAll containers for the service are deployed and running. Possible actions in this state: stop, redeploy, terminate.
    Partly runningOne or more containers of the service are deployed and running. Possible actions in this state: stop, redeploy, terminate.
    ScalingThe service is either deploying new containers or destroying existing ones responding to a scaling request. No actions allowed in this state.
    RedeployingThe service is redeploying all its containers with the updated configuration. No actions allowed in this state.
    StoppingAll containers for the service are either stopping or already stopped. No actions allowed in this state.
    StoppedAll containers for the service are stopped. Possible actions in this state: start, redeploy, terminate.
    TerminatingAll containers for the service are either being terminated or already terminated. No actions allowed in this state.
    TerminatedThe service and all its containers have been terminated. No actions allowed in this state.
    + +

    Deployment strategies

    + + + + + + + + + + + + + + + + + + + +
    StrategyDescription
    EMPTIEST_NODEIt will deploy containers to the node with the lower total amount of running containers (default).
    HIGH_AVAILABILITYIt will deploy containers to the node with the lower amount of running containers of the same service.
    EVERY_NODEIt will deploy one container on every node. The service won’t be able to scale manually. New containers will be deployed to new nodes automatically.
    + +

    Network Modes

    + + + + + + + + + + + + + + + +
    StrategyDescription
    bridgeCreates a new network stack for the container on the docker bridge.
    hostUses the host network stack inside the container.
    + +

    List all services

    +
    import dockercloud
    +
    +services = dockercloud.Service.list()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +serviceList, err := dockercloud.ListServices()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(serviceList)
    +
    +
    GET /api/app/v1/service/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud service ps
    +
    + +

    Lists all current and recently terminated services. Returns a list of Service objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/app/v1/service/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidFilter by UUID
    stateFilter by state. Possible values: Not running, Starting, Running, Partly running, Scaling, Redeploying, Stopping, Stopped, Terminating, Terminated
    nameFilter by service name
    stackFilter by resource URI of the target stack.
    + +

    Create a new service

    +
    import dockercloud
    +
    +service = dockercloud.Service.create(image="tutum/hello-world", name="my-new-app", target_num_containers=2)
    +service.save()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.CreateService(dockercloud.ServiceCreateRequest{Image: "tutum/hello-world",  Name: "my-new-app", Target_num_containers: 2})
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(service)
    +
    +
    POST /api/app/v1/service/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +Content-Type: application/json
    +
    +{"image": "tutum/hello-world", "name": "my-new-app", "target_num_containers": 2}
    +
    +
    docker-cloud service create -t 2 --name my-new-app tutum/hello-world
    +
    + +

    Creates a new service without starting it.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/service/

    + +

    JSON Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    image(required) The image used to deploy this service in docker format, i.e. tutum/hello-world
    name(optional) A human-readable name for the service, i.e. my-hello-world-app (default: image without namespace)
    target_num_containers(optional) The number of containers to run for this service initially (default: 1)
    run_command(optional) The command used to start the containers of this service, overriding the value specified in the image, i.e. /run.sh (default: null)
    entrypoint(optional) The command prefix used to start the containers of this service, overriding the value specified in the image, i.e. /usr/sbin/sshd (default: null)
    container_ports(optional) An array of objects with port information to be published in the containers for this service, which will be added to the image port information, i.e. [{"protocol": "tcp", "inner_port": 80, "outer_port": 80}] (default: []) (See table Service Port attributes below)
    container_envvars(optional) An array of objects with environment variables to be added in the service containers on launch (overriding any image-defined environment variables), i.e. [{"key": "DB_PASSWORD", "value": "mypass"}] (default: []) (See table Service Environment Variable attributes below)
    linked_to_service(optional) An array of service resource URIs to link this service to, including the link name, i.e. [{"to_service": "/api/app/v1/service/80ff1635-2d56-478d-a97f-9b59c720e513/", "name": "db"}] (default: []) (See table Related services attributes below)
    bindings(optional) An array of bindings this service has to mount, i.e. [{"volumes_from": "/api/app/v1/service/80ff1635-2d56-478d-a97f-9b59c720e513/", "rewritable": true}] (default: []) (See table Related bindings attributes below)
    autorestart(optional) Whether the containers for this service should be restarted if they stop, i.e. ALWAYS (default: OFF, possible values: OFF, ON_FAILURE, ALWAYS) (see Crash recovery for more information)
    autodestroy(optional) Whether the containers should be terminated if they stop, i.e. OFF (default: OFF, possible values: OFF, ON_SUCCESS, ALWAYS) (see Autodestroy for more information)
    sequential_deployment(optional) Whether the containers should be launched and scaled in sequence, i.e. true (default: false) (see Service scaling for more information)
    roles(optional) A list of Docker Cloud API roles to grant the service, i.e. ["global"] (default: [], possible values: global) (see Service links for more information)
    privileged(optional) Whether to start the containers with Docker’s privileged flag set or not, i.e. false (default: false) (see Runtime privilege for more information)
    deployment_strategy(optional) Container distribution among nodes (default: EMPTIEST_NODE, see table Deployment strategies above and Deployment strategies for more information)
    tags(optional) A list of tags to be used to deploy the service (see Tags for more information) (default: [])
    autoredeploy(optional) Whether to redeploy the containers of the service when its image is updated in Docker Cloud registry (default: false) (see Docker Cloud’s private registry for more information)
    net(optional) Set the network mode to the containers (default: bridge, possible values: bridge, host)
    pid(optional) Set the PID (Process) Namespace mode for the containers (default: none value, possible values: none, host)
    working_dir(optional) Working directory for running binaries within a container of this service (default: /)
    nickname(optional) A user-friendly name for the service (name by default)
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    host_path(optional) The host path of the volume
    container_path(required if volumes_from is omitted) The container path where the volume is mounted
    rewritable(optional) true is the volume has writable permissions (default: true)
    volumes_from(required if container_path is omitted) The resource URI of the service
    + +

    Service Port attributes

    + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    protocol(required) The protocol of the port, either tcp or udp
    inner_port(required) The port number inside the container to be published
    outer_port(optional) The port number in the node public network interface to be published (default: dynamic allocation if published is true)
    published(optional) Whether to publish the port in the host public network interface or not. Non-published ports can only be accessed via links. (default: false)
    + +

    Service Environment Variable attributes

    + + + + + + + + + + + + + + + +
    AttributeDescription
    key(required) The name of the environment variable
    value(required) The value of the environment variable
    + + + + + + + + + + + + + + + + + +
    AttributeDescription
    to_service(required) The resource URI of the target of the link
    name(optional) The link name
    + +

    Get an existing service

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(service)
    +
    +
    GET /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud service inspect 7eaf7fff
    +
    + +

    Get all the details of an specific service

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/app/v1/service/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service to retrieve
    + +

    Get the logs of a service

    + +
    +

    Example log line

    +
    +
    {
    +    "type": "log",
    +    "source": "wordpress-stackable-1",
    +    "log": "Log line from the container indicated by 'source'",
    +    "streamType": "stdout",
    +    "timestamp": 1433779324
    +}
    +
    +
    import dockercloud
    +
    +def log_handler(message):
    +    print message
    +
    +service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +service.logs(tail=300, follow=True, log_handler=log_handler)
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +c := make(chan Logs)
    +
    +go service.Logs(c)
    +    for {
    +        s := <-c
    +        log.Println(s)
    +    }
    +
    +
    GET /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/logs/ HTTP/1.1
    +Host: ws.cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Connection: Upgrade
    +Upgrade: websocket
    +
    +
    docker-cloud service logs 7eaf7fff
    +
    + +

    Get the aggregated logs of all the containers of the service.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s STREAM API

    + +

    HTTP Request

    + +

    GET /api/app/v1/service/(uuid)/logs/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service to retrieve logs
    + +

    Query Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    tailNumber of lines to show from the end of the logs (default: 300)
    followWhether to stream logs or close the connection immediately (default: true)
    + +

    Update an existing service

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +service.target_num_containers = 3
    +service.tags.append({"name":"tag-1"})
    +service.save()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = service.Update(dockercloud.ServiceCreateRequest{Target_num_containers: 3}); err != nil {
    +   log.Println(err)
    +}
    +
    +
    PATCH /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +Content-Type: application/json
    +
    +{"autorestart": "ON_FAILURE", "autodestroy": "OFF", "container_envvars": [{"key": "DB_PASSWORD", "value": "mypass"}],
    +"container_ports": [{"protocol": "tcp", "inner_port": 80, "outer_port": 80}], "cpu_shares": 512,
    +"entrypoint": "/usr/sbin/sshd", "image": "tutum/hello-world",
    +"linked_to_service": [{"to_service": "/api/app/v1/service/80ff1635-2d56-478d-a97f-9b59c720e513/", "name": "db"}],
    +"memory": 2048, "privileged": True, "roles": ["global"], "run_command": "/run.sh", "sequential_deployment": False,
    +"tags": [{"name": "tag-1"}], "target_num_containers": 3, "autoredeploy": False}
    +
    +
    +
    docker-cloud service scale 7eaf7fff 3
    +docker-cloud tag add -t tag-1 7eaf7fff
    +docker-cloud tag set -t tag-2 7eaf7fff
    +
    + +

    Updates the service details.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    PATCH /api/app/v1/service/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service to update
    + +

    JSON Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    autorestart(optional) Whether the containers for this service should be restarted if they stop, i.e. ALWAYS (possible values: OFF, ON_FAILURE, ALWAYS) (see Crash recovery for more information)
    autodestroy(optional) Whether the containers should be terminated if they stop, i.e. OFF (possible values: OFF, ON_SUCCESS, ALWAYS) (see Autodestroy for more information)
    container_envvars(optional) An array of objects with environment variables to be added in the service containers on launch (overriding any image-defined environment variables), i.e. [{"key": "DB_PASSWORD", "value": "mypass"}] (See table Service Environment Variable attributes)
    container_ports(optional) An array of objects with port information to be published in the containers for this service, which will be added to the image port information, i.e. [{"protocol": "tcp", "inner_port": 80, "outer_port": 80}] (See table Service Port attributes)
    cpu_shares(optional) The relative CPU priority of the containers the service describes (see Runtime Constraints on CPU and Memory for more information)
    entrypoint(optional) The command prefix used to start the containers of this service, overriding the value specified in the image, i.e. /usr/sbin/sshd
    image(optional) The image used to deploy this service in docker format, i.e. tutum/hello-world, tutum/ubuntu:5.6. If no tag is indicated, it will be set to latest by default
    linked_to_service(optional) An array of service resource URIs to link this service to, including the link name, i.e. [{"to_service": "/api/app/v1/service/80ff1635-2d56-478d-a97f-9b59c720e513/", "name": "db"}] (See table Related services attributes below)
    memory(optional) The memory limit of the containers of the service in MB (see Runtime Constraints on CPU and Memory for more information)
    privileged(optional) Whether to start the containers with Docker’s privileged flag set or not, i.e. false (see Runtime privilege for more information)
    roles(optional) A list of Docker Cloud API roles to grant the service, i.e. ["global"] (possible values: global) (see Service links for more information)
    run_command(optional) The command used to start the containers of this service, overriding the value specified in the image, i.e. /run.sh
    sequential_deployment(optional) Whether the containers should be launched and scaled in sequence, i.e. true (see Service scaling for more information)
    tags(optional) List of new tags the service will have. This operation replaces the tag list
    target_num_containers(optional) The number of containers to scale this service to
    deployment_strategy(optional) Container distribution among nodes. A service cannot be updated to or from a deployment strategy of EVERY_NODE. (See table Deployment strategies above and Deployment strategies for more information)
    autoredeployWhether to redeploy the containers of the service when its image is updated in Docker Cloud registry (see Docker Cloud’s private registry for more information)
    net(optional) Set the network mode to the containers (default: bridge, possible values: bridge, host)
    pid(optional) Set the PID (Process) Namespace mode for the containers (default: none value, possible values: none, host)
    working_dir(optional) Working directory for running binaries within a container of this service (default: /)
    nickname(optional) A user-friendly name for the service (name by default)
    + +

    Start a service

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +service.start()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = service.Start(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    POST /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/start/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud service start 7eaf7fff
    +
    + +

    Starts all containers in a stopped or partly running service.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/service/(uuid)/start/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service to start
    + +

    Stop a service

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +service.stop()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = service.Stop(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    POST /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/stop/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud service stop 7eaf7fff
    +
    + +

    Stops all containers in a running or partly running service.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/service/(uuid)/stop/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service to stop
    + +

    Scale a service

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +service.target_num_containers = 3
    +service.save()
    +service.scale()
    +
    +
    POST /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/scale/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud service scale 7eaf7fff-882c-4f3d-9a8f-a22317ac00ce 3
    +
    + +

    Scales the service to its current target_num_containers field.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/service/(uuid)/scale/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service to scale
    + +

    Redeploy a service

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +service.redeploy()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +//Redeploy(dockercloud.ReuseVolumesOption{Reuse: true}) to reuse the existing volumes
    +//Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}) to not reuse the existing volumes
    +if err = service.Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}); err != nil {
    +   log.Println(err)
    +}
    +
    +
    POST /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/redeploy/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud service redeploy 7eaf7fff
    +
    + +

    Redeploys all containers in the service with the current service configuration.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/service/(uuid)/redeploy/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service to redeploy
    + +

    Query Parameters

    + + + + + + + + + + + +
    ParameterDescription
    reuse_volumesWheather to reuse container volumes for this redeploy operation or not (default: true).
    + +

    Terminate a service

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +service.delete()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +if err = service.Terminate(); err != nil {
    +   log.Println(err)
    +}
    +
    +
    DELETE /api/app/v1/service/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud service terminate 7eaf7fff
    +
    + +

    Terminate all the containers in a service and the service itself. This is not reversible. All the data stored in all containers of the service will be permanently deleted.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    DELETE /api/app/v1/service/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service to terminate
    + +

    Containers

    + +

    Container

    + +
    +

    Example

    +
    +
    {
    +    "autodestroy": "OFF",
    +    "autorestart": "OFF",
    +    "bindings": [
    +        {
    +            "volume": "/api/infra/v1/volume/1863e34d-6a7d-4945-aefc-8f27a4ab1a9e/",
    +            "host_path": null,
    +            "container_path": "/data",
    +            "rewritable": true
    +        },
    +        {
    +            "volume": null,
    +            "host_path": "/etc",
    +            "container_path": "/etc",
    +            "rewritable": true
    +        }
    +    ],
    +    "cap_add": [
    +        "ALL"
    +    ],
    +    "cap_drop": [
    +        "NET_ADMIN",
    +        "SYS_ADMIN"
    +    ],
    +    "container_envvars": [
    +        {
    +            "key": "DB_1_ENV_DEBIAN_FRONTEND",
    +            "value": "noninteractive"
    +        },
    +        {
    +            "key": "DB_1_ENV_MYSQL_PASS",
    +            "value": "**Random**"
    +        },
    +        {
    +            "key": "DB_1_ENV_MYSQL_USER",
    +            "value": "admin"
    +        },
    +        {
    +            "key": "DB_1_ENV_PATH",
    +            "value": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    +        },
    +        {
    +            "key": "DB_1_ENV_REPLICATION_MASTER",
    +            "value": "**False**"
    +        },
    +        {
    +            "key": "DB_1_ENV_REPLICATION_PASS",
    +            "value": "replica"
    +        },
    +        {
    +            "key": "DB_1_ENV_REPLICATION_SLAVE",
    +            "value": "**False**"
    +        },
    +        {
    +            "key": "DB_1_ENV_REPLICATION_USER",
    +            "value": "replica"
    +        },
    +        {
    +            "key": "DB_1_PORT",
    +            "value": "tcp://172.16.0.3:3306"
    +        },
    +        {
    +            "key": "DB_1_PORT_3306_TCP",
    +            "value": "tcp://172.16.0.3:3306"
    +        },
    +        {
    +            "key": "DB_1_PORT_3306_TCP_ADDR",
    +            "value": "172.16.0.3"
    +        },
    +        {
    +            "key": "DB_1_PORT_3306_TCP_PORT",
    +            "value": "3306"
    +        },
    +        {
    +            "key": "DB_1_PORT_3306_TCP_PROTO",
    +            "value": "tcp"
    +        },
    +        {
    +            "key": "DB_ENV_DEBIAN_FRONTEND",
    +            "value": "noninteractive"
    +        },
    +        {
    +            "key": "DB_ENV_MYSQL_PASS",
    +            "value": "**Random**"
    +        },
    +        {
    +            "key": "DB_ENV_MYSQL_USER",
    +            "value": "admin"
    +        },
    +        {
    +            "key": "DB_ENV_PATH",
    +            "value": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    +        },
    +        {
    +            "key": "DB_ENV_REPLICATION_MASTER",
    +            "value": "**False**"
    +        },
    +        {
    +            "key": "DB_ENV_REPLICATION_PASS",
    +            "value": "replica"
    +        },
    +        {
    +            "key": "DB_ENV_REPLICATION_SLAVE",
    +            "value": "**False**"
    +        },
    +        {
    +            "key": "DB_ENV_REPLICATION_USER",
    +            "value": "replica"
    +        },
    +        {
    +            "key": "DB_PASS",
    +            "value": "szVaPz925B7I"
    +        },
    +        {
    +            "key": "DB_PORT",
    +            "value": "tcp://172.16.0.3:3306"
    +        },
    +        {
    +            "key": "DB_PORT_3306_TCP",
    +            "value": "tcp://172.16.0.3:3306"
    +        },
    +        {
    +            "key": "DB_PORT_3306_TCP_ADDR",
    +            "value": "172.16.0.3"
    +        },
    +        {
    +            "key": "DB_PORT_3306_TCP_PORT",
    +            "value": "3306"
    +        },
    +        {
    +            "key": "DB_PORT_3306_TCP_PROTO",
    +            "value": "tcp"
    +        },
    +        {
    +            "key": "DB_DOCKERCLOUD_API_URL",
    +            "value": "https://cloud.docker.com/api/app/v1/service/c0fed1dc-c528-40c9-aa4c-dc00672ebcbf/"
    +        }
    +    ],
    +    "container_ports": [
    +        {
    +            "endpoint_uri": "http://wordpress-stackable-1.admin.cont.dockerapp.io:49153/",
    +            "inner_port": 80,
    +            "outer_port": 49153,
    +            "port_name": "http",
    +            "protocol": "tcp",
    +            "published": true,
    +            "uri_protocol": "http"
    +        }
    +    ],
    +    "cpu_shares": 100,
    +    "cpuset": "0,1",
    +    "cgroup_parent": "m-executor-abcd",
    +    "deployed_datetime": "Thu, 16 Oct 2014 12:04:08 +0000",
    +    "destroyed_datetime": null,
    +    "devices": [
    +        "/dev/ttyUSB0:/dev/ttyUSB0"
    +    ],
    +    "dns": [
    +        "8.8.8.8"
    +    ],
    +    "dns_search": [
    +        "example.com",
    +        "c1dd4e1e-1356-411c-8613-e15146633640.local.dockerapp.io"
    +    ],
    +    "domainname": "domainname",
    +    "entrypoint": "",
    +    "exit_code": null,
    +    "exit_code_msg": null,
    +    "extra_hosts": [
    +        "onehost:50.31.209.229"
    +    ],
    +    "hostname": "hostname",
    +    "image_name": "tutum/wordpress-stackable:latest",
    +    "labels": {
    +        "com.example.description": "Accounting webapp",
    +        "com.example.department": "Finance",
    +        "com.example.label-with-empty-value": ""
    +    },
    +    "linked_to_container": [
    +        {
    +            "endpoints": {
    +                "3306/tcp": "tcp://172.16.0.3:3306"
    +            },
    +            "from_container": "/api/app/v1/container/c1dd4e1e-1356-411c-8613-e15146633640/",
    +            "name": "DB_1",
    +            "to_container": "/api/app/v1/container/ba434e1e-1234-411c-8613-e15146633640/"
    +        }
    +    ],
    +    "link_variables": {
    +        "WORDPRESS_STACKABLE_1_ENV_DB_HOST": "**LinkMe**",
    +        "WORDPRESS_STACKABLE_1_ENV_DB_NAME": "wordpress",
    +        "WORDPRESS_STACKABLE_1_ENV_DB_PASS": "szVaPz925B7I",
    +        "WORDPRESS_STACKABLE_1_ENV_DB_PORT": "**LinkMe**",
    +        "WORDPRESS_STACKABLE_1_ENV_DB_USER": "admin",
    +        "WORDPRESS_STACKABLE_1_ENV_DEBIAN_FRONTEND": "noninteractive",
    +        "WORDPRESS_STACKABLE_1_ENV_HOME": "/",
    +        "WORDPRESS_STACKABLE_1_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    +        "WORDPRESS_STACKABLE_1_PORT": "tcp://172.16.0.2:80",
    +        "WORDPRESS_STACKABLE_1_PORT_80_TCP": "tcp://172.16.0.2:80",
    +        "WORDPRESS_STACKABLE_1_PORT_80_TCP_ADDR": "172.16.0.2",
    +        "WORDPRESS_STACKABLE_1_PORT_80_TCP_PORT": "80",
    +        "WORDPRESS_STACKABLE_1_PORT_80_TCP_PROTO": "tcp",
    +        "WORDPRESS_STACKABLE_ENV_DB_HOST": "**LinkMe**",
    +        "WORDPRESS_STACKABLE_ENV_DB_NAME": "wordpress",
    +        "WORDPRESS_STACKABLE_ENV_DB_PASS": "szVaPz925B7I",
    +        "WORDPRESS_STACKABLE_ENV_DB_PORT": "**LinkMe**",
    +        "WORDPRESS_STACKABLE_ENV_DB_USER": "admin",
    +        "WORDPRESS_STACKABLE_ENV_DEBIAN_FRONTEND": "noninteractive",
    +        "WORDPRESS_STACKABLE_ENV_HOME": "/",
    +        "WORDPRESS_STACKABLE_ENV_PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    +        "WORDPRESS_STACKABLE_PORT": "tcp://172.16.0.2:80",
    +        "WORDPRESS_STACKABLE_PORT_80_TCP": "tcp://172.16.0.2:80",
    +        "WORDPRESS_STACKABLE_PORT_80_TCP_ADDR": "172.16.0.2",
    +        "WORDPRESS_STACKABLE_PORT_80_TCP_PORT": "80",
    +        "WORDPRESS_STACKABLE_PORT_80_TCP_PROTO": "tcp"
    +    },
    +    "mac_address": "02:42:ac:11:65:43",
    +    "memory": 1024,
    +    "memory_swap": 4096,
    +    "name": "wordpress-stackable",
    +    "net": "bridge",
    +    "node": "/api/infra/v1/node/9691c44e-3155-4ca2-958d-c9571aac0a14/",
    +    "pid": "none",
    +    "private_ip": "10.7.0.1",
    +    "privileged": false,
    +    "public_dns": "wordpress-stackable-1.admin.cont.dockerapp.io",
    +    "read_only": true,
    +    "resource_uri": "/api/app/v1/container/c1dd4e1e-1356-411c-8613-e15146633640/",
    +    "roles": ["global"],
    +    "run_command": "/run-wordpress.sh",
    +    "security_opt": [
    +        "label:user:USER",
    +        "label:role:ROLE"
    +    ],
    +    "service": "/api/app/v1/service/adeebc1b-1b81-4af0-b8f2-cefffc69d7fb/",
    +    "started_datetime": "Thu, 16 Oct 2014 12:04:08 +0000",
    +    "state": "Running",
    +    "stdin_open": false,
    +    "stopped_datetime": null,
    +    "synchronized": true,
    +    "tty": false,
    +    "user": "root",
    +    "uuid": "c1dd4e1e-1356-411c-8613-e15146633640",
    +    "working_dir": "/app"
    +}
    +
    + +

    A container is a representation of a Docker container in a node.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    uuidA unique identifier for the container generated automatically on creation
    resource_uriA unique API endpoint that represents the container
    image_nameThe Docker image name and tag of the container
    bindingsA list of volume bindings that the container has mounted (see table Container Binding attributes below)
    nameA user provided name for the container (inherited from the service)
    nodeThe resource URI of the node where this container is running
    serviceThe resource URI of the service which this container is part of
    public_dnsThe external FQDN of the container
    stateThe state of the container (see table Container states below)
    synchronizedFlag indicating if the container is synchronized with the current service definition.
    exit_codeThe numeric exit code of the container (if applicable, null otherwise)
    exit_code_msgA string representation of the exit code of the container (if applicable, null otherwise)
    deployed_datetimeThe date and time of the last deployment of the container (if applicable, null otherwise)
    started_datetimeThe date and time of the last start operation on the container (if applicable, null otherwise)
    stopped_datetimeThe date and time of the last stop operation on the container (if applicable, null otherwise)
    destroyed_datetimeThe date and time of the terminate operation on the container (if applicable, null otherwise)
    container_portsList of published ports of this container (see table Container Port attributes below)
    container_envvarsList of user-defined environment variables set on the containers of the service, which will override the container environment variables (see table Container Environment Variable attributes below)
    labelsContainer metadata in form of dictionary
    working_dirWorking directory for running binaries within a container
    userUser used on the container on launch
    hostnameHostname used on the container on launch
    domainnameDomainname used on the container on launch
    mac_addressEthernet device’s MAC address used on the container on launch
    cgroup_nameOptional parent cgroup for the container.
    ttyIf the container has the tty enable
    stdin_openIf the container has stdin opened
    dnsContainer custom DNS servers
    dns_searchContainer custom DNS search domain
    cap_addContainer added capabilities
    cap_dropContainer dropped capabilities
    devicesList of container device mappings
    extra_hostsList of container hostname mappings
    secuirty_optLabeling scheme of this container
    entrypointEntrypoint used on the container on launch
    run_commandRun command used on the container on launch
    cpu_sharesThe relative CPU priority of the container (see Runtime Constraints on CPU and Memory for more information)
    cpusetCPUs in which execution is allowed
    memoryThe memory limit of the container in MB (see Runtime Constraints on CPU and Memory for more information)
    memory_swapTotal memory limit (memory + swap) of the container in MB
    autorestartWhether to restart the container automatically if it stops (see Crash recovery for more information)
    autodestroyWhether to terminate the container automatically if it stops (see Autodestroy for more information)
    rolesList of Docker Cloud roles asigned to this container (see API roles for more information))
    linked_to_containerList of IP addresses of the linked containers (see table Container Link attributes below and Service links for more information)
    link_variablesList of environment variables that would be exposed in any container that is linked to this one
    privilegedWhether the container has Docker’s privileged flag set or not (see Runtime privilege for more information)
    read_onlyWhether the container filesystem is read-only or not
    private_ipIP address of the container on the overlay network. This IP will be reachable from any other container.
    netNetwork mode set on the container (see table Network Modes below, more information ../../reference/run/#network-settings)
    pidPID (Process) Namespace mode for the container (more information ../../reference/run/#pid-settings-pid)
    + +

    Container Binding attributes

    + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    host_pathThe host path of the volume
    container_pathThe container path where the volume is mounted
    rewritabletrue is the volume has writable permissions
    volumeThe resource URI of the volume
    + +

    Container Port attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    protocolThe protocol of the port, either tcp or udp
    inner_portThe published port number inside the container
    outer_portThe published port number in the node public network interface
    port_nameName of the service associated to this port
    uri_protocolThe protocol to be used in the endpoint for this port (i.e. http)
    endpoint_uriThe URI of the endpoint for this port
    publishedWhether the port has been published in the host public network interface or not. Non-published ports can only be accessed via links.
    + +

    Container Environment Variable attributes

    + + + + + + + + + + + + + + + +
    AttributeDescription
    keyThe name of the environment variable
    valueThe value of the environment variable
    + +

    Container States

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    StateDescription
    StartingThe container is being deployed or started (from Stopped). No actions allowed in this state.
    RunningThe container is deployed and running. Possible actions in this state: stop, terminate.
    StoppingThe container is being stopped. No actions allowed in this state.
    StoppedThe container is stopped. Possible actions in this state: start, terminate.
    TerminatingThe container is being deleted. No actions allowed in this state.
    TerminatedThe container has been deleted. No actions allowed in this state.
    + +

    Network Modes

    + + + + + + + + + + + + + + + +
    StrategyDescription
    bridgeCreates a new network stack for the container on the docker bridge.
    hostUses the host network stack inside the container.
    + +

    Container Last Metric attributes

    + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    cpuCPU percentage usage
    memoryMemory usage in bytes
    diskDisk storage usage in bytes
    + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    nameThe name given to the link
    from_containerThe resource URI of the “client” container
    to_containerThe resource URI of the “server” container being linked
    endpointsA dictionary with the endpoints (protocol, IP and port) to be used to reach each of the “server” container exposed ports
    + +

    List all containers

    +
    import dockercloud
    +
    +containers = dockercloud.Container.list()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +containerList, err := dockercloud.ListContainers()
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(containerList)
    +
    +
    GET /api/app/v1/container/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud container ps
    +
    + +

    Lists all current and recently terminated containers. Returns a list of Container objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/app/v1/container/

    + +

    Query Parameters

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidFilter by UUID
    stateFilter by state. Possible values: Starting, Running, Stopping, Stopped, Terminating, Terminated
    nameFilter by container name
    serviceFilter by resource URI of the target service.
    nodeFilter by resource URI of the target node.
    + +

    Get an existing container

    +
    import dockercloud
    +
    +container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +container, err := dockerckoud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(container)
    +
    +
    GET /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud container inspect 7eaf7fff
    +
    + +

    Get all the details of an specific container

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/app/v1/container/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the container to retrieve
    + +

    Get the logs of a container

    + +
    +

    Example log line

    +
    +
    {
    +    "type": "log",
    +    "log": "Log line from the container",
    +    "streamType": "stdout",
    +    "timestamp": 1433779324
    +}
    +
    +
    import dockercloud
    +
    +def log_handler(message):
    +    print message
    +
    +container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +container.logs(tail=300, follow=True, log_handler=log_handler)
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +container, err := dockercloud.GetContainer("447ecddc-2890-4ea2-849b-99392e0dd7a6")
    +
    +if err != nil {
    +    log.Fatal(err)
    +}
    +c := make(chan dockercloud.Logs)
    +
    +go container.Logs(c)
    +    for {
    +        s := <-c
    +        log.Println(s)
    +    }
    +
    +
    GET /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/logs/ HTTP/1.1
    +Host: ws.cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Connection: Upgrade
    +Upgrade: websocket
    +
    +
    docker-cloud container logs 7eaf7fff
    +
    + +

    Get the logs of the specified container.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s STREAM API

    + +

    HTTP Request

    + +

    GET /api/app/v1/container/(uuid)/logs/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the container to retrieve logs
    + +

    Query Parameters

    + + + + + + + + + + + + + + + + + + + +
    ParameterDescription
    tailNumber of lines to show from the end of the logs (default: 300)
    followWhether to stream logs or close the connection immediately (default: true)
    serviceFilter by service (resource URI)
    + +

    Start a container

    +
    import dockercloud
    +
    +container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +container.start()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +if err = container.Start(); err != nil {
    +  log.Println(err)
    +}
    +
    +
    POST /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/start/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud container start 7eaf7fff
    +
    + +

    Starts a stopped container.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/container/(uuid)/start/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the container to start
    + +

    Stop a container

    +
    import dockercloud
    +
    +container = dockerlcoud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +container.stop()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +if err = container.Stop(); err != nil {
    +       log.Println(err)
    +   }
    +
    +
    POST /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/stop/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud container stop 7eaf7fff
    +
    + +

    Stops a running container.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/container/(uuid)/stop/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the container to stop
    + +

    Redeploy a container

    +
    import dockercloud
    +
    +container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +container.redeploy()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +    log.Println(err)
    +}
    +//Redeploy(dockercloud.ReuseVolumesOption{Reuse: true) to reuse the existing volumes
    +//Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}) to not reuse the existing volumes
    +if err = container.Redeploy(dockercloud.ReuseVolumesOption{Reuse: false}); err != nil {
    +  log.Println(err)
    +}
    +
    +
    POST /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/start/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud container redeploy 7eaf7fff
    +
    + +

    Redeploys a container.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/container/(uuid)/redeploy/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the container to redeploy
    + +

    Query Parameters

    + + + + + + + + + + + +
    ParameterDescription
    reuse_volumesWheather to reuse container volumes for this redeploy operation or not (default: true).
    + +

    Terminate a container

    +
    import dockercloud
    +
    +container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +container.delete()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +    log.Println(err)
    +}
    +
    +if err = container.Terminate(); err != nil {
    +       log.Println(err)
    +   }
    +
    +
    DELETE /api/app/v1/container/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud container terminate 7eaf7fff
    +
    + +

    Terminates the specified container. This is not reversible. All data stored in the container will be permanently deleted.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    DELETE /api/app/v1/container/(uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the container to terminate
    + +

    Execute command inside a container

    +
    import dockercloud
    +
    +def msg_handler(message):
    +    print message
    +
    +container = dockercloud.Container.fetch("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +container.execute("ls", handler=msg_handler)
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +container, err := dockercloud.GetContainer("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +c := make(chan dockercloud.Exec)
    +
    +container.Exec("ls", c)
    +
    +
    +
    GET /api/app/v1/container/(uuid)/exec/ HTTP/1.1
    +Host: ws.cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Connection: Upgrade
    +Upgrade: websocket
    +
    +
    docker-cloud exec 7eaf7fff ls
    +
    + +

    Executes a command inside the specified running container, creating a bi-directional stream for the process’ standard input and output. This endpoint can be connected to using a bi-directional Secure Web Socket wss://ws.cloud.docker.com/api/app/v1/container/(uuid)/exec/

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s STREAM API

    + +

    HTTP Request

    + +

    GET /api/app/v1/container/(uuid)/exec/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the container where the command will be executed
    + +

    Query Parameters

    + + + + + + + + + + + +
    ParameterDescription
    commandCommand to be executed (default: sh)
    + +

    Triggers

    + +

    Service triggers

    + +
    +

    Example

    +
    +
    {
    +  "url": "/api/app/v1/service/82d4a246-52d8-468d-903d-9da9ef05ff28/trigger/0224815a-c156-44e4-92d7-997c69354438/call/",
    +  "operation": "REDEPLOY",
    +  "name": "docker_trigger",
    +  "resource_uri": "/api/app/v1/service/82d4a246-52d8-468d-903d-9da9ef05ff28/trigger/0224815a-c156-44e4-92d7-997c69354438/"
    +}
    +
    + +

    Triggers are URLs that will start a redeploy of the service whenever a POST request is sent to them. They require no authorization headers, so they should be treated as access tokens. Triggers can be revoked if they are leaked or no longer used for security purposes. See Triggers for more information.

    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    urlAddress to be used to call the trigger with a POST request
    nameA user provided name for the trigger
    operationThe operation that the trigger call performs (see table Operations below)
    resource_uriA unique API endpoint that represents the trigger
    + +

    Operations

    + + + + + + + + + + + + + + + +
    OperationDescription
    REDEPLOYPerforms a redeploy service operation.
    SCALEUPPerforms a scale up service operation.
    + +

    List all triggers

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
    +trigger = dockercloud.Trigger.fetch(service)
    +trigger.list()
    +
    +
    GET /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
    +
    +    if err != nil {
    +        log.Println(err)
    +    }
    +
    +trigger, err := service.ListTriggers()
    +
    +  if err != nil {
    +    log.Println(err)
    +  }
    +
    +    log.Println(trigger)
    +
    +
    docker-cloud trigger list 61a29874-9134-48f9-b460-f37d4bec4826
    +
    + +

    Lists all current triggers the service has associated to. Returns a list of Service Trigger objects.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/app/v1/service/(uuid)/trigger/

    + +

    Path Parameters

    + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service the triggers are associated to
    + +

    Create a new trigger

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
    +trigger = dockercloud.Trigger.fetch(service)
    +trigger.add(name="mytrigger_name", operation="REDEPLOY")
    +trigger.save()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +trigger, err := service.CreateTrigger(dockercloud.TriggerCreateRequest{Name: "test-trigger", Operation: "REDEPLOY"})
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(trigger)
    +
    +
    POST /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +Content-Type: application/json
    +
    +{"name": "mytrigger_name", "operation": "REDEPLOY"}
    +
    +
    docker-cloud trigger create --name mytrigger_name --operation REDEPLOY 61a29874-9134-48f9-b460-f37d4bec4826
    +
    + +

    Creates a new service trigger.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/service/(uuid)/trigger/

    + +

    JSON Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    name(optional) A user provided name for the trigger
    operation(optional) The operation to be performed by the trigger (default: “REDEPLOY”)
    + +

    Get an existing trigger

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
    +trigger = dockercloud.Trigger.fetch(service)
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +trigger, err := service.GetTrigger("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +log.Println(trigger)
    +
    +
    GET /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    + +

    Get all the details of an specific trigger

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    GET /api/app/v1/service/(uuid)/trigger/(trigger_uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the service the triggers are associated to
    trigger_uuidThe UUID of the trigger to retrieve
    + +

    Delete a trigger

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
    +trigger = dockercloud.Trigger.fetch(service)
    +trigger.delete("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +service.DeleteTrigger("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +
    DELETE /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/ HTTP/1.1
    +Host: cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Accept: application/json
    +
    +
    docker-cloud trigger rm 61a29874-9134-48f9-b460-f37d4bec4826 7eaf7fff-882c-4f3d-9a8f-a22317ac00ce
    +
    + +

    Deletes specific trigger. It will be no longer available to be called.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    DELETE /api/app/v1/service/(uuid)/trigger/(trigger_uuid)/

    + +

    Path Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the associated service
    trigger_uuidThe UUID of the trigger to delete
    + +

    Call a trigger

    +
    import dockercloud
    +
    +service = dockercloud.Service.fetch('61a29874-9134-48f9-b460-f37d4bec4826')
    +trigger = dockercloud.Trigger.fetch(service)
    +trigger.call("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +service, err := dockercloud.GetService("61a29874-9134-48f9-b460-f37d4bec4826")
    +
    +if err != nil {
    +  log.Println(err)
    +}
    +
    +service.CallTrigger("7eaf7fff-882c-4f3d-9a8f-a22317ac00ce")
    +
    +
    POST /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/call/ HTTP/1.1
    +Host: cloud.docker.com
    +Accept: application/json
    +
    + +

    Executes the trigger. For SCALEUP triggers, the number of containers to scale up can be passed at the end of the trigger call url, for example /api/app/v1/service/61a29874-9134-48f9-b460-f37d4bec4826/trigger/7eaf7fff-882c-4f3d-9a8f-a22317ac00ce/call/3/.

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s REST API

    + +

    HTTP Request

    + +

    POST /api/app/v1/service/(uuid)/trigger/(trigger_uuid)/call/

    + +

    Path Parameters

    + + + + + + + + + + + + + + + +
    ParameterDescription
    uuidThe UUID of the associated service
    trigger_uuidThe UUID of the trigger to call
    + +

    Docker Cloud Events

    + +

    Docker Cloud Event

    + +
    +

    Example

    +
    +
    {
    +    "type": "action",
    +    "action": "update",
    +    "parents": [
    +        "/api/app/v1/container/0b0e3538-88df-4f07-9aed-3a3cc4175076/"
    +    ],
    +    "resource_uri": "/api/app/v1/action/49f0efe8-a704-4a10-b02f-f96344fabadd/",
    +    "state": "Success",
    +    "uuid": "093ba3bb-08dd-48f0-8f12-4d3b85ef85b3",
    +    "datetime": "2016-02-01T16:47:28Z"
    +}
    +
    + +

    Docker Cloud events are generated every time any of the following objects is created or changes state:

    + +
      +
    • Stack
    • +
    • Service
    • +
    • Container
    • +
    • Node Cluster
    • +
    • Node
    • +
    • Action
    • +
    + +

    Attributes

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescription
    typeType of object that was created or updated. For possible values, check the events types table below.
    actionType of action that was executed on the object. Posible values: create, update or delete
    parentsList of resource URIs (REST API) of the parents of the object, according to the “Parent-child hierarchy” table below
    resource_uriResource URI (REST API) of the object that was created or updated. You can do a GET operation on this URL to fetch its details
    stateThe current state of the object
    uuidUnique identifier for the event
    datetimeDate and time of the event in ISO 8601 format
    + +

    Event types

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TypeDescription
    stackWhenever a Stack is created or updated
    serviceWhenever a Service is created or updated
    containerWhenever a Container is created or updated
    nodeclusterWhenever a Node Cluster is created or updated
    nodeWhenever a Node is created or updated
    actionWhenever a Action is created or updated
    errorSent when an error occurs on the websocket connection or as part of the authentication process
    + +

    Parent-child hierarchy

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Object typeParent types
    Stack(None)
    ServiceStack
    ContainerService, Stack, Node, Node Cluster
    Node Cluster(None)
    NodeNode Cluster
    Action(object to which the action applies to)
    + +

    Listen to new Docker Cloud Events

    +
    import dockercloud
    +
    +def process_event(event):
    +    print event
    +
    +events = dockercloud.Events()
    +events.on_message(process_event)
    +events.run_forever()
    +
    +
    import "github.com/docker/go-dockercloud/dockercloud"
    +
    +c := make(chan dockercloud.Event)
    +e := make(chan error)
    +
    +go dockercloud.Events(c, e)
    +
    +for {
    +    select {
    +        case event := <-c:
    +            log.Println(event)
    +        case err := <-e:
    +            log.Println(err)
    +    }
    +}
    +
    +
    GET /api/audit/v1/events/ HTTP/1.1
    +Host: ws.cloud.docker.com
    +Authorization: Basic dXNlcm5hbWU6YXBpa2V5
    +Connection: Upgrade
    +Upgrade: websocket
    +
    +
    docker-cloud event
    +
    + +

    Listens for new Docker Cloud Events

    + +

    Endpoint Type

    + +

    Available in Docker Cloud’s STREAM API

    + +

    HTTP Request

    + +

    GET /api/audit/v1/events/

    + +

    Errors

    + +
    +

    API response structure

    +
    +
    {
    +    "error": "Descriptive error message"
    +}
    +
    + +

    The Docker Cloud API uses the following error codes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Error CodeMeaning
    400Bad Request – There’s a problem in the content of your request. Retrying the same request will fail.
    401Unauthorized – Your API key is wrong or your account has been deactivated.
    402Payment Required – You need to provide billing information to perform this request.
    403Forbidden – Quota limit exceeded. Please contact support to request a quota increase.
    404Not Found – The requested object cannot be found.
    405Method Not Allowed – The endpoint requested does not implement the method sent.
    409Conflict – The object cannot be created or updated because another object exists with the same unique fields
    415Unsupported Media Type – Make sure you are using Accept and Content-Type headers as application/json and that the data your are POST-ing or PATCH-ing is in valid JSON format.
    429Too Many Requests – You are being throttled because of too many requests in a short period of time.
    500Internal Server Error – There was a server error while processing your request. Try again later, or contact support.
    503Service Unavailable – We’re temporarily offline for maintenance. Please try again later.
    504Gateway Timeout – Our API servers are at full capacity. Please try again later.
    + +
    +
    +
    + http + go + python + CLI +
    +
    +
    +
    + + + + +
    + + diff --git a/apidocs/docker-cloud/javascripts/all.js b/apidocs/docker-cloud/javascripts/all.js new file mode 100644 index 0000000000..a0773c13f0 --- /dev/null +++ b/apidocs/docker-cloud/javascripts/all.js @@ -0,0 +1,143 @@ +!function(){if("ontouchstart"in window){var e,t,n,i,o,r,s={};e=function(e,t){return Math.abs(e[0]-t[0])>5||Math.abs(e[1]-t[1])>5},t=function(e){this.startXY=[e.touches[0].clientX,e.touches[0].clientY],this.threshold=!1},n=function(t){return this.threshold?!1:void(this.threshold=e(this.startXY,[t.touches[0].clientX,t.touches[0].clientY]))},i=function(t){if(!this.threshold&&!e(this.startXY,[t.changedTouches[0].clientX,t.changedTouches[0].clientY])){var n=t.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),i.simulated=!0,t.target.dispatchEvent(i)}},o=function(e){var t=Date.now(),n=t-s.time,i=e.clientX,o=e.clientY,a=[Math.abs(s.x-i),Math.abs(s.y-o)],c=r(e.target,"A")||e.target,h=c.nodeName,l="A"===h,u=window.navigator.standalone&&l&&e.target.getAttribute("href");return s.time=t,s.x=i,s.y=o,(!e.simulated&&(500>n||1500>n&&a[0]<50&&a[1]<50)||u)&&(e.preventDefault(),e.stopPropagation(),!u)?!1:(u&&(window.location=c.getAttribute("href")),void(c&&c.classList&&(c.classList.add("energize-focus"),window.setTimeout(function(){c.classList.remove("energize-focus")},150))))},r=function(e,t){for(var n=e;n!==document.body;){if(!n||n.nodeName===t)return n;n=n.parentNode}return null},document.addEventListener("touchstart",t,!1),document.addEventListener("touchmove",n,!1),document.addEventListener("touchend",i,!1),document.addEventListener("click",o,!0)}}(),/* +Copyright 2008-2013 Concur Technologies, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +License for the specific language governing permissions and limitations +under the License. +*/ +function(e){"use strict";function t(t){if(t&&""!==t){$(".lang-selector a").removeClass("active"),$(".lang-selector a[data-language-name='"+t+"']").addClass("active");for(var n=0;n=1){var e=n(location.search).language;if(e)return e;if(-1!=jQuery.inArray(location.search.substr(1),c))return location.search.substr(1)}return!1}function r(e){var t=n(location.search);return t.language?(t.language=e,i(t)):e}function s(e){if(history){var t=window.location.hash;t&&(t=t.replace(/^#+/,"")),history.pushState({},"","?"+r(e)+"#"+t),localStorage.setItem("language",e)}}function a(e){var n=localStorage.getItem("language");c=e;var i=o();i?(t(i),localStorage.setItem("language",i)):t(null!==n&&-1!=jQuery.inArray(n,c)?n:c[0])}var c=[];e.setupLanguages=a,e.activateLanguage=t,$(function(){$(".lang-selector a").on("click",function(){var e=$(this).data("language-name");return s(e),t(e),!1}),window.onpopstate=function(){t(o())}})}(window),/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.7 + * Copyright (C) 2014 Oliver Nightingale + * MIT Licensed + * @license + */ +function(){var e=function(t){var n=new e.Index;return n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),t&&t.call(n,n),n};e.version="0.5.7",/*! + * lunr.utils + * Copyright (C) 2014 Oliver Nightingale + */ +e.utils={},e.utils.warn=function(e){return function(t){e.console&&console.warn&&console.warn(t)}}(this),/*! + * lunr.EventEmitter + * Copyright (C) 2014 Oliver Nightingale + */ +e.EventEmitter=function(){this.events={}},e.EventEmitter.prototype.addListener=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=e;if("function"!=typeof t)throw new TypeError("last argument must be a function");n.forEach(function(e){this.hasHandler(e)||(this.events[e]=[]),this.events[e].push(t)},this)},e.EventEmitter.prototype.removeListener=function(e,t){if(this.hasHandler(e)){var n=this.events[e].indexOf(t);this.events[e].splice(n,1),this.events[e].length||delete this.events[e]}},e.EventEmitter.prototype.emit=function(e){if(this.hasHandler(e)){var t=Array.prototype.slice.call(arguments,1);this.events[e].forEach(function(e){e.apply(void 0,t)})}},e.EventEmitter.prototype.hasHandler=function(e){return e in this.events},/*! + * lunr.tokenizer + * Copyright (C) 2014 Oliver Nightingale + */ +e.tokenizer=function(e){if(!arguments.length||null==e||void 0==e)return[];if(Array.isArray(e))return e.map(function(e){return e.toLowerCase()});for(var t=e.toString().replace(/^\s+/,""),n=t.length-1;n>=0;n--)if(/\S/.test(t.charAt(n))){t=t.substring(0,n+1);break}return t.split(/(?:\s+|\-)/).filter(function(e){return!!e}).map(function(e){return e.toLowerCase()})},/*! + * lunr.Pipeline + * Copyright (C) 2014 Oliver Nightingale + */ +e.Pipeline=function(){this._stack=[]},e.Pipeline.registeredFunctions={},e.Pipeline.registerFunction=function(t,n){n in this.registeredFunctions&&e.utils.warn("Overwriting existing registered function: "+n),t.label=n,e.Pipeline.registeredFunctions[t.label]=t},e.Pipeline.warnIfFunctionNotRegistered=function(t){var n=t.label&&t.label in this.registeredFunctions;n||e.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},e.Pipeline.load=function(t){var n=new e.Pipeline;return t.forEach(function(t){var i=e.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load un-registered function: "+t);n.add(i)}),n},e.Pipeline.prototype.add=function(){var t=Array.prototype.slice.call(arguments);t.forEach(function(t){e.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},e.Pipeline.prototype.after=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t)+1;this._stack.splice(i,0,n)},e.Pipeline.prototype.before=function(t,n){e.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(t);this._stack.splice(i,0,n)},e.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);this._stack.splice(t,1)},e.Pipeline.prototype.run=function(e){for(var t=[],n=e.length,i=this._stack.length,o=0;n>o;o++){for(var r=e[o],s=0;i>s&&(r=this._stack[s](r,o,e),void 0!==r);s++);void 0!==r&&t.push(r)}return t},e.Pipeline.prototype.reset=function(){this._stack=[]},e.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return e.Pipeline.warnIfFunctionNotRegistered(t),t.label})},/*! + * lunr.Vector + * Copyright (C) 2014 Oliver Nightingale + */ +e.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},e.Vector.Node=function(e,t,n){this.idx=e,this.val=t,this.next=n},e.Vector.prototype.insert=function(t,n){var i=this.list;if(!i)return this.list=new e.Vector.Node(t,n,i),this.length++;for(var o=i,r=i.next;void 0!=r;){if(tn.idx?n=n.next:(i+=t.val*n.val,t=t.next,n=n.next);return i},e.Vector.prototype.similarity=function(e){return this.dot(e)/(this.magnitude()*e.magnitude())},/*! + * lunr.SortedSet + * Copyright (C) 2014 Oliver Nightingale + */ +e.SortedSet=function(){this.length=0,this.elements=[]},e.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},e.SortedSet.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){~this.indexOf(e)||this.elements.splice(this.locationFor(e),0,e)},this),this.length=this.elements.length},e.SortedSet.prototype.toArray=function(){return this.elements.slice()},e.SortedSet.prototype.map=function(e,t){return this.elements.map(e,t)},e.SortedSet.prototype.forEach=function(e,t){return this.elements.forEach(e,t)},e.SortedSet.prototype.indexOf=function(e,t,n){var t=t||0,n=n||this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return 1>=i?r===e?o:-1:e>r?this.indexOf(e,o,n):r>e?this.indexOf(e,t,o):r===e?o:void 0},e.SortedSet.prototype.locationFor=function(e,t,n){var t=t||0,n=n||this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];if(1>=i){if(r>e)return o;if(e>r)return o+1}return e>r?this.locationFor(e,o,n):r>e?this.locationFor(e,t,o):void 0},e.SortedSet.prototype.intersect=function(t){for(var n=new e.SortedSet,i=0,o=0,r=this.length,s=t.length,a=this.elements,c=t.elements;;){if(i>r-1||o>s-1)break;a[i]!==c[o]?a[i]c[o]&&o++:(n.add(a[i]),i++,o++)}return n},e.SortedSet.prototype.clone=function(){var t=new e.SortedSet;return t.elements=this.toArray(),t.length=t.elements.length,t},e.SortedSet.prototype.union=function(e){var t,n,i;return this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone(),i.add.apply(i,n.toArray()),i},e.SortedSet.prototype.toJSON=function(){return this.toArray()},/*! + * lunr.Index + * Copyright (C) 2014 Oliver Nightingale + */ +e.Index=function(){this._fields=[],this._ref="id",this.pipeline=new e.Pipeline,this.documentStore=new e.Store,this.tokenStore=new e.TokenStore,this.corpusTokens=new e.SortedSet,this.eventEmitter=new e.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},e.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},e.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},e.Index.load=function(t){t.version!==e.version&&e.utils.warn("version mismatch: current "+e.version+" importing "+t.version);var n=new this;return n._fields=t.fields,n._ref=t.ref,n.documentStore=e.Store.load(t.documentStore),n.tokenStore=e.TokenStore.load(t.tokenStore),n.corpusTokens=e.SortedSet.load(t.corpusTokens),n.pipeline=e.Pipeline.load(t.pipeline),n},e.Index.prototype.field=function(e,t){var t=t||{},n={name:e,boost:t.boost||1};return this._fields.push(n),this},e.Index.prototype.ref=function(e){return this._ref=e,this},e.Index.prototype.add=function(t,n){var i={},o=new e.SortedSet,r=t[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(e.tokenizer(t[n.name]));i[n.name]=r,e.SortedSet.prototype.add.apply(o,r)},this),this.documentStore.set(r,o),e.SortedSet.prototype.add.apply(this.corpusTokens,o.toArray());for(var s=0;s0&&(i=1+Math.log(this.tokenStore.length/n)),this._idfCache[t]=i},e.Index.prototype.search=function(t){var n=this.pipeline.run(e.tokenizer(t)),i=new e.Vector,o=[],r=this._fields.reduce(function(e,t){return e+t.boost},0),s=n.some(function(e){return this.tokenStore.has(e)},this);if(!s)return[];n.forEach(function(t,n,s){var a=1/s.length*this._fields.length*r,c=this,h=this.tokenStore.expand(t).reduce(function(n,o){var r=c.corpusTokens.indexOf(o),s=c.idf(o),h=1,l=new e.SortedSet;if(o!==t){var u=Math.max(3,o.length-t.length);h=1/Math.log(u)}return r>-1&&i.insert(r,a*s*h),Object.keys(c.tokenStore.get(o)).forEach(function(e){l.add(e)}),n.union(l)},new e.SortedSet);o.push(h)},this);var a=o.reduce(function(e,t){return e.intersect(t)});return a.map(function(e){return{ref:e,score:i.similarity(this.documentVector(e))}},this).sort(function(e,t){return t.score-e.score})},e.Index.prototype.documentVector=function(t){for(var n=this.documentStore.get(t),i=n.length,o=new e.Vector,r=0;i>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[t].tf,c=this.idf(s);o.insert(this.corpusTokens.indexOf(s),a*c)}return o},e.Index.prototype.toJSON=function(){return{version:e.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},e.Index.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},/*! + * lunr.Store + * Copyright (C) 2014 Oliver Nightingale + */ +e.Store=function(){this.store={},this.length=0},e.Store.load=function(t){var n=new this;return n.length=t.length,n.store=Object.keys(t.store).reduce(function(n,i){return n[i]=e.SortedSet.load(t.store[i]),n},{}),n},e.Store.prototype.set=function(e,t){this.has(e)||this.length++,this.store[e]=t},e.Store.prototype.get=function(e){return this.store[e]},e.Store.prototype.has=function(e){return e in this.store},e.Store.prototype.remove=function(e){this.has(e)&&(delete this.store[e],this.length--)},e.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},/*! + * lunr.stemmer + * Copyright (C) 2014 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + */ +e.stemmer=function(){var e={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},t={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",o=n+"[^aeiouy]*",r=i+"[aeiou]*",s="^("+o+")?"+r+o,a="^("+o+")?"+r+o+"("+r+")?$",c="^("+o+")?"+r+o+r+o,h="^("+o+")?"+i,l=new RegExp(s),u=new RegExp(c),d=new RegExp(a),f=new RegExp(h),p=/^(.+?)(ss|i)es$/,g=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,m=/^(.+?)(ed|ing)$/,y=/.$/,w=/(at|bl|iz)$/,b=new RegExp("([^aeiouylsz])\\1$"),S=new RegExp("^"+o+i+"[^aeiouwxy]$"),x=/^(.+?[^aeiou])y$/,E=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,_=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,C=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,k=/^(.+?)(s|t)(ion)$/,O=/^(.+?)e$/,L=/ll$/,N=new RegExp("^"+o+i+"[^aeiouwxy]$"),A=function(n){var i,o,r,s,a,c,h;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=g,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=m,s.test(n)){var A=s.exec(n);s=l,s.test(A[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var A=a.exec(n);i=A[1],a=f,a.test(i)&&(n=i,a=w,c=b,h=S,a.test(n)?n+="e":c.test(n)?(s=y,n=n.replace(s,"")):h.test(n)&&(n+="e"))}if(s=x,s.test(n)){var A=s.exec(n);i=A[1],n=i+"i"}if(s=E,s.test(n)){var A=s.exec(n);i=A[1],o=A[2],s=l,s.test(i)&&(n=i+e[o])}if(s=_,s.test(n)){var A=s.exec(n);i=A[1],o=A[2],s=l,s.test(i)&&(n=i+t[o])}if(s=C,a=k,s.test(n)){var A=s.exec(n);i=A[1],s=u,s.test(i)&&(n=i)}else if(a.test(n)){var A=a.exec(n);i=A[1]+A[2],a=u,a.test(i)&&(n=i)}if(s=O,s.test(n)){var A=s.exec(n);i=A[1],s=u,a=d,c=N,(s.test(i)||a.test(i)&&!c.test(i))&&(n=i)}return s=L,a=u,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return A}(),e.Pipeline.registerFunction(e.stemmer,"stemmer"),/*! + * lunr.stopWordFilter + * Copyright (C) 2014 Oliver Nightingale + */ +e.stopWordFilter=function(t){return-1===e.stopWordFilter.stopWords.indexOf(t)?t:void 0},e.stopWordFilter.stopWords=new e.SortedSet,e.stopWordFilter.stopWords.length=119,e.stopWordFilter.stopWords.elements=["","a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"],e.Pipeline.registerFunction(e.stopWordFilter,"stopWordFilter"),/*! + * lunr.trimmer + * Copyright (C) 2014 Oliver Nightingale + */ +e.trimmer=function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")},e.Pipeline.registerFunction(e.trimmer,"trimmer"),/*! + * lunr.stemmer + * Copyright (C) 2014 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + */ +e.TokenStore=function(){this.root={docs:{}},this.length=0},e.TokenStore.load=function(e){var t=new this;return t.root=e.root,t.length=e.length,t},e.TokenStore.prototype.add=function(e,t,n){var n=n||this.root,i=e[0],o=e.slice(1);return i in n||(n[i]={docs:{}}),0===o.length?(n[i].docs[t.ref]=t,void(this.length+=1)):this.add(o,t,n[i])},e.TokenStore.prototype.has=function(e){if(!e)return!1;for(var t=this.root,n=0;n (default options) + * $('#content').highlight('lorem'); + * + * // search for and highlight more terms at once + * // so you can save some time on traversing DOM + * $('#content').highlight(['lorem', 'ipsum']); + * $('#content').highlight('lorem ipsum'); + * + * // search only for entire word 'lorem' + * $('#content').highlight('lorem', { wordsOnly: true }); + * + * // don't ignore case during search of term 'lorem' + * $('#content').highlight('lorem', { caseSensitive: true }); + * + * // wrap every occurrance of term 'ipsum' in content + * // with + * $('#content').highlight('ipsum', { element: 'em', className: 'important' }); + * + * // remove default highlight + * $('#content').unhighlight(); + * + * // remove custom highlight + * $('#content').unhighlight({ element: 'em', className: 'important' }); + * + * + * Copyright (c) 2009 Bartek Szopka + * + * Licensed under MIT license. + * + */ +jQuery.extend({highlight:function(e,t,n,i){if(3===e.nodeType){var o=e.data.match(t);if(o){var r=document.createElement(n||"span");r.className=i||"highlight";var s=e.splitText(o.index);s.splitText(o[0].length);var a=s.cloneNode(!0);return r.appendChild(a),s.parentNode.replaceChild(r,s),1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName)&&(e.tagName!==n.toUpperCase()||e.className!==i))for(var c=0;c1e-4});t.length?(s.empty(),$.each(t,function(e,t){var n=document.getElementById(t.ref);s.append("
  • "+$(n).text()+"
  • ")}),i.call(this)):(s.html("
  • "),$(".search-results li").text('No Results Found for "'+this.value+'"'))}else o(),s.removeClass("visible")}function i(){this.value&&r.highlight(this.value,a)}function o(){r.unhighlight(a)}var r,s,a={element:"span",className:"search-highlight"},c=new lunr.Index;c.ref("id"),c.field("title",{boost:10}),c.field("body"),c.pipeline.add(lunr.trimmer,lunr.stopWordFilter),$(e),$(t)}(),/*! jQuery UI - v1.11.3 - 2015-02-12 + * http://jqueryui.com + * Includes: widget.js + * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ +function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){/*! + * jQuery UI Widget 1.11.3 + * http://jqueryui.com + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/jQuery.widget/ + */ +var t=0,n=Array.prototype.slice;e.cleanData=function(t){return function(n){var i,o,r;for(r=0;null!=(o=n[r]);r++)try{i=e._data(o,"events"),i&&i.remove&&e(o).triggerHandler("remove")}catch(s){}t(n)}}(e.cleanData),e.widget=function(t,n,i){var o,r,s,a,c={},h=t.split(".")[0];return t=t.split(".")[1],o=h+"-"+t,i||(i=n,n=e.Widget),e.expr[":"][o.toLowerCase()]=function(t){return!!e.data(t,o)},e[h]=e[h]||{},r=e[h][t],s=e[h][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new s(e,t)},e.extend(s,r,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),a=new n,a.options=e.widget.extend({},a.options),e.each(i,function(t,i){return e.isFunction(i)?void(c[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},o=function(e){return n.prototype[t].apply(this,e)};return function(){var t,n=this._super,r=this._superApply;return this._super=e,this._superApply=o,t=i.apply(this,arguments),this._super=n,this._superApply=r,t}}()):void(c[t]=i)}),s.prototype=e.widget.extend(a,{widgetEventPrefix:r?a.widgetEventPrefix||t:t},c,{constructor:s,namespace:h,widgetName:t,widgetFullName:o}),r?(e.each(r._childConstructors,function(t,n){var i=n.prototype;e.widget(i.namespace+"."+i.widgetName,s,n._proto)}),delete r._childConstructors):n._childConstructors.push(s),e.widget.bridge(t,s),s},e.widget.extend=function(t){for(var i,o,r=n.call(arguments,1),s=0,a=r.length;a>s;s++)for(i in r[s])o=r[s][i],r[s].hasOwnProperty(i)&&void 0!==o&&(t[i]=e.isPlainObject(o)?e.isPlainObject(t[i])?e.widget.extend({},t[i],o):e.widget.extend({},o):o);return t},e.widget.bridge=function(t,i){var o=i.prototype.widgetFullName||t;e.fn[t]=function(r){var s="string"==typeof r,a=n.call(arguments,1),c=this;return s?this.each(function(){var n,i=e.data(this,o);return"instance"===r?(c=i,!1):i?e.isFunction(i[r])&&"_"!==r.charAt(0)?(n=i[r].apply(i,a),n!==i&&void 0!==n?(c=n&&n.jquery?c.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+r+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+r+"'")}):(a.length&&(r=e.widget.extend.apply(null,[r].concat(a))),this.each(function(){var t=e.data(this,o);t?(t.option(r||{}),t._init&&t._init()):e.data(this,o,new i(r,this))})),c}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
    ",options:{disabled:!1,create:null},_createWidget:function(n,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),n),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var i,o,r,s=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(s={},i=t.split("."),t=i.shift(),i.length){for(o=s[t]=e.widget.extend({},this.options[t]),r=0;r",{id:c+t,"class":c}).append(i._nestElements(e(this),t)),i.element.append(n),e(this).nextUntil(this.nodeName.toLowerCase()).each(function(){0===e(this).find(i.options.selectors).length?e(this).filter(i.options.selectors).each(function(){e(this).is(r)||i._appendSubheaders.call(this,i,n)}):e(this).find(i.options.selectors).each(function(){e(this).is(r)||i._appendSubheaders.call(this,i,n)})}))})):void i.element.addClass(a)},_setActiveElement:function(e){var n=this,i=t.location.hash.substring(1),o=n.element.find("li[data-unique='"+i+"']");return i.length?(n.element.find("."+n.focusClass).removeClass(n.focusClass),o.addClass(n.focusClass),n.options.showAndHide&&o.click()):(n.element.find("."+n.focusClass).removeClass(n.focusClass),!i.length&&e&&n.options.highlightDefault&&n.element.find(f).first().addClass(n.focusClass)),n},_nestElements:function(t,n){var i,o,r;return i=e.grep(this.items,function(e){return e===t.text()}),this.items.push(i.length?t.text()+n:t.text()),r=this._generateHashValue(i,t,n),o=e("
  • ",{"class":d,"data-unique":r}).append(e("",{text:t.text()})),t.before(e("
    ",{name:r,"data-unique":r})),o},_generateHashValue:function(e,t,n){var i="",o=this.options.hashGenerator;if("pretty"===o){for(i=t.text().toLowerCase().replace(/\s/g,"-"),i=i.replace(/[^\x00-\x7F]/g,"");i.indexOf("--")>-1;)i=i.replace(/--/g,"-");for(;i.indexOf(":-")>-1;)i=i.replace(/:-/g,"-")}else i="function"==typeof o?o(t.text(),t):t.text().replace(/\s/g,"");return e.length&&(i+=""+n),i},_appendSubheaders:function(t,n){var i=e(this).index(t.options.selectors),o=e(t.options.selectors).eq(i-1),r=+e(this).prop("tagName").charAt(1),s=+o.prop("tagName").charAt(1);s>r?t.element.find(u+"[data-tag="+r+"]").last().append(t._nestElements(e(this),i)):r===s?n.find(f).last().after(t._nestElements(e(this),i)):n.find(f).last().after(e("