aws-sdk 1.3.4 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/lib/aws.rb +2 -0
  2. data/lib/aws/api_config/SimpleWorkflow-2012-01-25.yml +1163 -0
  3. data/lib/aws/core.rb +16 -11
  4. data/lib/aws/core/configuration.rb +65 -47
  5. data/lib/aws/dynamo_db/item_collection.rb +2 -3
  6. data/lib/aws/dynamo_db/table.rb +2 -2
  7. data/lib/aws/ec2/collection.rb +1 -1
  8. data/lib/aws/ec2/snapshot_collection.rb +1 -1
  9. data/lib/aws/ec2/tagged_collection.rb +6 -1
  10. data/lib/aws/elb/backend_server_policy_collection.rb +1 -11
  11. data/lib/aws/elb/load_balancer.rb +4 -4
  12. data/lib/aws/elb/load_balancer_collection.rb +1 -1
  13. data/lib/aws/iam/policy.rb +1 -1
  14. data/lib/aws/record.rb +10 -4
  15. data/lib/aws/record/hash_model/finder_methods.rb +2 -3
  16. data/lib/aws/s3/bucket_lifecycle_configuration.rb +2 -2
  17. data/lib/aws/s3/policy.rb +1 -1
  18. data/lib/aws/simple_email_service.rb +8 -2
  19. data/lib/aws/simple_workflow.rb +223 -0
  20. data/lib/aws/simple_workflow/activity_task.rb +173 -0
  21. data/lib/aws/simple_workflow/activity_task_collection.rb +112 -0
  22. data/lib/aws/simple_workflow/activity_type.rb +131 -0
  23. data/lib/aws/simple_workflow/activity_type_collection.rb +93 -0
  24. data/lib/aws/simple_workflow/client.rb +57 -0
  25. data/lib/aws/simple_workflow/config.rb +18 -0
  26. data/lib/aws/simple_workflow/count.rb +49 -0
  27. data/lib/aws/simple_workflow/decision_task.rb +603 -0
  28. data/lib/aws/simple_workflow/decision_task_collection.rb +213 -0
  29. data/lib/aws/simple_workflow/domain.rb +122 -0
  30. data/lib/aws/simple_workflow/domain_collection.rb +169 -0
  31. data/lib/aws/simple_workflow/errors.rb +57 -0
  32. data/lib/aws/simple_workflow/history_event.rb +276 -0
  33. data/lib/aws/simple_workflow/history_event_collection.rb +76 -0
  34. data/lib/aws/simple_workflow/option_formatters.rb +75 -0
  35. data/lib/aws/simple_workflow/request.rb +80 -0
  36. data/lib/aws/simple_workflow/resource.rb +94 -0
  37. data/lib/aws/simple_workflow/type.rb +89 -0
  38. data/lib/aws/simple_workflow/type_collection.rb +139 -0
  39. data/lib/aws/simple_workflow/workflow_execution.rb +386 -0
  40. data/lib/aws/simple_workflow/workflow_execution_collection.rb +617 -0
  41. data/lib/aws/simple_workflow/workflow_type.rb +177 -0
  42. data/lib/aws/simple_workflow/workflow_type_collection.rb +91 -0
  43. data/lib/aws/sns/policy.rb +1 -1
  44. data/lib/aws/sns/subscription.rb +2 -2
  45. data/lib/aws/sqs/errors.rb +2 -2
  46. data/lib/aws/sqs/policy.rb +1 -1
  47. metadata +111 -54
