aws-sdk-autoscaling 1.0.0.rc1 → 1.0.0.rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/aws-sdk-autoscaling.rb +2 -2
- data/lib/aws-sdk-autoscaling/activity.rb +131 -133
- data/lib/aws-sdk-autoscaling/auto_scaling_group.rb +940 -942
- data/lib/aws-sdk-autoscaling/client.rb +3146 -2674
- data/lib/aws-sdk-autoscaling/client_api.rb +1403 -1405
- data/lib/aws-sdk-autoscaling/errors.rb +4 -13
- data/lib/aws-sdk-autoscaling/instance.rb +351 -359
- data/lib/aws-sdk-autoscaling/launch_configuration.rb +198 -200
- data/lib/aws-sdk-autoscaling/lifecycle_hook.rb +288 -290
- data/lib/aws-sdk-autoscaling/load_balancer.rb +179 -187
- data/lib/aws-sdk-autoscaling/notification_configuration.rb +162 -167
- data/lib/aws-sdk-autoscaling/resource.rb +645 -647
- data/lib/aws-sdk-autoscaling/scaling_policy.rb +216 -218
- data/lib/aws-sdk-autoscaling/scheduled_action.rb +152 -154
- data/lib/aws-sdk-autoscaling/tag.rb +216 -224
- data/lib/aws-sdk-autoscaling/types.rb +3987 -3547
- data/lib/aws-sdk-autoscaling/waiters.rb +126 -127
- metadata +2 -2
@@ -1,183 +1,181 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
module Aws::AutoScaling
|
9
|
+
class ScheduledAction
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(name, options = {})
|
14
|
+
# @param [String] name
|
15
|
+
# @option options [Client] :client
|
16
|
+
# @overload def initialize(options = {})
|
17
|
+
# @option options [required, String] :name
|
18
|
+
# @option options [Client] :client
|
19
|
+
def initialize(*args)
|
20
|
+
options = Hash === args.last ? args.pop.dup : {}
|
21
|
+
@name = extract_name(args, options)
|
22
|
+
@data = options.delete(:data)
|
23
|
+
@client = options.delete(:client) || Client.new(options)
|
24
|
+
end
|
26
25
|
|
27
|
-
|
26
|
+
# @!group Read-Only Attributes
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
# @return [String]
|
29
|
+
def name
|
30
|
+
@name
|
31
|
+
end
|
32
|
+
alias :scheduled_action_name :name
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
# The name of the group.
|
35
|
+
# @return [String]
|
36
|
+
def auto_scaling_group_name
|
37
|
+
data.auto_scaling_group_name
|
38
|
+
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
# The Amazon Resource Name (ARN) of the scheduled action.
|
41
|
+
# @return [String]
|
42
|
+
def scheduled_action_arn
|
43
|
+
data.scheduled_action_arn
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
46
|
+
# This parameter is deprecated.
|
47
|
+
# @return [Time]
|
48
|
+
def time
|
49
|
+
data.time
|
50
|
+
end
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
52
|
+
# The date and time that the action is scheduled to begin. This date and
|
53
|
+
# time can be up to one month in the future.
|
54
|
+
#
|
55
|
+
# When `StartTime` and `EndTime` are specified with `Recurrence`, they
|
56
|
+
# form the boundaries of when the recurring action will start and stop.
|
57
|
+
# @return [Time]
|
58
|
+
def start_time
|
59
|
+
data.start_time
|
60
|
+
end
|
62
61
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
62
|
+
# The date and time that the action is scheduled to end. This date and
|
63
|
+
# time can be up to one month in the future.
|
64
|
+
# @return [Time]
|
65
|
+
def end_time
|
66
|
+
data.end_time
|
67
|
+
end
|
69
68
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
69
|
+
# The recurring schedule for the action.
|
70
|
+
# @return [String]
|
71
|
+
def recurrence
|
72
|
+
data.recurrence
|
73
|
+
end
|
75
74
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
# The minimum size of the group.
|
76
|
+
# @return [Integer]
|
77
|
+
def min_size
|
78
|
+
data.min_size
|
79
|
+
end
|
81
80
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
81
|
+
# The maximum size of the group.
|
82
|
+
# @return [Integer]
|
83
|
+
def max_size
|
84
|
+
data.max_size
|
85
|
+
end
|
87
86
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
87
|
+
# The number of instances you prefer to maintain in the group.
|
88
|
+
# @return [Integer]
|
89
|
+
def desired_capacity
|
90
|
+
data.desired_capacity
|
91
|
+
end
|
93
92
|
|
94
|
-
|
93
|
+
# @!endgroup
|
95
94
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
95
|
+
# @return [Client]
|
96
|
+
def client
|
97
|
+
@client
|
98
|
+
end
|
100
99
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
100
|
+
# Loads, or reloads {#data} for the current {ScheduledAction}.
|
101
|
+
# Returns `self` making it possible to chain methods.
|
102
|
+
#
|
103
|
+
# scheduled_action.reload.data
|
104
|
+
#
|
105
|
+
# @return [self]
|
106
|
+
def load
|
107
|
+
resp = @client.describe_scheduled_actions(scheduled_action_names: [@name])
|
108
|
+
@data = resp.scheduledupdategroupactions[0]
|
109
|
+
self
|
110
|
+
end
|
111
|
+
alias :reload :load
|
112
|
+
|
113
|
+
# @return [Types::ScheduledUpdateGroupAction]
|
114
|
+
# Returns the data for this {ScheduledAction}. Calls
|
115
|
+
# {Client#describe_scheduled_actions} if {#data_loaded?} is `false`.
|
116
|
+
def data
|
117
|
+
load unless @data
|
118
|
+
@data
|
119
|
+
end
|
121
120
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
121
|
+
# @return [Boolean]
|
122
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
123
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
124
|
+
def data_loaded?
|
125
|
+
!!@data
|
126
|
+
end
|
128
127
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
128
|
+
# @!group Actions
|
129
|
+
|
130
|
+
# @example Request syntax with placeholder values
|
131
|
+
#
|
132
|
+
# scheduled_action.delete({
|
133
|
+
# auto_scaling_group_name: "ResourceName", # required
|
134
|
+
# })
|
135
|
+
# @param [Hash] options ({})
|
136
|
+
# @option options [required, String] :auto_scaling_group_name
|
137
|
+
# The name of the Auto Scaling group.
|
138
|
+
# @return [EmptyStructure]
|
139
|
+
def delete(options = {})
|
140
|
+
options = options.merge(scheduled_action_name: @name)
|
141
|
+
resp = @client.delete_scheduled_action(options)
|
142
|
+
resp.data
|
143
|
+
end
|
145
144
|
|
146
|
-
|
147
|
-
|
148
|
-
# @return [AutoScalingGroup, nil]
|
149
|
-
def group
|
150
|
-
if data.auto_scaling_group_name
|
151
|
-
AutoScalingGroup.new(
|
152
|
-
name: data.auto_scaling_group_name,
|
153
|
-
client: @client
|
154
|
-
)
|
155
|
-
else
|
156
|
-
nil
|
157
|
-
end
|
158
|
-
end
|
145
|
+
# @!group Associations
|
159
146
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
def extract_name(args, options)
|
170
|
-
value = args[0] || options.delete(:name)
|
171
|
-
case value
|
172
|
-
when String then value
|
173
|
-
when nil then raise ArgumentError, "missing required option :name"
|
174
|
-
else
|
175
|
-
msg = "expected :name to be a String, got #{value.class}"
|
176
|
-
raise ArgumentError, msg
|
177
|
-
end
|
147
|
+
# @return [AutoScalingGroup, nil]
|
148
|
+
def group
|
149
|
+
if data.auto_scaling_group_name
|
150
|
+
AutoScalingGroup.new(
|
151
|
+
name: data.auto_scaling_group_name,
|
152
|
+
client: @client
|
153
|
+
)
|
154
|
+
else
|
155
|
+
nil
|
178
156
|
end
|
157
|
+
end
|
179
158
|
|
180
|
-
|
159
|
+
# @deprecated
|
160
|
+
# @api private
|
161
|
+
def identifiers
|
162
|
+
{ name: @name }
|
181
163
|
end
|
164
|
+
deprecated(:identifiers)
|
165
|
+
|
166
|
+
private
|
167
|
+
|
168
|
+
def extract_name(args, options)
|
169
|
+
value = args[0] || options.delete(:name)
|
170
|
+
case value
|
171
|
+
when String then value
|
172
|
+
when nil then raise ArgumentError, "missing required option :name"
|
173
|
+
else
|
174
|
+
msg = "expected :name to be a String, got #{value.class}"
|
175
|
+
raise ArgumentError, msg
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
class Collection < Aws::Resources::Collection; end
|
182
180
|
end
|
183
181
|
end
|
@@ -1,260 +1,252 @@
|
|
1
1
|
# WARNING ABOUT GENERATED CODE
|
2
2
|
#
|
3
|
-
# This file is generated. See the contributing for
|
3
|
+
# This file is generated. See the contributing guide for more information:
|
4
4
|
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
|
5
5
|
#
|
6
6
|
# WARNING ABOUT GENERATED CODE
|
7
7
|
|
8
|
-
module Aws
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
|
-
# @!group Read-Only Attributes
|
34
|
-
|
35
|
-
# @return [String]
|
36
|
-
def key
|
37
|
-
@key
|
38
|
-
end
|
8
|
+
module Aws::AutoScaling
|
9
|
+
class Tag
|
10
|
+
|
11
|
+
extend Aws::Deprecations
|
12
|
+
|
13
|
+
# @overload def initialize(key, resource_id, resource_type, options = {})
|
14
|
+
# @param [String] key
|
15
|
+
# @param [String] resource_id
|
16
|
+
# @param [String] resource_type
|
17
|
+
# @option options [Client] :client
|
18
|
+
# @overload def initialize(options = {})
|
19
|
+
# @option options [required, String] :key
|
20
|
+
# @option options [required, String] :resource_id
|
21
|
+
# @option options [required, String] :resource_type
|
22
|
+
# @option options [Client] :client
|
23
|
+
def initialize(*args)
|
24
|
+
options = Hash === args.last ? args.pop.dup : {}
|
25
|
+
@key = extract_key(args, options)
|
26
|
+
@resource_id = extract_resource_id(args, options)
|
27
|
+
@resource_type = extract_resource_type(args, options)
|
28
|
+
@data = options.delete(:data)
|
29
|
+
@client = options.delete(:client) || Client.new(options)
|
30
|
+
end
|
39
31
|
|
40
|
-
|
41
|
-
def resource_id
|
42
|
-
@resource_id
|
43
|
-
end
|
32
|
+
# @!group Read-Only Attributes
|
44
33
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
34
|
+
# @return [String]
|
35
|
+
def key
|
36
|
+
@key
|
37
|
+
end
|
49
38
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
39
|
+
# @return [String]
|
40
|
+
def resource_id
|
41
|
+
@resource_id
|
42
|
+
end
|
55
43
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
data.propagate_at_launch
|
61
|
-
end
|
44
|
+
# @return [String]
|
45
|
+
def resource_type
|
46
|
+
@resource_type
|
47
|
+
end
|
62
48
|
|
63
|
-
|
49
|
+
# The tag value.
|
50
|
+
# @return [String]
|
51
|
+
def value
|
52
|
+
data.value
|
53
|
+
end
|
64
54
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
55
|
+
# Determines whether the tag is added to new instances as they are
|
56
|
+
# launched in the group.
|
57
|
+
# @return [Boolean]
|
58
|
+
def propagate_at_launch
|
59
|
+
data.propagate_at_launch
|
60
|
+
end
|
69
61
|
|
70
|
-
|
71
|
-
# Returns `self` making it possible to chain methods.
|
72
|
-
#
|
73
|
-
# tag.reload.data
|
74
|
-
#
|
75
|
-
# @return [self]
|
76
|
-
def load
|
77
|
-
resp = @client.describe_tags(filters: [
|
78
|
-
{
|
79
|
-
name: "key",
|
80
|
-
values: [@key]
|
81
|
-
},
|
82
|
-
{
|
83
|
-
name: @resource_type,
|
84
|
-
values: [@resource_id]
|
85
|
-
}
|
86
|
-
])
|
87
|
-
@data = resp.tags[0]
|
88
|
-
self
|
89
|
-
end
|
90
|
-
alias :reload :load
|
62
|
+
# @!endgroup
|
91
63
|
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
load unless @data
|
97
|
-
@data
|
98
|
-
end
|
64
|
+
# @return [Client]
|
65
|
+
def client
|
66
|
+
@client
|
67
|
+
end
|
99
68
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
69
|
+
# Loads, or reloads {#data} for the current {Tag}.
|
70
|
+
# Returns `self` making it possible to chain methods.
|
71
|
+
#
|
72
|
+
# tag.reload.data
|
73
|
+
#
|
74
|
+
# @return [self]
|
75
|
+
def load
|
76
|
+
resp = @client.describe_tags(filters: [
|
77
|
+
{
|
78
|
+
name: "key",
|
79
|
+
values: [@key]
|
80
|
+
},
|
81
|
+
{
|
82
|
+
name: @resource_type,
|
83
|
+
values: [@resource_id]
|
84
|
+
}
|
85
|
+
])
|
86
|
+
@data = resp.tags[0]
|
87
|
+
self
|
88
|
+
end
|
89
|
+
alias :reload :load
|
90
|
+
|
91
|
+
# @return [Types::TagDescription]
|
92
|
+
# Returns the data for this {Tag}. Calls
|
93
|
+
# {Client#describe_tags} if {#data_loaded?} is `false`.
|
94
|
+
def data
|
95
|
+
load unless @data
|
96
|
+
@data
|
97
|
+
end
|
106
98
|
|
107
|
-
|
99
|
+
# @return [Boolean]
|
100
|
+
# Returns `true` if this resource is loaded. Accessing attributes or
|
101
|
+
# {#data} on an unloaded resource will trigger a call to {#load}.
|
102
|
+
def data_loaded?
|
103
|
+
!!@data
|
104
|
+
end
|
108
105
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
106
|
+
# @!group Actions
|
107
|
+
|
108
|
+
# @example Request syntax with placeholder values
|
109
|
+
#
|
110
|
+
# tag.create({
|
111
|
+
# tags: [ # required
|
112
|
+
# {
|
113
|
+
# resource_id: "XmlString",
|
114
|
+
# resource_type: "XmlString",
|
115
|
+
# key: "TagKey", # required
|
116
|
+
# value: "TagValue",
|
117
|
+
# propagate_at_launch: false,
|
118
|
+
# },
|
119
|
+
# ],
|
120
|
+
# })
|
121
|
+
# @param [Hash] options ({})
|
122
|
+
# @option options [required, Array<Types::Tag>] :tags
|
123
|
+
# One or more tags.
|
124
|
+
# @return [EmptyStructure]
|
125
|
+
def create(options = {})
|
126
|
+
options = Aws::Util.deep_merge(options, tags: [{
|
127
|
+
resource_type: @resource_type,
|
128
|
+
resource_id: @resource_id,
|
129
|
+
key: @key
|
130
|
+
}])
|
131
|
+
resp = @client.create_or_update_tags(options)
|
132
|
+
resp.data
|
133
|
+
end
|
135
134
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
135
|
+
# @example Request syntax with placeholder values
|
136
|
+
#
|
137
|
+
# tag.delete({
|
138
|
+
# tags: [ # required
|
139
|
+
# {
|
140
|
+
# resource_id: "XmlString",
|
141
|
+
# resource_type: "XmlString",
|
142
|
+
# key: "TagKey", # required
|
143
|
+
# value: "TagValue",
|
144
|
+
# propagate_at_launch: false,
|
145
|
+
# },
|
146
|
+
# ],
|
147
|
+
# })
|
148
|
+
# @param [Hash] options ({})
|
149
|
+
# @option options [required, Array<Types::Tag>] :tags
|
150
|
+
# One or more tags.
|
151
|
+
# @return [EmptyStructure]
|
152
|
+
def delete(options = {})
|
153
|
+
options = Aws::Util.deep_merge(options, tags: [{
|
154
|
+
resource_type: @resource_type,
|
155
|
+
resource_id: @resource_id,
|
156
|
+
key: @key
|
157
|
+
}])
|
158
|
+
resp = @client.delete_tags(options)
|
159
|
+
resp.data
|
160
|
+
end
|
162
161
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
162
|
+
# @deprecated
|
163
|
+
# @api private
|
164
|
+
def identifiers
|
165
|
+
{
|
166
|
+
key: @key,
|
167
|
+
resource_id: @resource_id,
|
168
|
+
resource_type: @resource_type
|
169
|
+
}
|
170
|
+
end
|
171
|
+
deprecated(:identifiers)
|
173
172
|
|
174
|
-
|
173
|
+
private
|
175
174
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
end
|
175
|
+
def extract_key(args, options)
|
176
|
+
value = args[0] || options.delete(:key)
|
177
|
+
case value
|
178
|
+
when String then value
|
179
|
+
when nil then raise ArgumentError, "missing required option :key"
|
180
|
+
else
|
181
|
+
msg = "expected :key to be a String, got #{value.class}"
|
182
|
+
raise ArgumentError, msg
|
185
183
|
end
|
184
|
+
end
|
186
185
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
end
|
186
|
+
def extract_resource_id(args, options)
|
187
|
+
value = args[1] || options.delete(:resource_id)
|
188
|
+
case value
|
189
|
+
when String then value
|
190
|
+
when nil then raise ArgumentError, "missing required option :resource_id"
|
191
|
+
else
|
192
|
+
msg = "expected :resource_id to be a String, got #{value.class}"
|
193
|
+
raise ArgumentError, msg
|
196
194
|
end
|
195
|
+
end
|
197
196
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
end
|
197
|
+
def extract_resource_type(args, options)
|
198
|
+
value = args[2] || options.delete(:resource_type)
|
199
|
+
case value
|
200
|
+
when String then value
|
201
|
+
when nil then raise ArgumentError, "missing required option :resource_type"
|
202
|
+
else
|
203
|
+
msg = "expected :resource_type to be a String, got #{value.class}"
|
204
|
+
raise ArgumentError, msg
|
207
205
|
end
|
206
|
+
end
|
208
207
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
params
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
resource_id: item.resource_id,
|
226
|
-
key: item.key
|
227
|
-
}
|
228
|
-
end
|
229
|
-
batch[0].client.create_or_update_tags(params)
|
208
|
+
class Collection < Aws::Resources::Collection
|
209
|
+
|
210
|
+
# @!group Batch Actions
|
211
|
+
|
212
|
+
# @param options ({})
|
213
|
+
# @return [void]
|
214
|
+
def batch_create(options = {})
|
215
|
+
batch_enum.each do |batch|
|
216
|
+
params = Aws::Util.copy_hash(options)
|
217
|
+
params[:tags] ||= []
|
218
|
+
batch.each do |item|
|
219
|
+
params[:tags] << {
|
220
|
+
resource_type: item.resource_type,
|
221
|
+
resource_id: item.resource_id,
|
222
|
+
key: item.key
|
223
|
+
}
|
230
224
|
end
|
231
|
-
|
225
|
+
batch[0].client.create_or_update_tags(params)
|
232
226
|
end
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
}
|
249
|
-
end
|
250
|
-
batch[0].client.delete_tags(params)
|
227
|
+
nil
|
228
|
+
end
|
229
|
+
|
230
|
+
# @param options ({})
|
231
|
+
# @return [void]
|
232
|
+
def batch_delete!(options = {})
|
233
|
+
batch_enum.each do |batch|
|
234
|
+
params = Aws::Util.copy_hash(options)
|
235
|
+
params[:tags] ||= []
|
236
|
+
batch.each do |item|
|
237
|
+
params[:tags] << {
|
238
|
+
resource_type: item.resource_type,
|
239
|
+
resource_id: item.resource_id,
|
240
|
+
key: item.key
|
241
|
+
}
|
251
242
|
end
|
252
|
-
|
243
|
+
batch[0].client.delete_tags(params)
|
253
244
|
end
|
245
|
+
nil
|
246
|
+
end
|
254
247
|
|
255
|
-
|
248
|
+
# @!endgroup
|
256
249
|
|
257
|
-
end
|
258
250
|
end
|
259
251
|
end
|
260
252
|
end
|