aws-codedeploy-agent 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/.gitignore +2 -0
  2. data/CHANGES.md +3 -0
  3. data/Gemfile +13 -0
  4. data/LICENSE +177 -0
  5. data/NOTICE +2 -0
  6. data/README.md +16 -0
  7. data/aws-codedeploy-agent.gemspec +39 -0
  8. data/bin/codedeploy-agent +78 -0
  9. data/bin/codedeploy-install +15 -0
  10. data/bin/codedeploy-uninstall +13 -0
  11. data/certs/host-agent-deployment-signer-ca-chain.pem +76 -0
  12. data/conf/codedeployagent.yml +9 -0
  13. data/init.d/codedeploy-agent +61 -0
  14. data/lib/core_ext.rb +71 -0
  15. data/lib/instance_agent.rb +35 -0
  16. data/lib/instance_agent/agent/base.rb +34 -0
  17. data/lib/instance_agent/codedeploy_plugin/application_specification/ace_info.rb +133 -0
  18. data/lib/instance_agent/codedeploy_plugin/application_specification/acl_info.rb +163 -0
  19. data/lib/instance_agent/codedeploy_plugin/application_specification/application_specification.rb +142 -0
  20. data/lib/instance_agent/codedeploy_plugin/application_specification/context_info.rb +23 -0
  21. data/lib/instance_agent/codedeploy_plugin/application_specification/file_info.rb +23 -0
  22. data/lib/instance_agent/codedeploy_plugin/application_specification/linux_permission_info.rb +121 -0
  23. data/lib/instance_agent/codedeploy_plugin/application_specification/mode_info.rb +66 -0
  24. data/lib/instance_agent/codedeploy_plugin/application_specification/range_info.rb +134 -0
  25. data/lib/instance_agent/codedeploy_plugin/application_specification/script_info.rb +27 -0
  26. data/lib/instance_agent/codedeploy_plugin/codedeploy_control.rb +72 -0
  27. data/lib/instance_agent/codedeploy_plugin/command_executor.rb +357 -0
  28. data/lib/instance_agent/codedeploy_plugin/command_poller.rb +146 -0
  29. data/lib/instance_agent/codedeploy_plugin/deployment_specification.rb +150 -0
  30. data/lib/instance_agent/codedeploy_plugin/hook_executor.rb +206 -0
  31. data/lib/instance_agent/codedeploy_plugin/install_instruction.rb +374 -0
  32. data/lib/instance_agent/codedeploy_plugin/installer.rb +143 -0
  33. data/lib/instance_agent/codedeploy_plugin/request_helper.rb +28 -0
  34. data/lib/instance_agent/config.rb +43 -0
  35. data/lib/instance_agent/log.rb +3 -0
  36. data/lib/instance_agent/platform.rb +17 -0
  37. data/lib/instance_agent/platform/linux_util.rb +57 -0
  38. data/lib/instance_agent/runner/child.rb +57 -0
  39. data/lib/instance_agent/runner/master.rb +103 -0
  40. data/lib/instance_metadata.rb +47 -0
  41. data/test/certificate_helper.rb +120 -0
  42. data/test/helpers/instance_agent_helper.rb +25 -0
  43. data/test/instance_agent/agent/base_test.rb +49 -0
  44. data/test/instance_agent/codedeploy_plugin/application_specification_test.rb +1710 -0
  45. data/test/instance_agent/codedeploy_plugin/codedeploy_control_test.rb +51 -0
  46. data/test/instance_agent/codedeploy_plugin/command_executor_test.rb +513 -0
  47. data/test/instance_agent/codedeploy_plugin/command_poller_test.rb +459 -0
  48. data/test/instance_agent/codedeploy_plugin/deployment_specification_test.rb +335 -0
  49. data/test/instance_agent/codedeploy_plugin/hook_executor_test.rb +250 -0
  50. data/test/instance_agent/codedeploy_plugin/install_instruction_test.rb +566 -0
  51. data/test/instance_agent/codedeploy_plugin/installer_test.rb +519 -0
  52. data/test/instance_agent/codedeploy_plugin/request_helper_test.rb +37 -0
  53. data/test/instance_agent/config_test.rb +64 -0
  54. data/test/instance_agent/runner/child_test.rb +87 -0
  55. data/test/instance_metadata_test.rb +97 -0
  56. data/test/test_helper.rb +16 -0
  57. data/vendor/gems/.codedeploy-commands-1.0.0.created.rid +1 -0
  58. data/vendor/gems/codedeploy-commands/apis/CodeDeployCommand.api.json +372 -0
  59. data/vendor/gems/codedeploy-commands/codedeploy-commands-1.0.0.gemspec +28 -0
  60. data/vendor/gems/codedeploy-commands/lib/aws/codedeploy_commands.rb +18 -0
  61. data/vendor/gems/codedeploy-commands/lib/aws/plugins/certificate_authority.rb +12 -0
  62. data/vendor/gems/codedeploy-commands/lib/aws/plugins/deploy_control_endpoint.rb +22 -0
  63. data/vendor/gems/process_manager/README.md +1 -0
  64. data/vendor/gems/process_manager/lib/blank.rb +153 -0
  65. data/vendor/gems/process_manager/lib/core_ext.rb +73 -0
  66. data/vendor/gems/process_manager/lib/process_manager.rb +49 -0
  67. data/vendor/gems/process_manager/lib/process_manager/child.rb +119 -0
  68. data/vendor/gems/process_manager/lib/process_manager/config.rb +112 -0
  69. data/vendor/gems/process_manager/lib/process_manager/log.rb +107 -0
  70. data/vendor/gems/process_manager/lib/process_manager/master.rb +322 -0
  71. data/vendor/gems/process_manager/process_manager-0.0.13.gemspec +42 -0
  72. data/vendor/specifications/aws-sdk-core-2.0.5.gemspec +39 -0
  73. data/vendor/specifications/builder-3.2.2.gemspec +29 -0
  74. data/vendor/specifications/codedeploy-commands-1.0.0.gemspec +28 -0
  75. data/vendor/specifications/gli-2.5.6.gemspec +51 -0
  76. data/vendor/specifications/jamespath-0.5.1.gemspec +35 -0
  77. data/vendor/specifications/little-plugger-1.1.3.gemspec +32 -0
  78. data/vendor/specifications/logging-1.8.1.gemspec +44 -0
  79. data/vendor/specifications/multi_json-1.7.7.gemspec +30 -0
  80. data/vendor/specifications/multi_json-1.8.4.gemspec +30 -0
  81. data/vendor/specifications/multi_xml-0.5.5.gemspec +30 -0
  82. data/vendor/specifications/process_manager-0.0.13.gemspec +42 -0
  83. data/vendor/specifications/simple_pid-0.2.1.gemspec +28 -0
  84. metadata +377 -0