@@ -0,0 +1,177 @@
1
+ # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ require 'uuidtools'
15
+
16
+ module AWS
17
+ class SimpleWorkflow
18
+
19
+ # == Registering a WorkflowType
20
+ #
21
+ # To register a workflow type you should use the #workflow_types method
22
+ # on the domain:
23
+ #
24
+ # domain.workflow_types.register('name', 'version', { ... })
25
+ #
26
+ # See {WorkflowTypeCollection#register} for a complete list of options.
27
+ #
28
+ # == Deprecating a workflwo type
29
+ #
30
+ # WorkflowType inherits from the generic {Type} base class. Defined in
31
+ # {Type} are a few useful methods including:
32
+ #
33
+ # * {Type#deprecate}
34
+ # * {Type#deprecated?}
35
+ #
36
+ # You can use these to deprecate a workflow type:
37
+ #
38
+ # domain.workflow_types['name','version'].deprecate
39
+ #
40
+ # @attr_reader [Time] creation_date When the workflow type was registered.
41
+ #
42
+ # @attr_reader [Time,nil] deprecation_date When the workflow type
43
+ # was deprecated, or nil if the workflow type has not been deprecated.
44
+ #
45
+ # @attr_reader [String,nil] description The description of this workflow
46
+ # type, or nil if was not set when it was registered.
47
+ #
48
+ # @attr_reader [Symbol] status The status of this workflow type. The
49
+ # status will either be +:registered+ or +:deprecated+.
50
+ #
51
+ # @attr_reader [Symbol,nil] default_child_policy Specifies the default
52
+ # policy to use for the child workflow executions when a workflow
53
+ # execution of this type is terminated. Values may be one of the
54
+ # following (or nil):
55
+ #
56
+ # * +:terminate+ - the child executions will be terminated.
57
+ #
58
+ # * +:request_cancel+ - a request to cancel will be attempted for each
59
+ # child execution by recording a WorkflowExecutionCancelRequested
60
+ # event in its history. It is up to the decider to take appropriate
61
+ # actions when it receives an execution history with this event.
62
+ #
63
+ # * +:abandon+ - no action will be taken. The child executions will
64
+ # continue to run.
65
+ #
66
+ # @attr_reader [Integer,:none,nil] default_execution_start_to_close_timeout
67
+ # The default maximum duration for executions of this workflow type.
68
+ #
69
+ # The return value may be an integer (number of seconds), the
70
+ # symbol +:none+ (implying no timeout) or +nil+ (not specified).
71
+ #
72
+ # @attr_reader [String,nil] default_task_list Specifies
73
+ # the default task list to use for scheduling decision tasks for
74
+ # executions of this workflow type.
75
+ #
76
+ # @attr_reader [Integer,:none,nil] default_task_start_to_close_timeout
77
+ # The default maximum duration of decision tasks for this workflow type.
78
+ #
79
+ # The return value may be an integer (number of seconds), the
80
+ # symbol +:none+ (implying no timeout) or +nil+ (not specified).
81
+ #
82
+ class WorkflowType < Type
83
+
84
+ include OptionFormatters
85
+
86
+ type_attribute :creation_date, :timestamp => true
87
+
88
+ type_attribute :deprecation_date, :timestamp => true, :static => false
89
+
90
+ type_attribute :description
91
+
92
+ type_attribute :status, :to_sym => true, :static => false
93
+
94
+ config_attribute :default_child_policy, :to_sym => true
95
+
96
+ config_attribute :default_execution_start_to_close_timeout,
97
+ :duration => true
98
+
99
+ config_attribute :default_task_list do
100
+ translates_output {|v| v['name'] }
101
+ end
102
+
103
+ config_attribute :default_task_start_to_close_timeout,
104
+ :duration => true
105
+
106
+ # @param [Hash] options
107
+ #
108
+ # @option (see DecisionTask#continue_as_new_workflow_execution)
109
+ #
110
+ # @option options [String] :workflow_id
111
+ # A user defined identifier associated with the workflow execution.
112
+ # You can use this to associate a custom identifier with the
113
+ # workflow execution. You may specify the same identifier if a
114
+ # workflow execution is logically a restart of a previous execution.
115
+ # You cannot have two open workflow executions with the same
116
+ # :workflow_id at the same time.
117
+ #
118
+ # If you do not provide +:workflow_id+ a random UUID will be generated.
119
+ #
120
+ # @return [WorkflowExecution] Returns the new workflow execution.
121
+ #
122
+ def start_execution options = {}
123
+
124
+ options[:domain] = domain.name
125
+ start_execution_opts(options, self)
126
+ response = client.start_workflow_execution(options)
127
+
128
+ workflow_id = options[:workflow_id]
129
+ run_id = response.data['runId']
130
+
131
+ domain.workflow_executions[workflow_id, run_id]
132
+
133
+ end
134
+
135
+ # Returns a count of workflow executions of this workflow type.
136
+ #
137
+ # domain.workflow_types['name','version'].count
138
+ #
139
+ # @note (see WorkflowExecution#count_executions)
140
+ # @param (see WorkflowExecution#count_executions)
141
+ # @option (see WorkflowExecution#count_executions)
142
+ # @return [Integer] Returns the count of workflow execution of this type.
143
+ def count_executions options = {}
144
+ options[:workflow_type] = self
145
+ domain.workflow_executions.count(options)
146
+ end
147
+
148
+ # @return [WorkflowExecutionCollection] Returns a collection that
149
+ # enumerates only workflow executions of this type.
150
+ def workflow_executions
151
+ WorkflowExecutionCollection.new(domain).with_workflow_type(self)
152
+ end
153
+
154
+ # list workflow type only provides type attributes
155
+ provider(:list_workflow_types) do |provider|
156
+ provider.provides *type_attributes.keys
157
+ provider.find do |resp|
158
+ desc = resp.data['typeInfos'].find do |info|
159
+ info[self.class.type_key] == { 'name' => name, 'version' => version }
160
+ end
161
+ end
162
+ end
163
+
164
+ # describe workflow type provides type and config attributes
165
+ provider(:describe_workflow_type) do |provider|
166
+ provider.provides *type_attributes.keys
167
+ provider.provides *config_attributes.keys
168
+ provider.find do |resp|
169
+ type = { 'name' => name, 'version' => version }
170
+ resp.data['typeInfo'][self.class.type_key] == type ?
171
+ resp.data['typeInfo'].merge(resp.data['configuration']) : nil
172
+ end
173
+ end
174
+
175
+ end
176
+ end
177
+ end
@@ -0,0 +1,91 @@
1
+ # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ module AWS
15
+ class SimpleWorkflow
16
+
17
+ class WorkflowTypeCollection < TypeCollection
18
+
19
+ # Registers a new workflow type and its configuration settings for
20
+ # in the current domain.
21
+ #
22
+ # @param [String] name The name of the workflow type.
23
+ #
24
+ # @param [String] version The version of the workflow type.
25
+ # The workflow type consists of the name and version, the
26
+ # combination of which must be unique within the domain.
27
+ #
28
+ # @param [Hash] options
29
+ #
30
+ # @option options [Symbol] :default_child_policy (nil) Specifies the default
31
+ # policy to use for the child workflow executions when a workflow
32
+ # execution of this type is terminated. This default can be
33
+ # overridden when starting a workflow execution. The supported child
34
+ # policies are:
35
+ #
36
+ # * +:terminate+ - the child executions will be terminated.
37
+ #
38
+ # * +:request_cancel+ - a request to cancel will be attempted for each
39
+ # child execution by recording a WorkflowExecutionCancelRequested
40
+ # event in its history. It is up to the decider to take appropriate
41
+ # actions when it receives an execution history with this event.
42
+ #
43
+ # * +:abandon+ - no action will be taken. The child executions will
44
+ # continue to run.
45
+ #
46
+ # @option options [Integer,:none] :default_execution_start_to_close_timeout (nil)
47
+ # The default maximum duration for executions of this workflow type.
48
+ # You can override this default when starting an execution.
49
+ # The value should be a number of seconds (integer) or the symbol
50
+ # +:none+ (implying no timeout).
51
+ #
52
+ # @option options [String] :default_task_list (nil) Specifies
53
+ # the default task list to use for scheduling decision tasks for
54
+ # executions of this workflow type. This default is used only if
55
+ # a task list is not provided when starting the workflow execution.
56
+ #
57
+ # @option options [Integer,:none] :default_task_start_to_close_timeout (nil)
58
+ # The default maximum duration of decision tasks for this workflow type.
59
+ #
60
+ # The value should be a number of seconds (integer) or the symbol
61
+ # +:none+ (implying no timeout).
62
+ #
63
+ # @option options [String] :description (nil) Textual description of
64
+ # the workflow type.
65
+ #
66
+ def register name, version, options = {}
67
+
68
+ options[:domain] = domain.name
69
+ options[:name] = name
70
+ options[:version] = version
71
+
72
+ upcase_opts(options, :default_child_policy)
73
+
74
+ duration_opts(options,
75
+ :default_execution_start_to_close_timeout,
76
+ :default_task_start_to_close_timeout)
77
+
78
+ if task_list = options[:default_task_list]
79
+ options[:default_task_list] = { :name => task_list.to_s }
80
+ end
81
+
82
+ client.register_workflow_type(options)
83
+
84
+ self[name, version]
85
+
86
+ end
87
+ alias_method :create, :register
88
+
89
+ end
90
+ end
91
+ end
@@ -14,7 +14,7 @@
14
14
  module AWS
