right_aws_api 0.2.3 → 0.3.0
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/HISTORY +8 -0
- data/README.md +2 -1
- data/lib/cloud/aws/base/helpers/utils.rb +1 -0
- data/lib/cloud/aws/ec2/manager.rb +4 -4
- data/lib/cloud/aws/route53/domain/manager.rb +166 -0
- data/lib/cloud/aws/route53/domain/routines/request_signer.rb +76 -0
- data/lib/cloud/aws/route53/domain/wrappers/default.rb +278 -0
- data/lib/cloud/aws/route53/manager.rb +48 -8
- data/lib/cloud/aws/route53/routines/request_signer.rb +10 -6
- data/lib/cloud/aws/route53/wrappers/default.rb +198 -32
- data/lib/cloud/aws/s3/routines/request_signer.rb +0 -1
- data/lib/right_aws_api.rb +1 -0
- data/lib/right_aws_api_version.rb +1 -1
- data/right_aws_api.gemspec +1 -1
- data/spec/describe_calls.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8bba3831173844f44970e8ec7de2bdf8deaccfd
|
4
|
+
data.tar.gz: 2d690e778c5465ba65af461b3f270a650f7c095b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05dcde93bbe91da2df664699908be7983409703bbf915b886c1767f565e6fccf05219d4d4f8579cb035737d00073050ac6c380e198dc6d6d443becb89113c723
|
7
|
+
data.tar.gz: 274c90d8e49ae082c0e87e5116bb04b24c18bad63910a41f79e15360f88e4247ae5c0f5935f9688905fa7612df6440ba6b8cded63f2646acc56bbd3912bbffcd
|
data/HISTORY
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
== current
|
2
2
|
|
3
|
+
== 2015-03-12, v0.3.0
|
4
|
+
- Fixed bugs in Route53:
|
5
|
+
- new param added to ChangeResourceRecordSets: HostedZoneId -> TargetHostedZoneId
|
6
|
+
- method renamed: CreateHostedZones -> CreateHostedZone
|
7
|
+
- Route53 API 2013-04-01 support added
|
8
|
+
- Route53 Domain API v20140515 support added
|
9
|
+
- Switched to the newer version of right_cloud_api_base gem
|
10
|
+
|
3
11
|
== 2015-01-16, v0.2.3
|
4
12
|
- Added an ability to not use DNS like buckets in AWS S3
|
5
13
|
- Added support for S3 folders creation
|
data/README.md
CHANGED
@@ -33,6 +33,7 @@ The gem supports the following AWS services out of the box:
|
|
33
33
|
- {RightScale::CloudApi::AWS::IAM::Manager Identity and Access Management (IAM)}
|
34
34
|
- {RightScale::CloudApi::AWS::RDS::Manager Relational Database Service (RDS)}
|
35
35
|
- {RightScale::CloudApi::AWS::Route53::Manager Route 53 (Route53)}
|
36
|
+
- {RightScale::CloudApi::AWS::Route53::Domain::Manager Route 53 Domain (Route53Domain)}
|
36
37
|
- {RightScale::CloudApi::AWS::S3::Manager Simple Storage Service (S3)}
|
37
38
|
- {RightScale::CloudApi::AWS::SDB::Manager Simple DB (SDB)}
|
38
39
|
- {RightScale::CloudApi::AWS::SNS::Manager Simple Notification Service (SNS)}
|
@@ -55,7 +56,7 @@ call and you know what params it accepts - just call the method with those param
|
|
55
56
|
|
56
57
|
key = ENV['AWS_ACCESS_KEY_ID']
|
57
58
|
secret = ENV['AWS_SECRET_ACCESS_KEY']
|
58
|
-
endpoint = 'https://us-east-1.
|
59
|
+
endpoint = 'https://ec2.us-east-1.amazonaws.com'
|
59
60
|
ec2 = RightScale::CloudApi::AWS::EC2::Manager.new(key, secret, endpoint)
|
60
61
|
|
61
62
|
ec2.ThisCallMustBeSupportedByEc2('Param.1' => 'A', 'Param.2' => 'B')
|
@@ -201,6 +201,7 @@ module RightScale
|
|
201
201
|
result =
|
202
202
|
case
|
203
203
|
when host[ /^iam\.amazonaws\.com$/i ] then ['iam', 'us-east-1']
|
204
|
+
when host[ /^route53\.amazonaws\.com$/i ] then ['route53', 'us-east-1']
|
204
205
|
when host[ /^(.*\.)?s3\.amazonaws\.com$/i ] then ['s3', 'us-east-1']
|
205
206
|
when host[ /^(.*\.)?s3-external-1\.amazonaws\.com$/i ] then ['s3', 'us-east-1']
|
206
207
|
when host[ /s3-website-([^.]+)\.amazonaws\.com$/i ] then ['s3', $1]
|
@@ -35,21 +35,21 @@ module RightScale
|
|
35
35
|
# require "right_aws_api"
|
36
36
|
#
|
37
37
|
# # Create a manager to access EC2.
|
38
|
-
# ec2 = RightScale::CloudApi::AWS::EC2::Manager::new(key, secret, 'https://us-east-1.
|
38
|
+
# ec2 = RightScale::CloudApi::AWS::EC2::Manager::new(key, secret, 'https://ec2.us-east-1.amazonaws.com')
|
39
39
|
#
|
40
40
|
# ec2.ThisCallMustBeSupportedByEc2('Param.1' => 'A', 'Param.2' => 'B')
|
41
41
|
#
|
42
42
|
# If there is a new API version just pass it to the manager and woohoo!
|
43
43
|
#
|
44
44
|
# @example
|
45
|
-
# ec2 = RightScale::CloudApi::AWS::EC2::new(key, secret, 'https://us-east-1.
|
45
|
+
# ec2 = RightScale::CloudApi::AWS::EC2::new(key, secret, 'https://ec2.us-east-1.amazonaws.com', :api_version => "2010-08-31" )
|
46
46
|
# ec2.DescribeInternetGateways # => Gateways list
|
47
47
|
#
|
48
|
-
# ec2 = RightScale::CloudApi::AWS::EC2::new(key, secret, 'https://us-east-1.
|
48
|
+
# ec2 = RightScale::CloudApi::AWS::EC2::new(key, secret, 'https://ec2.us-east-1.amazonaws.com', :api_version => "2011-05-15" )
|
49
49
|
# ec2.DescribeInternetGateways # => Exception
|
50
50
|
#
|
51
51
|
# # Or even pass a different API version when making a call!
|
52
|
-
# ec2 = RightScale::CloudApi::AWS::EC2::new(key, secret, 'https://us-east-1.
|
52
|
+
# ec2 = RightScale::CloudApi::AWS::EC2::new(key, secret, 'https://ec2.us-east-1.amazonaws.com', :api_version => "2010-08-31" )
|
53
53
|
# ec2.DescribeInternetGateways("InternetGatewayId"=>"igw-55660000") # => Exception
|
54
54
|
# ec2.DescribeInternetGateways("InternetGatewayId"=>"igw-55660000", :options => { :api_version => "2011-05-15" }) #=> Gateway data
|
55
55
|
#
|
@@ -0,0 +1,166 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2015 RightScale, Inc.
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# 'Software'), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
18
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
19
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
20
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
21
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
require "cloud/aws/base/helpers/utils"
|
25
|
+
require "cloud/aws/base/parsers/response_error"
|
26
|
+
require "cloud/aws/route53/domain/routines/request_signer"
|
27
|
+
require "cloud/aws/route53/domain/wrappers/default"
|
28
|
+
|
29
|
+
module RightScale
|
30
|
+
module CloudApi
|
31
|
+
module AWS
|
32
|
+
|
33
|
+
# Route 53 namespace
|
34
|
+
module Route53
|
35
|
+
module Domain
|
36
|
+
|
37
|
+
# Amazon Route 53 Domain compatible manager (thread safe).
|
38
|
+
#
|
39
|
+
# Supported API calls:
|
40
|
+
# - using get, post, put, etc methods:
|
41
|
+
# - any API call for any API version
|
42
|
+
# - using predefined methods in wrappers/default.rb (only API version 20140515):
|
43
|
+
# - CheckDomainAvailability
|
44
|
+
# - DeleteTagsForDomain
|
45
|
+
# - DisableDomainAutoRenew
|
46
|
+
# - DisableDomainTransferLock
|
47
|
+
# - EnableDomainAutoRenew
|
48
|
+
# - EnableDomainTransferLock
|
49
|
+
# - GetDomainDetail
|
50
|
+
# - GetOperationDetail
|
51
|
+
# - ListDomains
|
52
|
+
# - ListOperations
|
53
|
+
# - ListTagsForDomain
|
54
|
+
# - RegisterDomain
|
55
|
+
# - RetrieveDomainAuthCode
|
56
|
+
# - TransferDomain
|
57
|
+
# - UpdateDomainContact
|
58
|
+
# - UpdateDomainContactPrivacy
|
59
|
+
# - UpdateDomainNameservers
|
60
|
+
# - UpdateTagsForDomains
|
61
|
+
#
|
62
|
+
# @example
|
63
|
+
# require "right_aws_api"
|
64
|
+
#
|
65
|
+
# domain = RightScale::CloudApi::AWS::Route53::Domain::Manager::new(
|
66
|
+
# ENV['AWS_ACCESS_KEY_ID'],
|
67
|
+
# ENV['AWS_SECRET_ACCESS_KEY'],
|
68
|
+
# 'https://route53domains.us-east-1.amazonaws.com/'
|
69
|
+
# )
|
70
|
+
#
|
71
|
+
# # Using http verbs:
|
72
|
+
# domain.post('',
|
73
|
+
# :headers => {
|
74
|
+
# 'x-amz-target' => 'Route53Domains_v20140515.CheckDomainAvailability',
|
75
|
+
# 'content-type' => 'application/x-amz-json-1.1'
|
76
|
+
# },
|
77
|
+
# :body => { 'DomainName' => 'domain-name.com' }
|
78
|
+
# ) #=>
|
79
|
+
# {"Availability":"UNAVAILABLE"}
|
80
|
+
#
|
81
|
+
# # Using predefined methods:
|
82
|
+
# domain.CheckDomainAvailability("DomainName" => "foo-bar-weird.com") #=>
|
83
|
+
# {"Availability"=>"AVAILABLE"}
|
84
|
+
#
|
85
|
+
# @see ApiManager
|
86
|
+
# @see Wrapper::DEFAULT.extended Wrapper::DEFAULT.extended (click [View source])
|
87
|
+
# @see http://docs.aws.amazon.com/Route53/latest/APIReference/Welcome.html
|
88
|
+
#
|
89
|
+
class Manager < CloudApi::Manager
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
# Amazon Route 53 (Route) compatible manager (thread safe)
|
94
|
+
#
|
95
|
+
# @see Manager
|
96
|
+
#
|
97
|
+
class ApiManager < CloudApi::ApiManager
|
98
|
+
|
99
|
+
# RequestSigner Error
|
100
|
+
class Error < CloudApi::Error
|
101
|
+
end
|
102
|
+
|
103
|
+
# Default API version for Route53 service.
|
104
|
+
# To override the API version use :api_version key when instantiating a manager.
|
105
|
+
#
|
106
|
+
DEFAULT_API_VERSION = '20140515'
|
107
|
+
|
108
|
+
include Mixin::QueryApiPatterns
|
109
|
+
|
110
|
+
set_routine CloudApi::RetryManager
|
111
|
+
set_routine CloudApi::RequestInitializer
|
112
|
+
set_routine AWS::Route53::Domain::RequestSigner
|
113
|
+
set_routine CloudApi::RequestGenerator
|
114
|
+
set_routine CloudApi::ConnectionProxy
|
115
|
+
set_routine CloudApi::ResponseAnalyzer
|
116
|
+
set_routine CloudApi::ResponseParser
|
117
|
+
set_routine CloudApi::ResultWrapper
|
118
|
+
|
119
|
+
set :response_error_parser => Parser::AWS::ResponseErrorV2
|
120
|
+
|
121
|
+
|
122
|
+
# Constructor
|
123
|
+
#
|
124
|
+
# @param [String] aws_access_key_id
|
125
|
+
# @param [String] aws_secret_access_key
|
126
|
+
# @param [String] endpoint
|
127
|
+
# @param [Hash] options
|
128
|
+
#
|
129
|
+
# @example
|
130
|
+
# # see Manager class usage
|
131
|
+
#
|
132
|
+
# @see Manager
|
133
|
+
#
|
134
|
+
def initialize(aws_access_key_id, aws_secret_access_key, endpoint, options={})
|
135
|
+
credentials = { :aws_access_key_id => aws_access_key_id,
|
136
|
+
:aws_secret_access_key => aws_secret_access_key }
|
137
|
+
super(credentials, endpoint, options)
|
138
|
+
end
|
139
|
+
|
140
|
+
|
141
|
+
# Makes an API call to AWS::Route53 compatible cloud
|
142
|
+
#
|
143
|
+
# @param [String,Symbol] verb
|
144
|
+
# @param [Objects] args
|
145
|
+
#
|
146
|
+
# @return [Object]
|
147
|
+
#
|
148
|
+
# @example
|
149
|
+
# api(verb, opts={})
|
150
|
+
# # Where opts may have next keys: :options, :headers, :params
|
151
|
+
# api(verb, 'path', opts={})
|
152
|
+
#
|
153
|
+
def api(verb, *args, &block)
|
154
|
+
relative_path = args.first.is_a?(String) ? args.shift : ''
|
155
|
+
opts = args.shift || {}
|
156
|
+
raise Error::new("Opts must be Hash not #{opts.class.name}") unless opts.is_a?(Hash)
|
157
|
+
process_api_request(verb, relative_path, opts, &block)
|
158
|
+
end
|
159
|
+
|
160
|
+
end
|
161
|
+
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2013 RightScale, Inc.
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# 'Software'), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
18
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
19
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
20
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
21
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module RightScale
|
25
|
+
module CloudApi
|
26
|
+
module AWS
|
27
|
+
module Route53
|
28
|
+
module Domain
|
29
|
+
|
30
|
+
# Route 53 request signer
|
31
|
+
class RequestSigner < CloudApi::Routine
|
32
|
+
|
33
|
+
# Route53 RequestSigner Error
|
34
|
+
class Error < CloudApi::Error
|
35
|
+
end
|
36
|
+
|
37
|
+
# Authenticates a Route53 request
|
38
|
+
#
|
39
|
+
# @return [void]
|
40
|
+
#
|
41
|
+
# @example
|
42
|
+
# # no example
|
43
|
+
#
|
44
|
+
def process
|
45
|
+
# Fix body
|
46
|
+
unless @data[:request][:body]._blank?
|
47
|
+
# Make sure 'content-type' is set if we have a body
|
48
|
+
@data[:request][:headers].set_if_blank('content-type', 'application/x-amz-json-1.1' )
|
49
|
+
# Fix body if it is a Hash instance
|
50
|
+
if @data[:request][:body].is_a?(Hash)
|
51
|
+
@data[:request][:body] = Utils::contentify_body(@data[:request][:body], @data[:request][:headers]['content-type'])
|
52
|
+
end
|
53
|
+
# Calculate 'content-md5' when possible (some API calls wanna have it set)
|
54
|
+
if @data[:request][:body].is_a?(String)
|
55
|
+
@data[:request][:headers]['content-md5'] = Base64::encode64(Digest::MD5::digest(@data[:request][:body])).strip
|
56
|
+
end
|
57
|
+
end
|
58
|
+
# Set date
|
59
|
+
@data[:request][:headers].set_if_blank('x-amz-date', Time::now.utc.httpdate)
|
60
|
+
# Set path
|
61
|
+
@data[:request][:path] = Utils::join_urn(@data[:connection][:uri].path, @data[:request][:relative_path], @data[:request][:params])
|
62
|
+
# Sign a request
|
63
|
+
Utils::AWS::sign_v4_signature(
|
64
|
+
@data[:credentials][:aws_access_key_id],
|
65
|
+
@data[:credentials][:aws_secret_access_key],
|
66
|
+
@data[:connection][:uri].host,
|
67
|
+
@data[:request]
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,278 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2013 RightScale, Inc.
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
# a copy of this software and associated documentation files (the
|
6
|
+
# 'Software'), to deal in the Software without restriction, including
|
7
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
# the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be
|
13
|
+
# included in all copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
18
|
+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
19
|
+
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
20
|
+
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
21
|
+
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
#++
|
23
|
+
|
24
|
+
module RightScale
|
25
|
+
module CloudApi
|
26
|
+
module AWS
|
27
|
+
module Route53
|
28
|
+
module Domain
|
29
|
+
|
30
|
+
# Route 53 Domain wrapper namespace
|
31
|
+
module Wrapper
|
32
|
+
|
33
|
+
# Default wrapper
|
34
|
+
module DEFAULT
|
35
|
+
|
36
|
+
# Defines QUERY API like methods for the service
|
37
|
+
#
|
38
|
+
# @return [void]
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# # no example
|
42
|
+
#
|
43
|
+
def self.extended(base)
|
44
|
+
|
45
|
+
#----------------------
|
46
|
+
# Domain Registration
|
47
|
+
#----------------------
|
48
|
+
|
49
|
+
# Attention: host: route53domains.us-east-1.amazonaws.com
|
50
|
+
|
51
|
+
base.query_api_pattern 'CheckDomainAvailability', :post, '',
|
52
|
+
:headers => {
|
53
|
+
'content-type' => 'application/x-amz-json-1.1',
|
54
|
+
'x-amz-target' => 'Route53Domains_v20140515.CheckDomainAvailability'
|
55
|
+
},
|
56
|
+
:body => {
|
57
|
+
'DomainName' => :DomainName
|
58
|
+
}
|
59
|
+
|
60
|
+
base.query_api_pattern 'RegisterDomain', :post, '',
|
61
|
+
:headers => {
|
62
|
+
'content-type' => 'application/x-amz-json-1.1',
|
63
|
+
'x-amz-target' => 'Route53Domains_v20140515.RegisterDomain'
|
64
|
+
},
|
65
|
+
:body => {
|
66
|
+
'DomainName' => :DomainName,
|
67
|
+
'DurationInYears' => :DurationInYears,
|
68
|
+
'AutoRenew' => :AutoRenew,
|
69
|
+
'RegistrantContact' => :RegistrantContact,
|
70
|
+
'AdminContact' => :AdminContact,
|
71
|
+
'TechContact' => :TechContact,
|
72
|
+
'PrivacyProtectionRegistrantContact' => :PrivacyProtectionRegistrantContact,
|
73
|
+
'PrivacyProtectionAdminContact' => :PrivacyProtectionAdminContact,
|
74
|
+
'PrivacyProtectionTechContact' => :PrivacyProtectionTechContact
|
75
|
+
},
|
76
|
+
:defaults => {
|
77
|
+
:AutoRenew => Utils::NONE,
|
78
|
+
:PrivacyProtectionRegistrantContact => Utils::NONE,
|
79
|
+
:PrivacyProtectAdminContact => Utils::NONE,
|
80
|
+
:PrivacyProtectTechContact => Utils::NONE
|
81
|
+
}
|
82
|
+
|
83
|
+
base.query_api_pattern 'UpdateDomainContact', :post, '',
|
84
|
+
:headers => {
|
85
|
+
'content-type' => 'application/x-amz-json-1.1',
|
86
|
+
'x-amz-target' => 'Route53Domains_v20140515.UpdateDomainContact'
|
87
|
+
},
|
88
|
+
:body => {
|
89
|
+
'DomainName' => :DomainName,
|
90
|
+
'RegistrantContact' => :RegistrantContact,
|
91
|
+
'AdminContact' => :AdminContact,
|
92
|
+
'TechContact' => :TechContact
|
93
|
+
}
|
94
|
+
|
95
|
+
base.query_api_pattern 'UpdateDomainNameservers', :post, '',
|
96
|
+
:headers => {
|
97
|
+
'content-type' => 'application/x-amz-json-1.1',
|
98
|
+
'x-amz-target' => 'Route53Domains_v20140515.UpdateDomainNameservers'
|
99
|
+
},
|
100
|
+
:body => {
|
101
|
+
'DomainName' => :DomainName,
|
102
|
+
'Nameservers' => :Nameservers
|
103
|
+
}
|
104
|
+
|
105
|
+
base.query_api_pattern 'UpdateDomainContactPrivacy', :post, '',
|
106
|
+
:headers => {
|
107
|
+
'content-type' => 'application/x-amz-json-1.1',
|
108
|
+
'x-amz-target' => 'Route53Domains_v20140515.UpdateDomainContactPrivacy'
|
109
|
+
},
|
110
|
+
:body => {
|
111
|
+
'DomainName' => :DomainName,
|
112
|
+
'AdminPrivacy' => :AdminPrivacy,
|
113
|
+
'RegistrantPrivacy' => :RegistrantPrivacy,
|
114
|
+
'TechPrivacy' => :TechPrivacy
|
115
|
+
},
|
116
|
+
:defaults => {
|
117
|
+
:AdminPrivacy => Utils::NONE,
|
118
|
+
:RegistrantPrivacy => Utils::NONE,
|
119
|
+
:TechPrivacy => Utils::NONE
|
120
|
+
}
|
121
|
+
|
122
|
+
base.query_api_pattern 'EnableDomainAutoRenew', :post, '',
|
123
|
+
:headers => {
|
124
|
+
'content-type' => 'application/x-amz-json-1.1',
|
125
|
+
'x-amz-target' => 'Route53Domains_v20140515.EnableDomainAutoRenew'
|
126
|
+
},
|
127
|
+
:body => {
|
128
|
+
'DomainName' => :DomainName
|
129
|
+
}
|
130
|
+
|
131
|
+
base.query_api_pattern 'DisableDomainAutoRenew', :post, '',
|
132
|
+
:headers => {
|
133
|
+
'content-type' => 'application/x-amz-json-1.1',
|
134
|
+
'x-amz-target' => 'Route53Domains_v20140515.DisableDomainAutoRenew'
|
135
|
+
},
|
136
|
+
:body => {
|
137
|
+
'DomainName' => :DomainName
|
138
|
+
}
|
139
|
+
|
140
|
+
base.query_api_pattern 'ListDomains', :post, '',
|
141
|
+
:headers => {
|
142
|
+
'content-type' => 'application/x-amz-json-1.1',
|
143
|
+
'x-amz-target' => 'Route53Domains_v20140515.ListDomains'
|
144
|
+
},
|
145
|
+
:body => {
|
146
|
+
'Marker' => :Marker,
|
147
|
+
'MaxItems' => :MaxItems
|
148
|
+
},
|
149
|
+
:defaults => {
|
150
|
+
:Marker => Utils::NONE,
|
151
|
+
:MaxItems => Utils::NONE
|
152
|
+
}
|
153
|
+
|
154
|
+
base.query_api_pattern 'GetDomainDetail', :post, '',
|
155
|
+
:headers => {
|
156
|
+
'content-type' => 'application/x-amz-json-1.1',
|
157
|
+
'x-amz-target' => 'Route53Domains_v20140515.GetDomainDetail'
|
158
|
+
},
|
159
|
+
:body => {
|
160
|
+
'DomainName' => :DomainName
|
161
|
+
}
|
162
|
+
|
163
|
+
base.query_api_pattern 'ListOperations', :post, '',
|
164
|
+
:headers => {
|
165
|
+
'content-type' => 'application/x-amz-json-1.1',
|
166
|
+
'x-amz-target' => 'Route53Domains_v20140515.ListOperations'
|
167
|
+
},
|
168
|
+
:body => {
|
169
|
+
'Marker' => :Marker,
|
170
|
+
'MaxItems' => :MaxItems
|
171
|
+
},
|
172
|
+
:defaults => {
|
173
|
+
:Marker => Utils::NONE,
|
174
|
+
:MaxItems => Utils::NONE
|
175
|
+
}
|
176
|
+
|
177
|
+
|
178
|
+
base.query_api_pattern 'GetOperationDetail', :post, '',
|
179
|
+
:headers => {
|
180
|
+
'content-type' => 'application/x-amz-json-1.1',
|
181
|
+
'x-amz-target' => 'Route53Domains_v20140515.GetOperationDetail'
|
182
|
+
},
|
183
|
+
:body => {
|
184
|
+
'OperationId' => :OperationId
|
185
|
+
}
|
186
|
+
|
187
|
+
base.query_api_pattern 'DisableDomainTransferLock', :post, '',
|
188
|
+
:headers => {
|
189
|
+
'content-type' => 'application/x-amz-json-1.1',
|
190
|
+
'x-amz-target' => 'Route53Domains_v20140515.DisableDomainTransferLock'
|
191
|
+
},
|
192
|
+
:body => {
|
193
|
+
'DomainName' => :DomainName
|
194
|
+
}
|
195
|
+
|
196
|
+
base.query_api_pattern 'EnableDomainTransferLock', :post, '',
|
197
|
+
:headers => {
|
198
|
+
'content-type' => 'application/x-amz-json-1.1',
|
199
|
+
'x-amz-target' => 'Route53Domains_v20140515.EnableDomainTransferLock'
|
200
|
+
},
|
201
|
+
:body => {
|
202
|
+
'DomainName' => :DomainName
|
203
|
+
}
|
204
|
+
|
205
|
+
base.query_api_pattern 'RetrieveDomainAuthCode', :post, '',
|
206
|
+
:headers => {
|
207
|
+
'content-type' => 'application/x-amz-json-1.1',
|
208
|
+
'x-amz-target' => 'Route53Domains_v20140515.RetrieveDomainAuthCode'
|
209
|
+
},
|
210
|
+
:body => {
|
211
|
+
'DomainName' => :DomainName
|
212
|
+
}
|
213
|
+
|
214
|
+
base.query_api_pattern 'TransferDomain', :post, '',
|
215
|
+
:headers => {
|
216
|
+
'content-type' => 'application/x-amz-json-1.1',
|
217
|
+
'x-amz-target' => 'Route53Domains_v20140515.TransferDomain'
|
218
|
+
},
|
219
|
+
:body => {
|
220
|
+
'DomainName' => :DomainName,
|
221
|
+
'DurationInYears' => :DurationInYears,
|
222
|
+
'AuthCode' => :AuthCode,
|
223
|
+
'AutoRenew' => :AutoRenew,
|
224
|
+
'RegistrantContact' => :RegistrantContact,
|
225
|
+
'AdminContact' => :AdminContact,
|
226
|
+
'TechContact' => :TechContact,
|
227
|
+
'PrivacyProtectionRegistrantContact' => :PrivacyProtectionRegistrantContact,
|
228
|
+
'PrivacyProtectionAdminContact' => :PrivacyProtectionAdminContact,
|
229
|
+
'PrivacyProtectionTechContact' => :PrivacyProtectionTechContact
|
230
|
+
},
|
231
|
+
:defaults => {
|
232
|
+
:AutoRenew => Utils::NONE,
|
233
|
+
:PrivacyProtectionRegistrantContact => Utils::NONE,
|
234
|
+
:PrivacyProtectAdminContact => Utils::NONE,
|
235
|
+
:PrivacyProtectTechContact => Utils::NONE
|
236
|
+
}
|
237
|
+
|
238
|
+
#----------------------
|
239
|
+
# Actions on Tags for Domains
|
240
|
+
#----------------------
|
241
|
+
|
242
|
+
base.query_api_pattern 'UpdateTagsForDomains', :post, '',
|
243
|
+
:headers => {
|
244
|
+
'content-type' => 'application/x-amz-json-1.1',
|
245
|
+
'x-amz-target' => 'Route53Domains_v20140515.UpdateTagsForDomains'
|
246
|
+
},
|
247
|
+
:body => {
|
248
|
+
'DomainName' => :DomainName,
|
249
|
+
'TagsToUpdate' => :TagsToUpdate
|
250
|
+
}
|
251
|
+
|
252
|
+
base.query_api_pattern 'ListTagsForDomain', :post, '',
|
253
|
+
:headers => {
|
254
|
+
'content-type' => 'application/x-amz-json-1.1',
|
255
|
+
'x-amz-target' => 'Route53Domains_v20140515.ListTagsForDomain'
|
256
|
+
},
|
257
|
+
:body => {
|
258
|
+
'DomainName' => :DomainName
|
259
|
+
}
|
260
|
+
|
261
|
+
base.query_api_pattern 'DeleteTagsForDomain', :post, '',
|
262
|
+
:headers => {
|
263
|
+
'content-type' => 'application/x-amz-json-1.1',
|
264
|
+
'x-amz-target' => 'Route53Domains_v20140515.DeleteTagsForDomain'
|
265
|
+
},
|
266
|
+
:body => {
|
267
|
+
'DomainName' => :DomainName,
|
268
|
+
'TagsToDelete' => :TagsToDelete
|
269
|
+
}
|
270
|
+
|
271
|
+
end
|
272
|
+
end
|
273
|
+
end
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|
278
|
+
end
|
@@ -35,6 +35,46 @@ module RightScale
|
|
35
35
|
|
36
36
|
# Amazon Route 53 (Route53) compatible manager (thread safe).
|
37
37
|
#
|
38
|
+
# Supported API calls:
|
39
|
+
# - using get, post, put, etc methods:
|
40
|
+
# - any API call for any API version
|
41
|
+
# - using predefined methods in wrappers/default.rb (only API version 2013-04-01):
|
42
|
+
# # Hosted Zones
|
43
|
+
# - AssociateVPCWithHostedZone
|
44
|
+
# - CreateHostedZone
|
45
|
+
# - DeleteHostedZone
|
46
|
+
# - DisassociateVPCFromHostedZone
|
47
|
+
# - GetHostedZone
|
48
|
+
# - GetHostedZoneCount
|
49
|
+
# - ListHostedZone
|
50
|
+
# - ListHostedZonesByName
|
51
|
+
# - UpdateHostedZoneComment
|
52
|
+
# # Resource Record Sets
|
53
|
+
# - ChangeResourceRecordSets
|
54
|
+
# - GetChange
|
55
|
+
# - GetGeoLocation
|
56
|
+
# - ListGeoLocations
|
57
|
+
# - ListResourceRecordSets
|
58
|
+
# # Reusable Delegation Sets
|
59
|
+
# - CreateReusableDelegationSet
|
60
|
+
# - DeleteReusableDelegationSet
|
61
|
+
# - GetReusableDelegationSet
|
62
|
+
# - ListReusableDelegationSets
|
63
|
+
# # Health Check
|
64
|
+
# - CreateHealthCheck
|
65
|
+
# - DeleteHealthCheck
|
66
|
+
# - GetCheckerIpRanges
|
67
|
+
# - GetHealthCheck
|
68
|
+
# - GetHealthCheckCount
|
69
|
+
# - GetHealthCheckLastFailureReason
|
70
|
+
# - GetHealthCheckStatus
|
71
|
+
# - ListHealthChecks
|
72
|
+
# - UpdateHealthCheck
|
73
|
+
# # Tags for Hosted Zones and Health Checks
|
74
|
+
# - ChangeTagsForResource
|
75
|
+
# - ListTagsForResource
|
76
|
+
# - ListTagsForResources
|
77
|
+
#
|
38
78
|
# @example
|
39
79
|
# require "right_aws_api"
|
40
80
|
#
|
@@ -44,7 +84,7 @@ module RightScale
|
|
44
84
|
# 'https://route53.amazonaws.com'
|
45
85
|
# )
|
46
86
|
#
|
47
|
-
# r53.ListHostedZones #=>
|
87
|
+
# r53.ListHostedZones #=>
|
48
88
|
# {"ListHostedZonesResponse"=>
|
49
89
|
# {"IsTruncated"=>"false",
|
50
90
|
# "HostedZones"=>
|
@@ -54,15 +94,15 @@ module RightScale
|
|
54
94
|
# "Config"=>{"Comment"=>"This is RightScale test hosted zone."},
|
55
95
|
# "Id"=>"/hostedzone/Z3AINKOIEY1X3X"}},
|
56
96
|
# "MaxItems"=>"100",
|
57
|
-
# "@xmlns"=>"https://route53.amazonaws.com/doc/
|
97
|
+
# "@xmlns"=>"https://route53.amazonaws.com/doc/2013-04-01/"}}
|
58
98
|
#
|
59
99
|
#
|
60
100
|
# @example
|
61
|
-
# r53.ListResourceRecordSets #=>
|
101
|
+
# r53.ListResourceRecordSets #=>
|
62
102
|
# {"ListResourceRecordSetsResponse"=>
|
63
103
|
# {"IsTruncated"=>"false",
|
64
104
|
# "MaxItems"=>"100",
|
65
|
-
# "@xmlns"=>"https://route53.amazonaws.com/doc/
|
105
|
+
# "@xmlns"=>"https://route53.amazonaws.com/doc/2013-04-01/",
|
66
106
|
# "ResourceRecordSets"=>
|
67
107
|
# {"ResourceRecordSet"=>
|
68
108
|
# [{"ResourceRecords"=>
|
@@ -111,11 +151,11 @@ module RightScale
|
|
111
151
|
# RequestSigner Error
|
112
152
|
class Error < CloudApi::Error
|
113
153
|
end
|
114
|
-
|
154
|
+
|
115
155
|
# Default API version for Route53 service.
|
116
156
|
# To override the API version use :api_version key when instantiating a manager.
|
117
157
|
#
|
118
|
-
DEFAULT_API_VERSION = '
|
158
|
+
DEFAULT_API_VERSION = '2013-04-01'
|
119
159
|
|
120
160
|
include Mixin::QueryApiPatterns
|
121
161
|
|
@@ -141,7 +181,7 @@ module RightScale
|
|
141
181
|
# @example
|
142
182
|
# # see Manager class usage
|
143
183
|
#
|
144
|
-
# @see Manager
|
184
|
+
# @see Manager
|
145
185
|
#
|
146
186
|
def initialize(aws_access_key_id, aws_secret_access_key, endpoint, options={})
|
147
187
|
credentials = { :aws_access_key_id => aws_access_key_id,
|
@@ -168,7 +208,7 @@ module RightScale
|
|
168
208
|
raise Error::new("Opts must be Hash not #{opts.class.name}") unless opts.is_a?(Hash)
|
169
209
|
process_api_request(verb, relative_path, opts, &block)
|
170
210
|
end
|
171
|
-
|
211
|
+
|
172
212
|
end
|
173
213
|
|
174
214
|
end
|
@@ -25,7 +25,7 @@ module RightScale
|
|
25
25
|
module CloudApi
|
26
26
|
module AWS
|
27
27
|
module Route53
|
28
|
-
|
28
|
+
|
29
29
|
# Route 53 request signer
|
30
30
|
class RequestSigner < CloudApi::Routine
|
31
31
|
|
@@ -55,14 +55,18 @@ module RightScale
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
# Set date
|
58
|
-
@data[:request][:headers].set_if_blank('date', Time::now.utc.httpdate)
|
59
|
-
# Sign a request
|
60
|
-
signature = Utils::AWS::sign(@data[:credentials][:aws_secret_access_key], Utils::dearrayify(@data[:request][:headers]['date']))
|
61
|
-
@data[:request][:headers]['x-amzn-authorization'] = "AWS3-HTTPS AWSAccessKeyId=#{@data[:credentials][:aws_access_key_id]},Algorithm=HmacSHA1,Signature=#{signature}"
|
58
|
+
@data[:request][:headers].set_if_blank('x-amz-date', Time::now.utc.httpdate)
|
62
59
|
# Set path
|
63
60
|
@data[:request][:path] = Utils::join_urn(@data[:connection][:uri].path, @data[:options][:api_version], @data[:request][:relative_path], @data[:request][:params])
|
61
|
+
# Sign a request
|
62
|
+
Utils::AWS::sign_v4_signature(
|
63
|
+
@data[:credentials][:aws_access_key_id],
|
64
|
+
@data[:credentials][:aws_secret_access_key],
|
65
|
+
@data[:connection][:uri].host,
|
66
|
+
@data[:request]
|
67
|
+
)
|
64
68
|
end
|
65
|
-
|
69
|
+
|
66
70
|
end
|
67
71
|
end
|
68
72
|
end
|
@@ -31,7 +31,7 @@ module RightScale
|
|
31
31
|
|
32
32
|
# Default wrapper
|
33
33
|
module DEFAULT
|
34
|
-
|
34
|
+
|
35
35
|
# Defines QUERY API like methods for the service
|
36
36
|
#
|
37
37
|
# @return [void]
|
@@ -44,47 +44,89 @@ module RightScale
|
|
44
44
|
#-----------------
|
45
45
|
# Hosted Zones
|
46
46
|
#-----------------
|
47
|
-
|
48
|
-
|
49
|
-
base.query_api_pattern 'ListHostedZones', :get, 'hostedzone'
|
50
|
-
|
51
|
-
|
52
|
-
base.query_api_pattern 'GetHostedZone', :get, 'hostedzone/{:HostedZoneId}'
|
53
47
|
|
54
|
-
|
55
|
-
base.query_api_pattern 'CreateHostedZones', :post, 'hostedzone',
|
48
|
+
base.query_api_pattern 'CreateHostedZone', :post, 'hostedzone',
|
56
49
|
:body => {
|
57
50
|
'CreateHostedZoneRequest' => {
|
58
51
|
'Name' => :Name,
|
59
52
|
'CallerReference' => :CallerReference,
|
60
53
|
'HostedZoneConfig{!remove-if-blank}' => {
|
61
54
|
'Comment' => :Comment
|
55
|
+
},
|
56
|
+
'DelegationSetId' => :DelegationSetId,
|
57
|
+
'VPC{!remove-if-blank}' => {
|
58
|
+
'VPCId' => :VPCId,
|
59
|
+
'VPCRegion' => :VPCRegion
|
62
60
|
}
|
63
61
|
}
|
64
62
|
},
|
65
63
|
:defaults => {
|
66
|
-
:Comment
|
64
|
+
:Comment => Utils::NONE,
|
65
|
+
:DelegationSetId => Utils::NONE,
|
66
|
+
:VPCId => Utils::NONE,
|
67
|
+
:VPCRegion => Utils::NONE
|
67
68
|
}
|
68
|
-
|
69
|
-
|
69
|
+
|
70
|
+
base.query_api_pattern 'ListHostedZone', :get, 'hostedzone'
|
71
|
+
|
72
|
+
base.query_api_pattern 'ListHostedZonesByName', :get, 'hostedzonesbyname'
|
73
|
+
|
74
|
+
base.query_api_pattern 'GetHostedZone', :get, 'hostedzone/{:HostedZoneId}'
|
75
|
+
|
76
|
+
base.query_api_pattern 'GetHostedZoneCount', :get, 'hostedzonecount'
|
77
|
+
|
78
|
+
base.query_api_pattern 'UpdateHostedZoneComment', :post, 'hostedzone/{:HostedZoneId}',
|
79
|
+
:body => {
|
80
|
+
'UpdateHostedZoneCommentRequest' => {
|
81
|
+
'Comment' => :Comment
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
base.query_api_pattern 'AssociateVPCWithHostedZone', :post, 'hostedzone/{:HostedZoneId}/associatevpc',
|
86
|
+
:body => {
|
87
|
+
'AssociateVPCWithHostedZoneRequest' => {
|
88
|
+
'VPC{!remove-if-blank}' => {
|
89
|
+
'VPCId' => :VPCId,
|
90
|
+
'VPCRegion' => :VPCRegion
|
91
|
+
},
|
92
|
+
'Comment' => :Comment
|
93
|
+
}
|
94
|
+
},
|
95
|
+
:defaults => {
|
96
|
+
:Comment => Utils::NONE,
|
97
|
+
}
|
98
|
+
|
99
|
+
base.query_api_pattern 'DisassociateVPCFromHostedZone', :post, 'hostedzone/{:HostedZoneId}/disassociatevpc',
|
100
|
+
:body => {
|
101
|
+
'DisassociateVPCFromHostedZoneRequest' => {
|
102
|
+
'VPC{!remove-if-blank}' => {
|
103
|
+
'VPCId' => :VPCId,
|
104
|
+
'VPCRegion' => :VPCRegion
|
105
|
+
},
|
106
|
+
'Comment' => :Comment
|
107
|
+
}
|
108
|
+
},
|
109
|
+
:defaults => {
|
110
|
+
:Comment => Utils::NONE,
|
111
|
+
}
|
112
|
+
|
70
113
|
base.query_api_pattern 'DeleteHostedZone', :delete, 'hostedzone/{:HostedZoneId}'
|
71
|
-
|
72
114
|
|
73
115
|
#----------------------
|
74
116
|
# Resource Record Sets
|
75
117
|
#----------------------
|
76
118
|
|
77
|
-
|
78
119
|
base.query_api_pattern 'ListResourceRecordSets', :get, 'hostedzone/{:HostedZoneId}/rrset'
|
79
|
-
|
80
120
|
|
81
121
|
base.query_api_pattern 'GetChange', :get, 'change/{:ChangeId}'
|
82
|
-
|
83
|
-
|
122
|
+
|
123
|
+
base.query_api_pattern 'GetGeoLocation', :get, 'geolocation'
|
124
|
+
|
125
|
+
base.query_api_pattern 'ListGeoLocations', :get, 'geolocations'
|
126
|
+
|
84
127
|
base.query_api_pattern 'ChangeResourceRecordSets', :post, 'hostedzone/{:HostedZoneId}/rrset',
|
85
128
|
:body => {
|
86
129
|
'ChangeResourceRecordSetsRequest' => {
|
87
|
-
'@xmlns' => 'https://route53.amazonaws.com/doc/2011-05-05/',
|
88
130
|
'ChangeBatch' => {
|
89
131
|
'Comment' => :Comment,
|
90
132
|
'Changes' => {
|
@@ -94,17 +136,25 @@ module RightScale
|
|
94
136
|
'Name' => :Name,
|
95
137
|
'Type' => :Type,
|
96
138
|
'AliasTarget{!remove-if-blank}' => {
|
97
|
-
'HostedZoneId'
|
98
|
-
'DNSName'
|
139
|
+
'HostedZoneId' => :TargetHostedZoneId,
|
140
|
+
'DNSName' => :DNSName,
|
141
|
+
'EvaluateTargetHealth' => :EvaluateTargetHealth
|
142
|
+
},
|
143
|
+
'GeoLocation{!remove-if-blank}' => {
|
144
|
+
'ContinentCode' => :ContinentCode,
|
145
|
+
'CountryCode' => :CountryCode,
|
146
|
+
'SubdivisionCode' => :SubdivisionCode
|
99
147
|
},
|
100
148
|
'SetIdentifier' => :SetIdentifier,
|
101
149
|
'Weight' => :Weight,
|
102
150
|
'TTL' => :TTL,
|
151
|
+
'Failover' => :Failover,
|
103
152
|
'ResourceRecords{!remove-if-blank}' => {
|
104
153
|
'ResourceRecord{!remove-if-blank}' => {
|
105
154
|
'Value' => :ResourceRecord
|
106
155
|
}
|
107
|
-
}
|
156
|
+
},
|
157
|
+
'HealthCheckId' => :HealthCheckId
|
108
158
|
}
|
109
159
|
}
|
110
160
|
}
|
@@ -112,19 +162,135 @@ module RightScale
|
|
112
162
|
}
|
113
163
|
},
|
114
164
|
:defaults => {
|
115
|
-
:Comment
|
116
|
-
:TTL
|
117
|
-
:DNSName
|
118
|
-
:
|
119
|
-
:SetIdentifier
|
120
|
-
:Weight
|
121
|
-
:ResourceRecord
|
165
|
+
:Comment => Utils::NONE,
|
166
|
+
:TTL => Utils::NONE,
|
167
|
+
:DNSName => Utils::NONE,
|
168
|
+
:TargetHostedZoneId => Utils::NONE,
|
169
|
+
:SetIdentifier => Utils::NONE,
|
170
|
+
:Weight => Utils::NONE,
|
171
|
+
:ResourceRecord => Utils::NONE,
|
172
|
+
:HealthCheckId => Utils::NONE,
|
173
|
+
:EvaluateTargetHealth => Utils::NONE,
|
174
|
+
:Failover => Utils::NONE,
|
175
|
+
:ContinentCode => Utils::NONE,
|
176
|
+
:CountryCode => Utils::NONE,
|
177
|
+
:SubdivisionCode => Utils::NONE
|
122
178
|
}
|
123
|
-
|
124
|
-
|
179
|
+
|
180
|
+
#----------------------
|
181
|
+
# Reusable Delegation Sets
|
182
|
+
#----------------------
|
183
|
+
|
184
|
+
base.query_api_pattern 'CreateReusableDelegationSet', :post, 'delegationset',
|
185
|
+
:body => {
|
186
|
+
'CreateReusableDelegationSetRequest' => {
|
187
|
+
'CallerReference' => :CallerReference,
|
188
|
+
'HostedZoneId' => :HostedZoneId
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
base.query_api_pattern 'ListReusableDelegationSets', :get, 'delegationset'
|
193
|
+
|
194
|
+
base.query_api_pattern 'GetReusableDelegationSet', :get, 'delegationset/{:ReusableDelegationSetId}'
|
195
|
+
|
196
|
+
base.query_api_pattern 'DeleteReusableDelegationSet', :delete, 'delegationset/{:ReusableDelegationSetId}'
|
197
|
+
|
198
|
+
#----------------------
|
199
|
+
# Health Check
|
200
|
+
#----------------------
|
201
|
+
|
202
|
+
base.query_api_pattern 'CreateHealthCheck', :post, 'healthcheck',
|
203
|
+
:body => {
|
204
|
+
'CreateHealthCheckRequest' => {
|
205
|
+
'CallerReference' => :CallerReference,
|
206
|
+
'HealthCheckConfig' => {
|
207
|
+
'IPAddress' => :IPAddress,
|
208
|
+
'Port' => :Port,
|
209
|
+
'Type' => :Type,
|
210
|
+
'FullyQualifiedDomainName' => :FullyQualifiedDomainName,
|
211
|
+
'SearchString' => :SearchString,
|
212
|
+
'RequestInterval' => :RequestInterval,
|
213
|
+
'FailureThreshold' => :FailureThreshold
|
214
|
+
}
|
215
|
+
}
|
216
|
+
},
|
217
|
+
:defaults => {
|
218
|
+
:IPAddress => Utils::NONE,
|
219
|
+
:Port => Utils::NONE,
|
220
|
+
:ResourcePath => Utils::NONE,
|
221
|
+
:FullyQualifiedDomainName => Utils::NONE,
|
222
|
+
:SearchString => Utils::NONE,
|
223
|
+
:RequestInterval => Utils::NONE,
|
224
|
+
:FailureThreshold => Utils::NONE,
|
225
|
+
}
|
226
|
+
|
227
|
+
base.query_api_pattern 'UpdateHealthCheck', :post, 'healthcheck/{:HealthCheckId}',
|
228
|
+
:body => {
|
229
|
+
'CreateHealthCheckRequest' => {
|
230
|
+
'HealthCheckVersion' => :HealthCheckVersion,
|
231
|
+
'IPAddress' => :IPAddress,
|
232
|
+
'Port' => :Port,
|
233
|
+
'FullyQualifiedDomainName' => :FullyQualifiedDomainName,
|
234
|
+
'SearchString' => :SearchString,
|
235
|
+
'RequestInterval' => :RequestInterval,
|
236
|
+
'FailureThreshold' => :FailureThreshold
|
237
|
+
}
|
238
|
+
},
|
239
|
+
:defaults => {
|
240
|
+
:IPAddress => Utils::NONE,
|
241
|
+
:Port => Utils::NONE,
|
242
|
+
:ResourcePath => Utils::NONE,
|
243
|
+
:FullyQualifiedDomainName => Utils::NONE,
|
244
|
+
:SearchString => Utils::NONE,
|
245
|
+
:RequestInterval => Utils::NONE,
|
246
|
+
:FailureThreshold => Utils::NONE,
|
247
|
+
}
|
248
|
+
|
249
|
+
base.query_api_pattern 'ListHealthChecks', :get, 'healthcheck'
|
250
|
+
|
251
|
+
base.query_api_pattern 'GetHealthCheck', :get, 'healthcheck/{:HealthCheckId}'
|
252
|
+
|
253
|
+
base.query_api_pattern 'GetHealthCheckStatus', :get, 'healthcheck/{:HealthCheckId}/status'
|
254
|
+
|
255
|
+
base.query_api_pattern 'GetHealthCheckLastFailureReason', :get, 'healthcheck/{:HealthCheckId}/lastfailurereason'
|
256
|
+
|
257
|
+
base.query_api_pattern 'GetCheckerIpRanges', :get, 'checkeripranges'
|
258
|
+
|
259
|
+
base.query_api_pattern 'GetHealthCheckCount', :get, 'healthcheckcount'
|
260
|
+
|
261
|
+
base.query_api_pattern 'DeleteHealthCheck', :delete, 'healthcheck/{:HealthCheckId}'
|
262
|
+
|
263
|
+
#----------------------
|
264
|
+
# Tags for Hosted Zones and Health Checks
|
265
|
+
#----------------------
|
266
|
+
|
267
|
+
base.query_api_pattern 'ChangeTagsForResource', :post, 'tags/{:ResourceType}/{:ResourceId}',
|
268
|
+
:body => {
|
269
|
+
'ChangeTagsForResourceRequest' => {
|
270
|
+
'RemoveTagKeys' => :RemoveTagKeys,
|
271
|
+
'AddTags{!remove-if-blank}' => {
|
272
|
+
'Tag' => :Tag
|
273
|
+
}
|
274
|
+
}
|
275
|
+
},
|
276
|
+
:defaults => {
|
277
|
+
:RemoveTagKeys => Utils::NONE,
|
278
|
+
:Tag => Utils::NONE
|
279
|
+
}
|
280
|
+
|
281
|
+
base.query_api_pattern 'ListTagsForResource', :get, 'tags/{:ResourceType}/{:ResourceId}'
|
282
|
+
|
283
|
+
base.query_api_pattern 'ListTagsForResources', :get, 'tags/{:ResourceType}',
|
284
|
+
:body => {
|
285
|
+
'ListTagsForResourcesRequest' => {
|
286
|
+
'ResourceIds' => {
|
287
|
+
'ResourceId' => :ResourceId
|
288
|
+
}
|
289
|
+
}
|
290
|
+
}
|
291
|
+
|
125
292
|
end
|
126
|
-
|
127
|
-
end
|
293
|
+
end
|
128
294
|
end
|
129
295
|
end
|
130
296
|
end
|
data/lib/right_aws_api.rb
CHANGED
@@ -39,6 +39,7 @@ require "cloud/aws/emr/manager"
|
|
39
39
|
require "cloud/aws/iam/manager"
|
40
40
|
require "cloud/aws/rds/manager"
|
41
41
|
require "cloud/aws/route53/manager"
|
42
|
+
require "cloud/aws/route53/domain/manager"
|
42
43
|
require "cloud/aws/s3/manager"
|
43
44
|
require "cloud/aws/s3/link/manager"
|
44
45
|
require "cloud/aws/sdb/manager"
|
data/right_aws_api.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.require_path = 'lib'
|
36
36
|
spec.required_ruby_version = '>= 1.8.7'
|
37
37
|
|
38
|
-
spec.add_dependency 'right_cloud_api_base', '>= 0.2.
|
38
|
+
spec.add_dependency 'right_cloud_api_base', '>= 0.2.2'
|
39
39
|
|
40
40
|
spec.add_development_dependency 'rake'
|
41
41
|
spec.add_development_dependency 'rspec', '>= 3.0.0'
|
data/spec/describe_calls.rb
CHANGED
@@ -76,7 +76,7 @@ describe RightScale::CloudApi::AWS do
|
|
76
76
|
ec2 = RightScale::CloudApi::AWS::EC2::Manager::new(
|
77
77
|
ENV['AWS_ACCESS_KEY_ID'],
|
78
78
|
ENV['AWS_SECRET_ACCESS_KEY'],
|
79
|
-
'https://us-east-1.
|
79
|
+
'https://ec2.us-east-1.amazonaws.com/',
|
80
80
|
:api_version => '2011-07-15',
|
81
81
|
:logger => nil )
|
82
82
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_aws_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RightScale, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: right_cloud_api_base
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.
|
19
|
+
version: 0.2.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.
|
26
|
+
version: 0.2.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,6 +100,9 @@ files:
|
|
100
100
|
- lib/cloud/aws/emr/manager.rb
|
101
101
|
- lib/cloud/aws/iam/manager.rb
|
102
102
|
- lib/cloud/aws/rds/manager.rb
|
103
|
+
- lib/cloud/aws/route53/domain/manager.rb
|
104
|
+
- lib/cloud/aws/route53/domain/routines/request_signer.rb
|
105
|
+
- lib/cloud/aws/route53/domain/wrappers/default.rb
|
103
106
|
- lib/cloud/aws/route53/manager.rb
|
104
107
|
- lib/cloud/aws/route53/routines/request_signer.rb
|
105
108
|
- lib/cloud/aws/route53/wrappers/default.rb
|