@@ -0,0 +1,37 @@
1
+ require 'instance_metadata'
2
+ require 'aws/codedeploy_commands'
3
+
4
+ class CodeDeployRequestHelperTest < InstanceAgentTestCase
5
+
6
+ include InstanceAgent::CodeDeployPlugin
7
+
8
+ context "The CodeDeploy request helper" do
9
+
10
+ context "when calling verify_clients_configuration" do
11
+ setup do
12
+ ENV['AWS_REGION'] = 'us-west-2'
13
+ @deploy_client = mock('InstanceAgent::CodeDeployPlugin::CodeDeployControl')
14
+ @deploy_client.stubs(:ssl_verify_peer).returns(true)
15
+ @deploy_client.stubs(:verify_cert_fields).returns(true)
16
+
17
+ @request_helper = RequestHelper.new(:deploy_control_client => @deploy_client)
18
+
19
+ end
20
+
21
+ should "successfully call verify_clients_configuration" do
22
+ assert_equal(true, @request_helper.verify_clients_configuration.empty?)
23
+ end
24
+
25
+ should "fail if deploy client doesnt do ssl verify peer" do
26
+ @deploy_client.stubs(:ssl_verify_peer).returns(false)
27
+ assert_equal(false, @request_helper.verify_clients_configuration.empty?)
28
+ end
29
+
30
+ should "fail if deploy client cert verify failed" do
31
+ @deploy_client.stubs(:verify_cert_fields).returns(false)
32
+ assert_equal(false, @request_helper.verify_clients_configuration.empty?)
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,64 @@
1
+ require 'test_helper'
2
+
3
+ class InstanceAgentConfigTest < InstanceAgentTestCase
4
+ context 'The instance agent configuration' do
5
+
6
+ should 'have a default configuration' do
7
+ InstanceAgent::Config.init
8
+ assert_equal({
9
+ :wait_between_spawning_children => 1,
10
+ :log_dir => nil,
11
+ :pid_dir => nil,
12
+ :shared_dir => nil,
13
+ :user => nil,
14
+ :group=>nil,
15
+ :program_name => "codedeploy-agent",
16
+ :wait_after_throttle_error => 60,
17
+ :wait_between_runs => 30,
18
+ :verbose => false,
19
+ :config_file => nil,
20
+ :wait_after_connection_problem => 5,
21
+ :children => 1,
22
+ :max_runs_per_worker => 0,
23
+ :http_read_timeout => 80,
24
+ :instance_service_region => nil,
25
+ :instance_service_endpoint => nil,
26
+ :instance_service_port => nil,
27
+ :wait_between_runs => 30,
28
+ :wait_after_error => 30,
29
+ :codedeploy_test_profile => 'prod'
30
+ }, InstanceAgent::Config.config)
31
+ end
32
+
33
+ should 'be the same as the ProcessManager configuration for the current object' do
34
+ config = InstanceAgent::Config.instance_variable_get(:@config)
35
+ assert_equal config, ProcessManager::Config.instance_variable_get(:@config)
36
+ end
37
+
38
+ should 'execute all available validation methods' do
39
+ validations = sequence('validation')
40
+ err = []
41
+ InstanceAgent::Config.any_instance.expects(:validate_children).with(err).in_sequence(validations)
42
+ InstanceAgent::Config.validate_config
43
+ end
44
+
45
+ context 'validate configuration' do
46
+
47
+ setup do
48
+ InstanceAgent::Config.config[:instance_service_region] = 'eu-west-1'
49
+ InstanceAgent::Config.config[:instance_service_endpoint] = 'api-endpoint.example.com'
50
+ InstanceAgent::Config.config[:instance_service_port] = 123
51
+ end
52
+
53
+ should 'validate the children setting' do
54
+ InstanceAgent::Config.config[:children] = nil
55
+ puts InstanceAgent::Config.config.inspect
56
+ assert_equal 'children can only be set to 1', InstanceAgent::Config.validate_config.pop
57
+ InstanceAgent::Config.config[:children] = 2
58
+ assert_equal 'children can only be set to 1', InstanceAgent::Config.validate_config.pop
59
+ InstanceAgent::Config.config[:children] = 1
60
+ assert InstanceAgent::Config.validate_config.empty?, InstanceAgent::Config.validate_config.inspect
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,87 @@
1
+ require 'test_helper'
2
+
3
+ class RunnerChildTest < InstanceAgentTestCase
4
+ context 'The runner child' do
5
+ setup do
6
+ @dir = '/tmp'
7
+ @agent = mock()
8
+ InstanceAgent::CodeDeployPlugin::CommandPoller.stubs(:new).returns(@agent)
9
+ @agent.stubs(:description).returns("CommandPoller")
10
+ InstanceAgent::Runner::Child.any_instance.stubs(:trap_signals)
11
+ @child = InstanceAgent::Runner::Child.new(0, 777)
12
+ ProcessManager::Log.init(File.join(@dir, 'codedeploy-agent.log'))
13
+ ProcessManager.stubs(:set_program_name)
14
+ InstanceAgent::Config.config[:wait_after_throttle_error] = 0
15
+ InstanceAgent::Config.config[:wait_between_runs] = 0
16
+ InstanceAgent::Config.config[:wait_between_spawning_children] = 0
17
+ SimplePid.stubs(:drop)
18
+ ProcessManager.reset_on_error_callbacks
19
+ end
20
+
21
+ context 'when preparing the run' do
22
+ should 'load the correct runner' do
23
+ assert_nothing_raised do
24
+ @child = InstanceAgent::Runner::Child.new(0, 777)
25
+ @child.prepare_run
26
+ assert_equal @child.runner, @agent
27
+ end
28
+ end
29
+
30
+ should 'validate the index' do
31
+ assert_raise(ArgumentError) do
32
+ @child = InstanceAgent::Runner::Child.new(9, 777)
33
+ @child.prepare_run
34
+ end
35
+
36
+ assert_nothing_raised do
37
+ @child = InstanceAgent::Runner::Child.new(0, 777)
38
+ @child.prepare_run
39
+ end
40
+ end
41
+
42
+ context 'sets the process description' do
43
+ should 'set it for the running children' do
44
+ @child.stubs(:runner).returns(runner = mock('runner'))
45
+ runner.stubs(:description).returns 'master-process'
46
+ assert_equal 'master-process of master 777', @child.description
47
+ end
48
+
49
+ should 'set it for the booting children' do
50
+ assert_equal 'booting child', @child.description
51
+ end
52
+ end
53
+
54
+ context 'handle exceptions' do
55
+ setup do
56
+ @child.stubs(:runner).returns(runner = mock('runner'))
57
+ runner.stubs(:description).returns 'master-process'
58
+ end
59
+ should 'handle SocketErrors during the run and exit cleanly' do
60
+ InstanceAgent::Config.config[:wait_after_connection_problem] = 0
61
+ @child.expects(:runner).raises(SocketError)
62
+ ::ProcessManager::Log.expects(:info)
63
+ @child.expects(:sleep).with(0)
64
+ @child.expects(:exit).with(1)
65
+ @child.run
66
+ end
67
+
68
+ should 'handle throttling exceptions nicely' do
69
+ @child.expects(:runner).raises(Exception, 'throttle exception')
70
+ ::ProcessManager::Log.expects(:error)
71
+ @child.expects(:sleep).with(0)
72
+ @child.expects(:exit).with(1).at_least(1)
73
+
74
+ @child.run
75
+ end
76
+
77
+ should 'handle other exceptions nicely' do
78
+ @child.expects(:runner).raises(Exception, 'some exception')
79
+ ::ProcessManager::Log.expects(:error)
80
+ @child.expects(:exit).with(1)
81
+
82
+ @child.run
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,97 @@
1
+ require 'test_helper'
2
+ require 'json'
3
+
4
+ class InstanceMetadataTest < InstanceAgentTestCase
5
+
6
+ def self.should_check_status_code(&blk)
7
+ should 'raise unless status code is 200' do
8
+ @response.stubs(:code).returns(503)
9
+ assert_raise(&blk)
10
+ end
11
+ end
12
+
13
+ context 'The instance metadata service' do
14
+ setup do
15
+ region = 'us-east-1'
16
+ account_id = '123456789012'
17
+ instance_id = 'i-deadbeef'
18
+ @host_identifier = "arn:aws:ec2:#{region}:#{account_id}:instance/#{instance_id}"
19
+ @instance_document = JSON.dump({"accountId" => account_id, "region" => region, "instanceId" => instance_id})
20
+ @http = mock()
21
+ @response = mock()
22
+ @response.stubs(:code).returns("200")
23
+ @http.stubs(:get).returns(@response)
24
+ Net::HTTP.stubs(:start).yields(@http)
25
+ end
26
+
27
+ context 'getting the host identifier' do
28
+
29
+ setup do
30
+ @response.stubs(:body).returns(@instance_document)
31
+ end
32
+
33
+ should 'connect to the right host' do
34
+ Net::HTTP.expects(:start).with('169.254.169.254', 80).yields(@http)
35
+ InstanceMetadata.host_identifier
36
+ end
37
+
38
+ should 'call the correct URL' do
39
+ @http.expects(:get).
40
+ with("/latest/dynamic/instance-identity/document").
41
+ returns(@response)
42
+ InstanceMetadata.host_identifier
43
+ end
44
+
45
+ should 'return the body' do
46
+ assert_equal(@host_identifier, InstanceMetadata.host_identifier)
47
+ end
48
+
49
+ should 'strip whitesace in the body' do
50
+ @response.stubs(:body).returns(" \t#{@instance_document} ")
51
+ assert_equal(@host_identifier, InstanceMetadata.host_identifier)
52
+ end
53
+
54
+ should_check_status_code { InstanceMetadata.host_identifier }
55
+
56
+ end
57
+
58
+ context 'getting the region' do
59
+
60
+ setup do
61
+ @response.stubs(:body).returns("us-east-1a")
62
+ end
63
+
64
+ should 'connect to the right host' do
65
+ Net::HTTP.expects(:start).with('169.254.169.254', 80).yields(@http)
66
+ InstanceMetadata.region
67
+ end
68
+
69
+ should 'call the correct URL' do
70
+ @http.expects(:get).
71
+ with("/latest/meta-data/placement/availability-zone").
72
+ returns(@response)
73
+ InstanceMetadata.region
74
+ end
75
+
76
+ should 'return the region part of the AZ' do
77
+ @response.stubs(:body).returns("us-east-1a")
78
+ assert_equal("us-east-1", InstanceMetadata.region)
79
+ end
80
+
81
+ should 'raise an error if the response is not an AZ' do
82
+ @response.stubs(:body).returns("foobar")
83
+ assert_raise { InstanceMetadata.region }
84
+ end
85
+
86
+ should 'ignore whitespace in the body' do
87
+ @response.stubs(:body).returns(" \tus-east-1a ")
88
+ assert_equal("us-east-1", InstanceMetadata.region)
89
+ end
90
+
91
+ should_check_status_code { InstanceMetadata.region }
92
+
93
+ end
94
+
95
+ end
96
+
97
+ end
@@ -0,0 +1,16 @@
1
+ # encoding: UTF-8
2
+ require 'thread'
3
+ require 'rubygems'
4
+ require "bundler"
5
+ Bundler.require(:default, :test)
6
+
7
+ # test framework
8
+ require 'test/unit'
9
+ require 'active_support/testing/assertions'
10
+ require 'shoulda'
11
+ require 'mocha/setup'
12
+ require 'base64'
13
+
14
+ # require local test helpers. If you need a helper write,
15
+ # keep this pattern or you'll be punished hard
16
+ require 'helpers/instance_agent_helper'
@@ -0,0 +1 @@
1
+ Tue, 04 Nov 2014 07:48:38 +0000
@@ -0,0 +1,372 @@
1
+ {
2
+ "metadata": {
3
+ "apiVersion": "2014-10-06",
4
+ "endpointPrefix": "codedeploy-commands",
5
+ "jsonVersion": "1.1",
6
+ "regionalEndpoints": {
7
+ "us-east-1": "codedeploy-commands.us-east-1.amazonaws.com",
8
+ "us-west-2": "codedeploy-commands.us-west-2.amazonaws.com"
9
+ },
10
+ "serviceAbbreviation": "CodeDeployCommand",
11
+ "serviceFullName": "AWS CodeDeploy Command Service",
12
+ "signatureVersion": "v4",
13
+ "targetPrefix": "CodeDeployCommandService_v20141006",
14
+ "protocol": "json"
15
+ },
16
+ "documentation": "Control plane for the CodeDeploy stack. Exposes APIs needed by CodeDeploy clients to run deployment commands.",
17
+ "operations": {
18
+ "GetDeploymentSpecification": {
19
+ "name": "GetDeploymentSpecification",
20
+ "http": {
21
+ "method": "POST",
22
+ "requestUri": "/"
23
+ },
24
+ "input": {
25
+ "shape": "GetDeploymentSpecificationInput"
26
+ },
27
+ "output": {
28
+ "shape": "GetDeploymentSpecificationOutput"
29
+ },
30
+ "errors": [
31
+ {
32
+ "shape": "ClientException",
33
+ "exception": true,
34
+ "documentation": "This exception indicates that the request failed due to the fault of the customer (either an invalid request was provided, referred to a non-existant object, or another reason within the client's control)."
35
+ },
36
+ {
37
+ "shape": "ServerException",
38
+ "exception": true,
39
+ "fault": true,
40
+ "documentation": "This exception indicates that the request failed due to a problem on the server, or with the server's dependencies."
41
+ }
42
+ ],
43
+ "documentation": "Retrieve the deployment specification for the deployment and host, consisting of the client metadata provided when the deployment was created. The generic client metadata will be provided, as well as the client metadata for the host's variant (if variant-specific metadata was provided). Throws DeploymentNotFoundException if the DeploymentExecutionId does not identify a current deployment. Throws HostNotFoundException if the host is not recognized by the deployment engine. Throws ServerException for failures caused by the deployment system or its dependencies."
44
+ },
45
+ "PollHostCommand": {
46
+ "name": "PollHostCommand",
47
+ "http": {
48
+ "method": "POST",
49
+ "requestUri": "/"
50
+ },
51
+ "input": {
52
+ "shape": "PollHostCommandInput"
53
+ },
54
+ "output": {
55
+ "shape": "PollHostCommandOutput"
56
+ },
57
+ "errors": [
58
+ {
59
+ "shape": "ClientException",
60
+ "exception": true,
61
+ "documentation": "This exception indicates that the request failed due to the fault of the customer (either an invalid request was provided, referred to a non-existant object, or another reason within the client's control)."
62
+ },
63
+ {
64
+ "shape": "ServerException",
65
+ "exception": true,
66
+ "fault": true,
67
+ "documentation": "This exception indicates that the request failed due to a problem on the server, or with the server's dependencies."
68
+ }
69
+ ],
70
+ "documentation": "This requests a command from the deployment workflow engine. If no command is ready to be dispatched, the output will be empty (HostCommand will be null). Throws HostNotFoundException if the host is not recognized by the deployment engine. Throws ServerException for failures caused by the deployment system or its dependencies."
71
+ },
72
+ "PostHostCommandUpdate": {
73
+ "name": "PostHostCommandUpdate",
74
+ "http": {
75
+ "method": "POST",
76
+ "requestUri": "/"
77
+ },
78
+ "input": {
79
+ "shape": "PostHostCommandUpdateInput"
80
+ },
81
+ "output": {
82
+ "shape": "PostHostCommandUpdateOutput"
83
+ },
84
+ "errors": [
85
+ {
86
+ "shape": "ClientException",
87
+ "exception": true,
88
+ "documentation": "This exception indicates that the request failed due to the fault of the customer (either an invalid request was provided, referred to a non-existant object, or another reason within the client's control)."
89
+ },
90
+ {
91
+ "shape": "ServerException",
92
+ "exception": true,
93
+ "fault": true,
94
+ "documentation": "This exception indicates that the request failed due to a problem on the server, or with the server's dependencies."
95
+ }
96
+ ],
97
+ "documentation": "This updates the central workflow engine with the current progress of the host command. This will also return the status of the host command centrally if possible, so agents can skip processing the command if it has been aborted / timed out. However, the status is optional, so if no status is returned the agent should treat it as if it was ok to continue. Throws ClientException for an invalid HostCommandIdentifier or Diagnostics. Throws ServerException for failures caused by the deployment system or its dependencies."
98
+ },
99
+ "PutHostCommandAcknowledgement": {
100
+ "name": "PutHostCommandAcknowledgement",
101
+ "http": {
102
+ "method": "POST",
103
+ "requestUri": "/"
104
+ },
105
+ "input": {
106
+ "shape": "PutHostCommandAcknowledgementInput"
107
+ },
108
+ "output": {
109
+ "shape": "PutHostCommandAcknowledgementOutput"
110
+ },
111
+ "errors": [
112
+ {
113
+ "shape": "ClientException",
114
+ "exception": true,
115
+ "documentation": "This exception indicates that the request failed due to the fault of the customer (either an invalid request was provided, referred to a non-existant object, or another reason within the client's control)."
116
+ },
117
+ {
118
+ "shape": "ServerException",
119
+ "exception": true,
120
+ "fault": true,
121
+ "documentation": "This exception indicates that the request failed due to a problem on the server, or with the server's dependencies."
122
+ }
123
+ ],
124
+ "documentation": "This notifies the central workflow engine that the agent has received the specified command and is ready to start execution. This will also return the status of the host command centrally if possible, so agents can skip processing the command if it has been aborted / timed out. However, the status is optional, so if no status is returned the agent should treat it as if it was ok to continue. Throws ClientException for an invalid HostCommandIdentifier or Diagnostics. Throws ServerException for failures caused by the deployment system or its dependencies."
125
+ },
126
+ "PutHostCommandComplete": {
127
+ "name": "PutHostCommandComplete",
128
+ "http": {
129
+ "method": "POST",
130
+ "requestUri": "/"
131
+ },
132
+ "input": {
133
+ "shape": "PutHostCommandCompleteInput"
134
+ },
135
+ "errors": [
136
+ {
137
+ "shape": "ClientException",
138
+ "exception": true,
139
+ "documentation": "This exception indicates that the request failed due to the fault of the customer (either an invalid request was provided, referred to a non-existant object, or another reason within the client's control)."
140
+ },
141
+ {
142
+ "shape": "ServerException",
143
+ "exception": true,
144
+ "fault": true,
145
+ "documentation": "This exception indicates that the request failed due to a problem on the server, or with the server's dependencies."
146
+ }
147
+ ],
148
+ "documentation": "This reports completion of the command back to the workflow engine. Throws ClientException for an invalid HostCommandIdentifier or Diagnostics. Throws ServerException for failures caused by the deployment system or its dependencies."
149
+ }
150
+ },
151
+ "shapes": {
152
+ "ClientException": {
153
+ "type": "structure",
154
+ "members": {
155
+ },
156
+ "exception": true,
157
+ "documentation": "This exception indicates that the request failed due to the fault of the customer (either an invalid request was provided, referred to a non-existant object, or another reason within the client's control)."
158
+ },
159
+ "DeploymentCommandName": {
160
+ "type": "string"
161
+ },
162
+ "DeploymentCommandStatus": {
163
+ "type": "string",
164
+ "enum": [
165
+ "Pending",
166
+ "InProgress",
167
+ "Succeeded",
168
+ "Failed"
169
+ ]
170
+ },
171
+ "DeploymentExecutionId": {
172
+ "type": "string",
173
+ "min": 1,
174
+ "max": 129,
175
+ "pattern": "^[^/]+/[^/]+/[^/]+/.+$"
176
+ },
177
+ "DeploymentSpecification": {
178
+ "type": "structure",
179
+ "members": {
180
+ "GenericEnvelope": {
181
+ "shape": "Envelope"
182
+ },
183
+ "VariantId": {
184
+ "shape": "VariantId"
185
+ },
186
+ "VariantEnvelope": {
187
+ "shape": "Envelope"
188
+ }
189
+ },
190
+ "documentation": "The DeploymentSpecification contains an envelope for the generic client metadata, and if there is variant-specific metadata, the ID of the variant for the host and the envelope containing that variant's metadata. All fields are optional, though an empty DeploymentSpecification is likely indicative of an error."
191
+ },
192
+ "Envelope": {
193
+ "type": "structure",
194
+ "members": {
195
+ "Format": {
196
+ "shape": "Format"
197
+ },
198
+ "Payload": {
199
+ "shape": "Payload"
200
+ }
201
+ },
202
+ "documentation": "For an Envelope used for host command diagnostics, Format is limited to 64 characters and Payload is limited to 8192 characters."
203
+ },
204
+ "Format": {
205
+ "type": "string",
206
+ "min": 1,
207
+ "max": 64
208
+ },
209
+ "GenericDateTimestamp": {
210
+ "type": "timestamp"
211
+ },
212
+ "GenericLong": {
213
+ "type": "long"
214
+ },
215
+ "GenericString": {
216
+ "type": "string"
217
+ },
218
+ "GetDeploymentSpecificationInput": {
219
+ "type": "structure",
220
+ "required": [
221
+ "DeploymentExecutionId",
222
+ "HostIdentifier"
223
+ ],
224
+ "members": {
225
+ "DeploymentExecutionId": {
226
+ "shape": "DeploymentExecutionId"
227
+ },
228
+ "HostIdentifier": {
229
+ "shape": "HostIdentifier"
230
+ }
231
+ }
232
+ },
233
+ "GetDeploymentSpecificationOutput": {
234
+ "type": "structure",
235
+ "members": {
236
+ "DeploymentSystem": {
237
+ "shape": "GenericString"
238
+ },
239
+ "DeploymentSpecification": {
240
+ "shape": "DeploymentSpecification"
241
+ }
242
+ }
243
+ },
244
+ "HostCommandIdentifier": {
245
+ "type": "string"
246
+ },
247
+ "HostCommandInstance": {
248
+ "type": "structure",
249
+ "members": {
250
+ "HostCommandIdentifier": {
251
+ "shape": "HostCommandIdentifier"
252
+ },
253
+ "HostIdentifier": {
254
+ "shape": "HostIdentifier"
255
+ },
256
+ "DeploymentExecutionId": {
257
+ "shape": "DeploymentExecutionId"
258
+ },
259
+ "CommandName": {
260
+ "shape": "DeploymentCommandName"
261
+ },
262
+ "Nonce": {
263
+ "shape": "GenericLong"
264
+ }
265
+ }
266
+ },
267
+ "HostIdentifier": {
268
+ "type": "string",
269
+ "documentation": "An identifier for referring to a unit of capacity."
270
+ },
271
+ "Payload": {
272
+ "type": "string",
273
+ "min": 0,
274
+ "max": 8192
275
+ },
276
+ "PollHostCommandInput": {
277
+ "type": "structure",
278
+ "required": [
279
+ "HostIdentifier"
280
+ ],
281
+ "members": {
282
+ "HostIdentifier": {
283
+ "shape": "HostIdentifier"
284
+ }
285
+ }
286
+ },
287
+ "PollHostCommandOutput": {
288
+ "type": "structure",
289
+ "members": {
290
+ "HostCommand": {
291
+ "shape": "HostCommandInstance"
292
+ }
293
+ }
294
+ },
295
+ "PostHostCommandUpdateInput": {
296
+ "type": "structure",
297
+ "required": [
298
+ "HostCommandIdentifier"
299
+ ],
300
+ "members": {
301
+ "HostCommandIdentifier": {
302
+ "shape": "HostCommandIdentifier"
303
+ },
304
+ "EstimatedCompletionTime": {
305
+ "shape": "GenericDateTimestamp"
306
+ },
307
+ "Diagnostics": {
308
+ "shape": "Envelope"
309
+ }
310
+ }
311
+ },
312
+ "PostHostCommandUpdateOutput": {
313
+ "type": "structure",
314
+ "members": {
315
+ "CommandStatus": {
316
+ "shape": "DeploymentCommandStatus"
317
+ }
318
+ }
319
+ },
320
+ "PutHostCommandAcknowledgementInput": {
321
+ "type": "structure",
322
+ "required": [
323
+ "HostCommandIdentifier"
324
+ ],
325
+ "members": {
326
+ "HostCommandIdentifier": {
327
+ "shape": "HostCommandIdentifier"
328
+ },
329
+ "Diagnostics": {
330
+ "shape": "Envelope"
331
+ }
332
+ }
333
+ },
334
+ "PutHostCommandAcknowledgementOutput": {
335
+ "type": "structure",
336
+ "members": {
337
+ "CommandStatus": {
338
+ "shape": "DeploymentCommandStatus"
339
+ }
340
+ }
341
+ },
342
+ "PutHostCommandCompleteInput": {
343
+ "type": "structure",
344
+ "required": [
345
+ "HostCommandIdentifier",
346
+ "CommandStatus"
347
+ ],
348
+ "members": {
349
+ "HostCommandIdentifier": {
350
+ "shape": "HostCommandIdentifier"
351
+ },
352
+ "CommandStatus": {
353
+ "shape": "DeploymentCommandStatus"
354
+ },
355
+ "Diagnostics": {
356
+ "shape": "Envelope"
357
+ }
358
+ }
359
+ },
360
+ "ServerException": {
361
+ "type": "structure",
362
+ "members": {
363
+ },
364
+ "exception": true,
365
+ "fault": true,
366
+ "documentation": "This exception indicates that the request failed due to a problem on the server, or with the server's dependencies."
367
+ },
368
+ "VariantId": {
369
+ "type": "string"
370
+ }
371
+ }
372
+ }