15
15
  class SNS
16
16
 
17
- # @see Core::Policy
17
+ # (see Core::Policy)
18
18
  class Policy < Core::Policy
19
19
 
20
20
  class Statement < Core::Policy::Statement
@@ -119,10 +119,10 @@ module AWS
119
119
 
120
120
  # @return [Boolean] Returns true if the subscriptions have the same
121
121
  # resource ARN.
122
- def ==(other)
122
+ def eql? other
123
123
  other.kind_of?(Subscription) and other.arn == arn
124
124
  end
125
- alias_method :eql?, :==
125
+ alias_method :==, :eql?
126
126
 
127
127
  protected
128
128
  def update_delivery_policy policy_json
@@ -84,8 +84,8 @@ module AWS
84
84
  super("Failed to send #{failures.size} messages")
85
85
  end
86
86
 
87
- # @return [Array<SentMessage>] Returns a list of {SentMessage}
88
- # objects.
87
+ # @return [Array<Queue::SentMessage>] Returns a list of
88
+ # {Queue::SentMessage} objects.
89
89
  attr_reader :sent
90
90
 
91
91
  # @return [Array<Hash>] Returns a list of hashes. Each hash
@@ -14,7 +14,7 @@
14
14
  module AWS
15
15
  class SQS
16
16
 
