google-cloud-dns 0.30.2 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google-cloud-dns.rb +1 -0
- data/lib/google/cloud/dns.rb +19 -7
- data/lib/google/cloud/dns/service.rb +3 -1
- data/lib/google/cloud/dns/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b9bafa762fcedbd09357499238445ae8824e00be1e5602da94efa1a03d981e6
|
4
|
+
data.tar.gz: 6e77eec9ce5e726c19293614f3ead0c9d939225d098bcf25c7ba76b0c360fde9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb1638265de6117fc67de4a15ae2d930c70d26b37d05810e8dadbe97d634b63116e72a67abad0c699628dc547d9b484f0f72148b897a0ed6ceb7af706fb6ec11
|
7
|
+
data.tar.gz: e3073bc5c171b4e0f6cea8e1a1a45e9a4f0cfdff0286a034fc046ace99fb41e1b2e0f2e67dd3e70cc95debafbf32ee2b0b579839e205fdef2f4c3591dfa93dcc
|
data/CHANGELOG.md
CHANGED
data/lib/google-cloud-dns.rb
CHANGED
@@ -132,4 +132,5 @@ Google::Cloud.configure.add_config! :dns do |config|
|
|
132
132
|
config.add_field! :scope, nil, match: [String, Array]
|
133
133
|
config.add_field! :retries, nil, match: Integer
|
134
134
|
config.add_field! :timeout, nil, match: Integer
|
135
|
+
config.add_field! :endpoint, nil, match: String
|
135
136
|
end
|
data/lib/google/cloud/dns.rb
CHANGED
@@ -56,6 +56,8 @@ module Google
|
|
56
56
|
# @param [Integer] retries Number of times to retry requests on server
|
57
57
|
# error. The default value is `3`. Optional.
|
58
58
|
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
59
|
+
# @param [String] endpoint Override of the endpoint host name. Optional.
|
60
|
+
# If the param is nil, uses the default endpoint.
|
59
61
|
# @param [String] project Alias for the `project_id` argument. Deprecated.
|
60
62
|
# @param [String] keyfile Alias for the `credentials` argument.
|
61
63
|
# Deprecated.
|
@@ -73,26 +75,24 @@ module Google
|
|
73
75
|
# zone = dns.zone "example-com"
|
74
76
|
#
|
75
77
|
def self.new project_id: nil, credentials: nil, scope: nil, retries: nil,
|
76
|
-
timeout: nil, project: nil, keyfile: nil
|
77
|
-
project_id ||= (project || default_project_id)
|
78
|
+
timeout: nil, endpoint: nil, project: nil, keyfile: nil
|
78
79
|
scope ||= configure.scope
|
79
80
|
retries ||= configure.retries
|
80
81
|
timeout ||= configure.timeout
|
82
|
+
endpoint ||= configure.endpoint
|
81
83
|
credentials ||= (keyfile || default_credentials(scope: scope))
|
82
84
|
|
83
85
|
unless credentials.is_a? Google::Auth::Credentials
|
84
86
|
credentials = Dns::Credentials.new credentials, scope: scope
|
85
87
|
end
|
86
88
|
|
87
|
-
|
88
|
-
project_id ||= credentials.project_id
|
89
|
-
end
|
90
|
-
project_id = project_id.to_s # Always cast to a string
|
89
|
+
project_id = resolve_project_id(project_id || project, credentials)
|
91
90
|
raise ArgumentError, "project_id is missing" if project_id.empty?
|
92
91
|
|
93
92
|
Dns::Project.new(
|
94
93
|
Dns::Service.new(
|
95
|
-
project_id, credentials,
|
94
|
+
project_id, credentials,
|
95
|
+
retries: retries, timeout: timeout, host: endpoint
|
96
96
|
)
|
97
97
|
)
|
98
98
|
end
|
@@ -113,6 +113,8 @@ module Google
|
|
113
113
|
# * `retries` - (Integer) Number of times to retry requests on server
|
114
114
|
# error.
|
115
115
|
# * `timeout` - (Integer) Default timeout to use in requests.
|
116
|
+
# * `endpoint` - (String) Override of the endpoint host name, or `nil`
|
117
|
+
# to use the default endpoint.
|
116
118
|
#
|
117
119
|
# @return [Google::Cloud::Config] The configuration object the
|
118
120
|
# Google::Cloud::Dns library uses.
|
@@ -138,6 +140,16 @@ module Google
|
|
138
140
|
Google::Cloud.configure.credentials ||
|
139
141
|
Dns::Credentials.default(scope: scope)
|
140
142
|
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# @private Resolve project.
|
146
|
+
def self.resolve_project_id given_project, credentials
|
147
|
+
project_id = given_project || default_project_id
|
148
|
+
if credentials.respond_to? :project_id
|
149
|
+
project_id ||= credentials.project_id
|
150
|
+
end
|
151
|
+
project_id.to_s # Always cast to a string
|
152
|
+
end
|
141
153
|
end
|
142
154
|
end
|
143
155
|
end
|
@@ -33,7 +33,8 @@ module Google
|
|
33
33
|
|
34
34
|
##
|
35
35
|
# Creates a new Service instance.
|
36
|
-
def initialize project, credentials,
|
36
|
+
def initialize project, credentials,
|
37
|
+
retries: nil, timeout: nil, host: nil
|
37
38
|
@project = project
|
38
39
|
@credentials = credentials
|
39
40
|
@service = API::DnsService.new
|
@@ -48,6 +49,7 @@ module Google
|
|
48
49
|
@service.request_options.header["x-goog-api-client"] = \
|
49
50
|
"gl-ruby/#{RUBY_VERSION} gccl/#{Google::Cloud::Dns::VERSION}"
|
50
51
|
@service.authorization = @credentials.client
|
52
|
+
@service.root_url = host if host
|
51
53
|
end
|
52
54
|
|
53
55
|
def service
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|