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,266 +1,264 @@
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 Route
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(route_table_id, destination_cidr_block, options = {})
15
- # @param [String] route_table_id
16
- # @param [String] destination_cidr_block
17
- # @option options [Client] :client
18
- # @overload def initialize(options = {})
19
- # @option options [required, String] :route_table_id
20
- # @option options [required, String] :destination_cidr_block
21
- # @option options [Client] :client
22
- def initialize(*args)
23
- options = Hash === args.last ? args.pop.dup : {}
24
- @route_table_id = extract_route_table_id(args, options)
25
- @destination_cidr_block = extract_destination_cidr_block(args, options)
26
- @data = options.delete(:data)
27
- @client = options.delete(:client) || Client.new(options)
28
- end
8
+ module Aws::EC2
9
+ class Route
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(route_table_id, destination_cidr_block, options = {})
14
+ # @param [String] route_table_id
15
+ # @param [String] destination_cidr_block
16
+ # @option options [Client] :client
17
+ # @overload def initialize(options = {})
18
+ # @option options [required, String] :route_table_id
19
+ # @option options [required, String] :destination_cidr_block
20
+ # @option options [Client] :client
21
+ def initialize(*args)
22
+ options = Hash === args.last ? args.pop.dup : {}
23
+ @route_table_id = extract_route_table_id(args, options)
24
+ @destination_cidr_block = extract_destination_cidr_block(args, options)
25
+ @data = options.delete(:data)
26
+ @client = options.delete(:client) || Client.new(options)
27
+ end
29
28
 
30
- # @!group Read-Only Attributes
29
+ # @!group Read-Only Attributes
31
30
 
32
- # @return [String]
33
- def route_table_id
34
- @route_table_id
35
- end
31
+ # @return [String]
32
+ def route_table_id
33
+ @route_table_id
34
+ end
36
35
 
37
- # @return [String]
38
- def destination_cidr_block
39
- @destination_cidr_block
40
- end
36
+ # @return [String]
37
+ def destination_cidr_block
38
+ @destination_cidr_block
39
+ end
41
40
 
42
- # The prefix of the AWS service.
43
- # @return [String]
44
- def destination_prefix_list_id
45
- data.destination_prefix_list_id
46
- end
41
+ # The prefix of the AWS service.
42
+ # @return [String]
43
+ def destination_prefix_list_id
44
+ data.destination_prefix_list_id
45
+ end
47
46
 
48
- # The ID of a gateway attached to your VPC.
49
- # @return [String]
50
- def gateway_id
51
- data.gateway_id
52
- end
47
+ # The ID of a gateway attached to your VPC.
48
+ # @return [String]
49
+ def gateway_id
50
+ data.gateway_id
51
+ end
53
52
 
54
- # The ID of a NAT instance in your VPC.
55
- # @return [String]
56
- def instance_id
57
- data.instance_id
58
- end
53
+ # The ID of a NAT instance in your VPC.
54
+ # @return [String]
55
+ def instance_id
56
+ data.instance_id
57
+ end
59
58
 
60
- # The AWS account ID of the owner of the instance.
61
- # @return [String]
62
- def instance_owner_id
63
- data.instance_owner_id
64
- end
59
+ # The AWS account ID of the owner of the instance.
60
+ # @return [String]
61
+ def instance_owner_id
62
+ data.instance_owner_id
63
+ end
65
64
 
66
- # The ID of the network interface.
67
- # @return [String]
68
- def network_interface_id
69
- data.network_interface_id
70
- end
65
+ # The ID of the network interface.
66
+ # @return [String]
67
+ def network_interface_id
68
+ data.network_interface_id
69
+ end
71
70
 
72
- # The ID of the VPC peering connection.
73
- # @return [String]
74
- def vpc_peering_connection_id
75
- data.vpc_peering_connection_id
76
- end
71
+ # The ID of the VPC peering connection.
72
+ # @return [String]
73
+ def vpc_peering_connection_id
74
+ data.vpc_peering_connection_id
75
+ end
77
76
 