17
- # @see Core::Policy
17
+ # (see Core::Policy)
18
18
  class Policy < Core::Policy
19
19
 
20
20
  class Statement < Core::Policy::Statement
metadata CHANGED
@@ -1,66 +1,92 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk
3
- version: !ruby/object:Gem::Version
4
- version: 1.3.4
3
+ version: !ruby/object:Gem::Version
4
+ hash: 17
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 3
9
+ - 5
10
+ version: 1.3.5
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Amazon Web Services
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-02-09 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: uuidtools
16
- requirement: &2178333900 !ruby/object:Gem::Requirement
17
+
18
+ date: 2012-02-21 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ prerelease: false
22
+ type: :runtime
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
25
+ requirements:
19
26
  - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '2.1'
22
- type: :runtime
27
+ - !ruby/object:Gem::Version
28
+ hash: 1
29
+ segments:
30
+ - 2
31
+ - 1
32
+ version: "2.1"
33
+ name: uuidtools
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
23
36
  prerelease: false
24
- version_requirements: *2178333900
25
- - !ruby/object:Gem::Dependency
26
- name: httparty
27
- requirement: &2178333160 !ruby/object:Gem::Requirement
37
+ type: :runtime
38
+ requirement: &id002 !ruby/object:Gem::Requirement
28
39
  none: false
29
- requirements:
40
+ requirements:
30
41
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: '0.7'
33
- type: :runtime
42
+ - !ruby/object:Gem::Version
43
+ hash: 5
44
+ segments:
45
+ - 0
46
+ - 7
47
+ version: "0.7"
48
+ name: httparty
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
34
51
  prerelease: false
35
- version_requirements: *2178333160
36
- - !ruby/object:Gem::Dependency
37
- name: nokogiri
38
- requirement: &2178332320 !ruby/object:Gem::Requirement
52
+ type: :runtime
53
+ requirement: &id003 !ruby/object:Gem::Requirement
39
54
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 15
59
+ segments:
60
+ - 1
61
+ - 4
62
+ - 4
43
63
  version: 1.4.4
44
- type: :runtime
64
+ name: nokogiri
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
45
67
  prerelease: false
46
- version_requirements: *2178332320
47
- - !ruby/object:Gem::Dependency
48
- name: json
49
- requirement: &2178331680 !ruby/object:Gem::Requirement
68
+ type: :runtime
69
+ requirement: &id004 !ruby/object:Gem::Requirement
50
70
  none: false
51
- requirements:
71
+ requirements:
52
72
  - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '1.4'
55
- type: :runtime
56
- prerelease: false
57
- version_requirements: *2178331680
73
+ - !ruby/object:Gem::Version
74
+ hash: 7
75
+ segments:
76
+ - 1
77
+ - 4
78
+ version: "1.4"
79
+ name: json
80
+ version_requirements: *id004
58
81
  description: AWS SDK for Ruby
59
82
  email:
60
83
  executables: []
84
+
61
85
  extensions: []
86
+
62
87
  extra_rdoc_files: []
