aws-sdk-ec2 1.0.0.rc2 → 1.0.0.rc3

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.
@@ -1,284 +1,282 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
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
- module EC2
10
- class RouteTable
8
+ module Aws::EC2
9
+ class RouteTable
11
10
 
12
- extend Aws::Deprecations
11
+ extend Aws::Deprecations
13
12
 
14
- # @overload def initialize(id, options = {})
15
- # @param [String] id
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :id
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @id = extract_id(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
13
+ # @overload def initialize(id, options = {})
14
+ # @param [String] id
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :id
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @id = extract_id(args, options)
22
+ @data = options.delete(:data)
23
+ @client = options.delete(:client) || Client.new(options)
24
+ end
26
25
 
27
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def id
31
- @id
32
- end
33
- alias :route_table_id :id
28
+ # @return [String]
29
+ def id
30
+ @id
31
+ end
32
+ alias :route_table_id :id
34
33
 
35
- # The ID of the VPC.
36
- # @return [String]
37
- def vpc_id
38
- data.vpc_id
39
- end
34
+ # The ID of the VPC.
35
+ # @return [String]
36
+ def vpc_id
37
+ data.vpc_id
38
+ end
40
39
 
41
- # Any tags assigned to the route table.
42
- # @return [Array<Types::Tag>]
43
- def tags
44
- data.tags
45
- end
40
+ # Any tags assigned to the route table.
41
+ # @return [Array<Types::Tag>]
42
+ def tags
43
+ data.tags
44
+ end
46
45
 
47
- # Any virtual private gateway (VGW) propagating routes.
48
- # @return [Array<Types::PropagatingVgw>]
49
- def propagating_vgws
50
- data.propagating_vgws
51
- end
46
+ # Any virtual private gateway (VGW) propagating routes.
47
+ # @return [Array<Types::PropagatingVgw>]
48
+ def propagating_vgws
49
+ data.propagating_vgws
50
+ end
52
51
 
53
- # @!endgroup
52
+ # @!endgroup
54
53
 
55
- # @return [Client]
56
- def client
57
- @client
58
- end
54
+ # @return [Client]
55
+ def client
56
+ @client
57
+ end
59
58
 
60
- # Loads, or reloads {#data} for the current {RouteTable}.
61
- # Returns `self` making it possible to chain methods.
62
- #
63
- # route_table.reload.data
64
- #
65
- # @return [self]
66
- def load
67
- resp = @client.describe_route_tables(route_table_ids: [@id])
68
- @data = resp.routetables[0]
69
- self
70
- end
71
- alias :reload :load
59
+ # Loads, or reloads {#data} for the current {RouteTable}.
60
+ # Returns `self` making it possible to chain methods.
61
+ #
62
+ # route_table.reload.data
63
+ #
64
+ # @return [self]
65
+ def load
66
+ resp = @client.describe_route_tables(route_table_ids: [@id])
67
+ @data = resp.routetables[0]
68
+ self
69
+ end
70
+ alias :reload :load
72
71
 
73
- # @return [Types::RouteTable]
74
- # Returns the data for this {RouteTable}. Calls
75
- # {Client#describe_route_tables} if {#data_loaded?} is `false`.
76
- def data
77
- load unless @data
78
- @data
79
- end
72
+ # @return [Types::RouteTable]
73
+ # Returns the data for this {RouteTable}. Calls
74
+ # {Client#describe_route_tables} if {#data_loaded?} is `false`.
75
+ def data
76
+ load unless @data
77
+ @data
78
+ end
80
79
 
81
- # @return [Boolean]
82
- # Returns `true` if this resource is loaded. Accessing attributes or
83
- # {#data} on an unloaded resource will trigger a call to {#load}.
84
- def data_loaded?
85
- !!@data
86
- end
80
+ # @return [Boolean]
81
+ # Returns `true` if this resource is loaded. Accessing attributes or
82
+ # {#data} on an unloaded resource will trigger a call to {#load}.
83
+ def data_loaded?
84
+ !!@data
85
+ end
87
86
 
88
- # @!group Actions
87
+ # @!group Actions
89
88
 
90
- # @example Request syntax with placeholder values
91
- #
92
- # routetableassociation = route_table.associate_with_subnet({
93
- # dry_run: false,
94
- # subnet_id: "String", # required
95
- # })
96
- # @param [Hash] options ({})
97
- # @option options [Boolean] :dry_run
98
- # Checks whether you have the required permissions for the action,
99
- # without actually making the request, and provides an error response.
100
- # If you have the required permissions, the error response is
101
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
102
- # @option options [required, String] :subnet_id
103
- # The ID of the subnet.
104
- # @return [RouteTableAssociation]
105
- def associate_with_subnet(options = {})
106
- options = options.merge(route_table_id: @id)
107
- resp = @client.associate_route_table(options)
108
- RouteTableAssociation.new(
109
- id: resp.data.association_id,
110
- client: @client
111
- )
112
- end
89
+ # @example Request syntax with placeholder values
90
+ #
91
+ # routetableassociation = route_table.associate_with_subnet({
92
+ # dry_run: false,
93
+ # subnet_id: "String", # required
94
+ # })
95
+ # @param [Hash] options ({})
96
+ # @option options [Boolean] :dry_run
97
+ # Checks whether you have the required permissions for the action,
98
+ # without actually making the request, and provides an error response.
99
+ # If you have the required permissions, the error response is
100
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
101
+ # @option options [required, String] :subnet_id
102
+ # The ID of the subnet.
103
+ # @return [RouteTableAssociation]
104
+ def associate_with_subnet(options = {})
105
+ options = options.merge(route_table_id: @id)
106
+ resp = @client.associate_route_table(options)
107
+ RouteTableAssociation.new(
108
+ id: resp.data.association_id,
109
+ client: @client
110
+ )
111
+ end
113
112
 
114
- # @example Request syntax with placeholder values
115
- #
116
- # route = route_table.create_route({
117
- # dry_run: false,
118
- # destination_cidr_block: "String",
119
- # gateway_id: "String",
120
- # destination_ipv_6_cidr_block: "String",
121
- # egress_only_internet_gateway_id: "String",
122
- # instance_id: "String",
123
- # network_interface_id: "String",
124
- # vpc_peering_connection_id: "String",
125
- # nat_gateway_id: "String",
126
- # })
127
- # @param [Hash] options ({})
128
- # @option options [Boolean] :dry_run
129
- # Checks whether you have the required permissions for the action,
130
- # without actually making the request, and provides an error response.
131
- # If you have the required permissions, the error response is
132
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
133
- # @option options [String] :destination_cidr_block
134
- # The IPv4 CIDR address block used for the destination match. Routing
135
- # decisions are based on the most specific match.
136
- # @option options [String] :gateway_id
137
- # The ID of an Internet gateway or virtual private gateway attached to
138
- # your VPC.
139
- # @option options [String] :destination_ipv_6_cidr_block
140
- # The IPv6 CIDR block used for the destination match. Routing decisions
141
- # are based on the most specific match.
142
- # @option options [String] :egress_only_internet_gateway_id
143
- # \[IPv6 traffic only\] The ID of an egress-only Internet gateway.
144
- # @option options [String] :instance_id
145
- # The ID of a NAT instance in your VPC. The operation fails if you
146
- # specify an instance ID unless exactly one network interface is
147
- # attached.
148
- # @option options [String] :network_interface_id
149
- # The ID of a network interface.
150
- # @option options [String] :vpc_peering_connection_id
151
- # The ID of a VPC peering connection.
152
- # @option options [String] :nat_gateway_id
153
- # \[IPv4 traffic only\] The ID of a NAT gateway.
154
- # @return [Route]
155
- def create_route(options = {})
156
- options = options.merge(route_table_id: @id)
157
- resp = @client.create_route(options)
158
- Route.new(
159
- route_table_id: @id,
160
- destination_cidr_block: options[:destination_cidr_block],
113
+ # @example Request syntax with placeholder values
114
+ #
115
+ # route = route_table.create_route({
116
+ # dry_run: false,
117
+ # destination_cidr_block: "String",
118
+ # gateway_id: "String",
119
+ # destination_ipv_6_cidr_block: "String",
120
+ # egress_only_internet_gateway_id: "String",
121
+ # instance_id: "String",
122
+ # network_interface_id: "String",
123
+ # vpc_peering_connection_id: "String",
124
+ # nat_gateway_id: "String",
125
+ # })
126
+ # @param [Hash] options ({})
127
+ # @option options [Boolean] :dry_run
128
+ # Checks whether you have the required permissions for the action,
129
+ # without actually making the request, and provides an error response.
130
+ # If you have the required permissions, the error response is
131
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
132
+ # @option options [String] :destination_cidr_block
133
+ # The IPv4 CIDR address block used for the destination match. Routing
134
+ # decisions are based on the most specific match.
135
+ # @option options [String] :gateway_id
136
+ # The ID of an Internet gateway or virtual private gateway attached to
137
+ # your VPC.
138
+ # @option options [String] :destination_ipv_6_cidr_block
139
+ # The IPv6 CIDR block used for the destination match. Routing decisions
140
+ # are based on the most specific match.
141
+ # @option options [String] :egress_only_internet_gateway_id
142
+ # \[IPv6 traffic only\] The ID of an egress-only Internet gateway.
143
+ # @option options [String] :instance_id
144
+ # The ID of a NAT instance in your VPC. The operation fails if you
145
+ # specify an instance ID unless exactly one network interface is
146
+ # attached.
147
+ # @option options [String] :network_interface_id
148
+ # The ID of a network interface.
149
+ # @option options [String] :vpc_peering_connection_id
150
+ # The ID of a VPC peering connection.
151
+ # @option options [String] :nat_gateway_id
152
+ # \[IPv4 traffic only\] The ID of a NAT gateway.
153
+ # @return [Route]
154
+ def create_route(options = {})
155
+ options = options.merge(route_table_id: @id)
156
+ resp = @client.create_route(options)
157
+ Route.new(
158
+ route_table_id: @id,
159
+ destination_cidr_block: options[:destination_cidr_block],
160
+ client: @client
161
+ )
162
+ end
163
+
164
+ # @example Request syntax with placeholder values
165
+ #
166
+ # tag = route_table.create_tags({
167
+ # dry_run: false,
168
+ # tags: [ # required
169
+ # {
170
+ # key: "String",
171
+ # value: "String",
172
+ # },
173
+ # ],
174
+ # })
175
+ # @param [Hash] options ({})
176
+ # @option options [Boolean] :dry_run
177
+ # Checks whether you have the required permissions for the action,
178
+ # without actually making the request, and provides an error response.
179
+ # If you have the required permissions, the error response is
180
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
181
+ # @option options [required, Array<Types::Tag>] :tags
182
+ # One or more tags. The `value` parameter is required, but if you don't
183
+ # want the tag to have a value, specify the parameter with no value, and
184
+ # we set the value to an empty string.
185
+ # @return [Tag::Collection]
186
+ def create_tags(options = {})
187
+ batch = []
188
+ options = Aws::Util.deep_merge(options, resources: [@id])
189
+ resp = @client.create_tags(options)
190
+ options[:tags].each do |t|
191
+ batch << Tag.new(
192
+ resource_id: @id,
193
+ key: t[:key],
194
+ value: t[:value],
161
195
  client: @client
162
196
  )
163
197
  end
198
+ Tag::Collection.new([batch], size: batch.size)
199
+ end
164
200
 
165
- # @example Request syntax with placeholder values
166
- #
167
- # tag = route_table.create_tags({
168
- # dry_run: false,
169
- # tags: [ # required
170
- # {
171
- # key: "String",
172
- # value: "String",
173
- # },
174
- # ],
175
- # })
176
- # @param [Hash] options ({})
177
- # @option options [Boolean] :dry_run
178
- # Checks whether you have the required permissions for the action,
179
- # without actually making the request, and provides an error response.
180
- # If you have the required permissions, the error response is
181
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
182
- # @option options [required, Array<Types::Tag>] :tags
183
- # One or more tags. The `value` parameter is required, but if you don't
184
- # want the tag to have a value, specify the parameter with no value, and
185
- # we set the value to an empty string.
186
- # @return [Tag::Collection]
187
- def create_tags(options = {})
188
- batch = []
189
- options = Aws::Util.deep_merge(options, resources: [@id])
190
- resp = @client.create_tags(options)
191
- options[:tags].each do |t|
192
- batch << Tag.new(
193
- resource_id: @id,
194
- key: t[:key],
195
- value: t[:value],
196
- client: @client
197
- )
198
- end
199
- Tag::Collection.new([batch], size: batch.size)
200
- end
201
-
202
- # @example Request syntax with placeholder values
203
- #
204
- # route_table.delete({
205
- # dry_run: false,
206
- # })
207
- # @param [Hash] options ({})
208
- # @option options [Boolean] :dry_run
209
- # Checks whether you have the required permissions for the action,
210
- # without actually making the request, and provides an error response.
211
- # If you have the required permissions, the error response is
212
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
213
- # @return [EmptyStructure]
214
- def delete(options = {})
215
- options = options.merge(route_table_id: @id)
216
- resp = @client.delete_route_table(options)
217
- resp.data
218
- end
201
+ # @example Request syntax with placeholder values
202
+ #
203
+ # route_table.delete({
204
+ # dry_run: false,
205
+ # })
206
+ # @param [Hash] options ({})
207
+ # @option options [Boolean] :dry_run
208
+ # Checks whether you have the required permissions for the action,
209
+ # without actually making the request, and provides an error response.
210
+ # If you have the required permissions, the error response is
211
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
212
+ # @return [EmptyStructure]
213
+ def delete(options = {})
214
+ options = options.merge(route_table_id: @id)
215
+ resp = @client.delete_route_table(options)
216
+ resp.data
217
+ end
219
218
 
220
- # @!group Associations
219
+ # @!group Associations
221
220
 
222
- # @return [RouteTableAssociation::Collection]
223
- def associations
224
- batch = []
225
- data.associations.each do |a|
226
- batch << RouteTableAssociation.new(
227
- id: a.route_table_association_id,
228
- data: a,
229
- client: @client
230
- )
231
- end
232
- RouteTableAssociation::Collection.new([batch], size: batch.size)
221
+ # @return [RouteTableAssociation::Collection]
222
+ def associations
223
+ batch = []
224
+ data.associations.each do |a|
225
+ batch << RouteTableAssociation.new(
226
+ id: a.route_table_association_id,
227
+ data: a,
228
+ client: @client
229
+ )
233
230
  end
231
+ RouteTableAssociation::Collection.new([batch], size: batch.size)
232
+ end
234
233
 
235
- # @return [Route::Collection]
236
- def routes
237
- batch = []
238
- data.routes.each do |r|
239
- batch << Route.new(
240
- route_table_id: @id,
241
- destination_cidr_block: r.destination_cidr_block,
242
- data: r,
243
- client: @client
244
- )
245
- end
246
- Route::Collection.new([batch], size: batch.size)
234
+ # @return [Route::Collection]
235
+ def routes
236
+ batch = []
237
+ data.routes.each do |r|
238
+ batch << Route.new(
239
+ route_table_id: @id,
240
+ destination_cidr_block: r.destination_cidr_block,
241
+ data: r,
242
+ client: @client
243
+ )
247
244
  end
245
+ Route::Collection.new([batch], size: batch.size)
246
+ end
248
247
 
249
- # @return [Vpc, nil]
250
- def vpc
251
- if data.vpc_id
252
- Vpc.new(
253
- id: data.vpc_id,
254
- client: @client
255
- )
256
- else
257
- nil
258
- end
248
+ # @return [Vpc, nil]
249
+ def vpc
250
+ if data.vpc_id
251
+ Vpc.new(
252
+ id: data.vpc_id,
253
+ client: @client
254
+ )
255
+ else
256
+ nil
259
257
  end
258
+ end
260
259
 
261
- # @deprecated
262
- # @api private
263
- def identifiers
264
- { id: @id }
265
- end
266
- deprecated(:identifiers)
260
+ # @deprecated
261
+ # @api private
262
+ def identifiers
263
+ { id: @id }
264
+ end
265
+ deprecated(:identifiers)
267
266
 
268
- private
267
+ private
269
268
 
270
- def extract_id(args, options)
271
- value = args[0] || options.delete(:id)
272
- case value
273
- when String then value
274
- when nil then raise ArgumentError, "missing required option :id"
275
- else
276
- msg = "expected :id to be a String, got #{value.class}"
277
- raise ArgumentError, msg
278
- end
269
+ def extract_id(args, options)
270
+ value = args[0] || options.delete(:id)
271
+ case value
272
+ when String then value
273
+ when nil then raise ArgumentError, "missing required option :id"
274
+ else
275
+ msg = "expected :id to be a String, got #{value.class}"
276
+ raise ArgumentError, msg
279
277
  end
280
-
281
- class Collection < Aws::Resources::Collection; end
282
278
  end
279
+
280
+ class Collection < Aws::Resources::Collection; end
283
281
  end
284
282
  end