78
- # The ID of a NAT gateway.
79
- # @return [String]
80
- def nat_gateway_id
81
- data.nat_gateway_id
82
- end
77
+ # The ID of a NAT gateway.
78
+ # @return [String]
79
+ def nat_gateway_id
80
+ data.nat_gateway_id
81
+ end
83
82
 
84
- # The state of the route. The `blackhole` state indicates that the
85
- # route's target isn't available (for example, the specified gateway
86
- # isn't attached to the VPC, or the specified NAT instance has been
87
- # terminated).
88
- # @return [String]
89
- def state
90
- data.state
91
- end
83
+ # The state of the route. The `blackhole` state indicates that the
84
+ # route's target isn't available (for example, the specified gateway
85
+ # isn't attached to the VPC, or the specified NAT instance has been
86
+ # terminated).
87
+ # @return [String]
88
+ def state
89
+ data.state
90
+ end
92
91
 
93
- # Describes how the route was created.
94
- #
95
- # * `CreateRouteTable` - The route was automatically created when the
96
- # route table was created.
97
- #
98
- # * `CreateRoute` - The route was manually added to the route table.
99
- #
100
- # * `EnableVgwRoutePropagation` - The route was propagated by route
101
- # propagation.
102
- # @return [String]
103
- def origin
104
- data.origin
105
- end
92
+ # Describes how the route was created.
93
+ #
94
+ # * `CreateRouteTable` - The route was automatically created when the
95
+ # route table was created.
96
+ #
97
+ # * `CreateRoute` - The route was manually added to the route table.
98
+ #
99
+ # * `EnableVgwRoutePropagation` - The route was propagated by route
100
+ # propagation.
101
+ # @return [String]
102
+ def origin
103
+ data.origin
104
+ end
106
105
 
107
- # The IPv6 CIDR block used for the destination match.
108
- # @return [String]
109
- def destination_ipv_6_cidr_block
110
- data.destination_ipv_6_cidr_block
111
- end
106
+ # The IPv6 CIDR block used for the destination match.
107
+ # @return [String]
108
+ def destination_ipv_6_cidr_block
109
+ data.destination_ipv_6_cidr_block
110
+ end
112
111
 
113
- # The ID of the egress-only Internet gateway.
114
- # @return [String]
115
- def egress_only_internet_gateway_id
116
- data.egress_only_internet_gateway_id
117
- end
112
+ # The ID of the egress-only Internet gateway.
113
+ # @return [String]
114
+ def egress_only_internet_gateway_id
115
+ data.egress_only_internet_gateway_id
116
+ end
118
117
 
119
- # @!endgroup
118
+ # @!endgroup
120
119
 
121
- # @return [Client]
122
- def client
123
- @client
124
- end
120
+ # @return [Client]
121
+ def client
122
+ @client
123
+ end
125
124
 
126
- # @raise [Errors::ResourceNotLoadable]
127
- # @api private
128
- def load
129
- msg = "#load is not implemented, data only available via enumeration"
130
- raise Errors::ResourceNotLoadable, msg
131
- end
132
- alias :reload :load
133
-
134
- # @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
135
- # @return [Types::Route]
136
- # Returns the data for this {Route}.
137
- def data
138
- load unless @data
139
- @data
140
- end
125
+ # @raise [NotImplementedError]
126
+ # @api private
127
+ def load
128
+ msg = "#load is not implemented, data only available via enumeration"
129
+ raise NotImplementedError, msg
130
+ end
131
+ alias :reload :load
132
+
133
+ # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`.
134
+ # @return [Types::Route]
135
+ # Returns the data for this {Route}.
136
+ def data
137
+ load unless @data
138
+ @data
139
+ end
141
140
 
142
- # @return [Boolean]
143
- # Returns `true` if this resource is loaded. Accessing attributes or
144
- # {#data} on an unloaded resource will trigger a call to {#load}.
145
- def data_loaded?
146
- !!@data
147
- end
141
+ # @return [Boolean]
142
+ # Returns `true` if this resource is loaded. Accessing attributes or
143
+ # {#data} on an unloaded resource will trigger a call to {#load}.
144
+ def data_loaded?
145
+ !!@data
146
+ end
148
147
 