63
- files:
88
+
89
+ files:
64
90
  - ca-bundle.crt
65
91
  - rails/init.rb
66
92
  - lib/aws/core/api_config.rb
@@ -311,6 +337,30 @@ files:
311
337
  - lib/aws/simple_email_service/quotas.rb
312
338
  - lib/aws/simple_email_service/request.rb
313
339
  - lib/aws/simple_email_service.rb
340
+ - lib/aws/simple_workflow/activity_task.rb
341
+ - lib/aws/simple_workflow/activity_task_collection.rb
342
+ - lib/aws/simple_workflow/activity_type.rb
343
+ - lib/aws/simple_workflow/activity_type_collection.rb
344
+ - lib/aws/simple_workflow/client.rb
345
+ - lib/aws/simple_workflow/config.rb
346
+ - lib/aws/simple_workflow/count.rb
347
+ - lib/aws/simple_workflow/decision_task.rb
348
+ - lib/aws/simple_workflow/decision_task_collection.rb
349
+ - lib/aws/simple_workflow/domain.rb
350
+ - lib/aws/simple_workflow/domain_collection.rb
351
+ - lib/aws/simple_workflow/errors.rb
352
+ - lib/aws/simple_workflow/history_event.rb
353
+ - lib/aws/simple_workflow/history_event_collection.rb
354
+ - lib/aws/simple_workflow/option_formatters.rb
355
+ - lib/aws/simple_workflow/request.rb
356
+ - lib/aws/simple_workflow/resource.rb
357
+ - lib/aws/simple_workflow/type.rb
358
+ - lib/aws/simple_workflow/type_collection.rb
359
+ - lib/aws/simple_workflow/workflow_execution.rb
360
+ - lib/aws/simple_workflow/workflow_execution_collection.rb
361
+ - lib/aws/simple_workflow/workflow_type.rb
362
+ - lib/aws/simple_workflow/workflow_type_collection.rb
363
+ - lib/aws/simple_workflow.rb
314
364
  - lib/aws/sns/client/xml.rb
315
365
  - lib/aws/sns/client.rb
316
366
  - lib/aws/sns/config.rb
@@ -355,6 +405,7 @@ files:
355
405
  - lib/aws/api_config/IAM-2010-05-08.yml
356
406
  - lib/aws/api_config/SimpleDB-2009-04-15.yml
357
407
  - lib/aws/api_config/SimpleEmailService-2010-12-01.yml
408
+ - lib/aws/api_config/SimpleWorkflow-2012-01-25.yml
358
409
  - lib/aws/api_config/SNS-2010-03-31.yml
359
410
  - lib/aws/api_config/SQS-2011-10-01.yml
360
411
  - lib/aws/api_config/STS-2011-06-15.yml
@@ -364,31 +415,37 @@ files:
364
415
  - NOTICE.txt
365
416
  - LICENSE.txt
366
417
  homepage: http://aws.amazon.com/sdkforruby
367
- licenses:
418
+ licenses:
368
419
  - Apache 2.0
369
420
  post_install_message:
370
421
  rdoc_options: []
371
- require_paths:
422
+
423
+ require_paths:
372
424
  - lib
373
- required_ruby_version: !ruby/object:Gem::Requirement
425
+ required_ruby_version: !ruby/object:Gem::Requirement
374
426
  none: false
375
- requirements:
376
- - - ! '>='
377
- - !ruby/object:Gem::Version
378
- version: '0'
379
- segments:
427
+ requirements:
428
+ - - ">="
429
+ - !ruby/object:Gem::Version
430
+ hash: 3
431
+ segments:
380
432
  - 0
381
- hash: 2879492431833111040
382
- required_rubygems_version: !ruby/object:Gem::Requirement
433
+ version: "0"
434
+ required_rubygems_version: !ruby/object:Gem::Requirement
383
435
  none: false
384
- requirements:
385
- - - ! '>='
386
- - !ruby/object:Gem::Version
387
- version: '0'
436
+ requirements:
437
+ - - ">="
438
+ - !ruby/object:Gem::Version
439
+ hash: 3
440
+ segments:
441
+ - 0
442
+ version: "0"
388
443
  requirements: []
444
+
389
445
  rubyforge_project:
390
446
  rubygems_version: 1.8.15
391
447
  signing_key:
392
448
  specification_version: 3
393
449
  summary: AWS SDK for Ruby
394
450
  test_files: []
451
+