149
- # @!group Actions
150
-
151
- # @example Request syntax with placeholder values
152
- #
153
- # route.delete({
154
- # dry_run: false,
155
- # destination_ipv_6_cidr_block: "String",
156
- # })
157
- # @param [Hash] options ({})
158
- # @option options [Boolean] :dry_run
159
- # Checks whether you have the required permissions for the action,
160
- # without actually making the request, and provides an error response.
161
- # If you have the required permissions, the error response is
162
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
163
- # @option options [String] :destination_ipv_6_cidr_block
164
- # The IPv6 CIDR range for the route. The value you specify must match
165
- # the CIDR for the route exactly.
166
- # @return [EmptyStructure]
167
- def delete(options = {})
168
- options = options.merge(
169
- route_table_id: @route_table_id,
170
- destination_cidr_block: @destination_cidr_block
171
- )
172
- resp = @client.delete_route(options)
173
- resp.data
174
- end
148
+ # @!group Actions
149
+
150
+ # @example Request syntax with placeholder values
151
+ #
152
+ # route.delete({
153
+ # dry_run: false,
154
+ # destination_ipv_6_cidr_block: "String",
155
+ # })
156
+ # @param [Hash] options ({})
157
+ # @option options [Boolean] :dry_run
158
+ # Checks whether you have the required permissions for the action,
159
+ # without actually making the request, and provides an error response.
160
+ # If you have the required permissions, the error response is
161
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
162
+ # @option options [String] :destination_ipv_6_cidr_block
163
+ # The IPv6 CIDR range for the route. The value you specify must match
164
+ # the CIDR for the route exactly.
165
+ # @return [EmptyStructure]
166
+ def delete(options = {})
167
+ options = options.merge(
168
+ route_table_id: @route_table_id,
169
+ destination_cidr_block: @destination_cidr_block
170
+ )
171
+ resp = @client.delete_route(options)
172
+ resp.data
173
+ end
175
174
 
176
- # @example Request syntax with placeholder values
177
- #
178
- # route.replace({
179
- # dry_run: false,
180
- # gateway_id: "String",
181
- # destination_ipv_6_cidr_block: "String",
182
- # egress_only_internet_gateway_id: "String",
183
- # instance_id: "String",
184
- # network_interface_id: "String",
185
- # vpc_peering_connection_id: "String",
186
- # nat_gateway_id: "String",
187
- # })
188
- # @param [Hash] options ({})
189
- # @option options [Boolean] :dry_run
190
- # Checks whether you have the required permissions for the action,
191
- # without actually making the request, and provides an error response.
192
- # If you have the required permissions, the error response is
193
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
194
- # @option options [String] :gateway_id
195
- # The ID of an Internet gateway or virtual private gateway.
196
- # @option options [String] :destination_ipv_6_cidr_block
197
- # The IPv6 CIDR address block used for the destination match. The value
198
- # you provide must match the CIDR of an existing route in the table.
199
- # @option options [String] :egress_only_internet_gateway_id
200
- # \[IPv6 traffic only\] The ID of an egress-only Internet gateway.
201
- # @option options [String] :instance_id
202
- # The ID of a NAT instance in your VPC.
203
- # @option options [String] :network_interface_id
204
- # The ID of a network interface.
205
- # @option options [String] :vpc_peering_connection_id
206
- # The ID of a VPC peering connection.
207
- # @option options [String] :nat_gateway_id
208
- # \[IPv4 traffic only\] The ID of a NAT gateway.
209
- # @return [EmptyStructure]
210
- def replace(options = {})
211
- options = options.merge(
212
- route_table_id: @route_table_id,
213
- destination_cidr_block: @destination_cidr_block
214
- )
215
- resp = @client.replace_route(options)
216
- resp.data
217
- end
175
+ # @example Request syntax with placeholder values
176
+ #
177
+ # route.replace({
178
+ # dry_run: false,
179
+ # gateway_id: "String",
180
+ # destination_ipv_6_cidr_block: "String",
181
+ # egress_only_internet_gateway_id: "String",
182
+ # instance_id: "String",
183
+ # network_interface_id: "String",
184
+ # vpc_peering_connection_id: "String",
185
+ # nat_gateway_id: "String",
186
+ # })
187
+ # @param [Hash] options ({})
188
+ # @option options [Boolean] :dry_run
189
+ # Checks whether you have the required permissions for the action,
190
+ # without actually making the request, and provides an error response.
191
+ # If you have the required permissions, the error response is
192
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
193
+ # @option options [String] :gateway_id
194
+ # The ID of an Internet gateway or virtual private gateway.
195
+ # @option options [String] :destination_ipv_6_cidr_block
196
+ # The IPv6 CIDR address block used for the destination match. The value
197
+ # you provide must match the CIDR of an existing route in the table.
198
+ # @option options [String] :egress_only_internet_gateway_id
199
+ # \[IPv6 traffic only\] The ID of an egress-only Internet gateway.
200
+ # @option options [String] :instance_id
201
+ # The ID of a NAT instance in your VPC.
202
+ # @option options [String] :network_interface_id
203
+ # The ID of a network interface.
204
+ # @option options [String] :vpc_peering_connection_id
205
+ # The ID of a VPC peering connection.
206
+ # @option options [String] :nat_gateway_id
207
+ # \[IPv4 traffic only\] The ID of a NAT gateway.
208
+ # @return [EmptyStructure]
209
+ def replace(options = {})
210
+ options = options.merge(
211
+ route_table_id: @route_table_id,
212
+ destination_cidr_block: @destination_cidr_block
213
+ )
214
+ resp = @client.replace_route(options)
215
+ resp.data
216
+ end
218
217
 
219
- # @!group Associations
218
+ # @!group Associations
220
219
 
221
- # @return [RouteTable]
222
- def route_table
223
- RouteTable.new(
224
- id: @route_table_id,
225
- client: @client
226
- )
227
- end
220
+ # @return [RouteTable]
221
+ def route_table
222
+ RouteTable.new(
223
+ id: @route_table_id,
224
+ client: @client
225
+ )
226
+ end
228
227
 
229
- # @deprecated
230
- # @api private
231
- def identifiers
232
- {
233
- route_table_id: @route_table_id,
234
- destination_cidr_block: @destination_cidr_block
235
- }
236
- end
237
- deprecated(:identifiers)
238
-
239
- private
240
-
241
- def extract_route_table_id(args, options)
242
- value = args[0] || options.delete(:route_table_id)
243
- case value
244
- when String then value
245
- when nil then raise ArgumentError, "missing required option :route_table_id"
246
- else
247
- msg = "expected :route_table_id to be a String, got #{value.class}"
248
- raise ArgumentError, msg
249
- end
228
+ # @deprecated
229
+ # @api private
230
+ def identifiers
231
+ {
232
+ route_table_id: @route_table_id,
233
+ destination_cidr_block: @destination_cidr_block
234
+ }
235
+ end
236
+ deprecated(:identifiers)
237
+
238
+ private
239
+
240
+ def extract_route_table_id(args, options)
241
+ value = args[0] || options.delete(:route_table_id)
242
+ case value
243
+ when String then value
244
+ when nil then raise ArgumentError, "missing required option :route_table_id"
245
+ else
246
+ msg = "expected :route_table_id to be a String, got #{value.class}"
247
+ raise ArgumentError, msg
250
248
  end
249
+ end
251
250
 
252
- def extract_destination_cidr_block(args, options)
253
- value = args[1] || options.delete(:destination_cidr_block)
254
- case value
255
- when String then value
256
- when nil then raise ArgumentError, "missing required option :destination_cidr_block"
257
- else
258
- msg = "expected :destination_cidr_block to be a String, got #{value.class}"
259
- raise ArgumentError, msg
260
- end
251
+ def extract_destination_cidr_block(args, options)
252
+ value = args[1] || options.delete(:destination_cidr_block)
253
+ case value
254
+ when String then value
255
+ when nil then raise ArgumentError, "missing required option :destination_cidr_block"
256
+ else
257
+ msg = "expected :destination_cidr_block to be a String, got #{value.class}"
258
+ raise ArgumentError, msg
261
259
  end
262
-
263
- class Collection < Aws::Resources::Collection; end
264
260
  end
261
+
262
+ class Collection < Aws::Resources::Collection; end
265
263
  end
266
264
  end