google-cloud-dns 0.20.1 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google-cloud-dns.rb +2 -13
- data/lib/google/cloud/dns.rb +83 -45
- data/lib/google/cloud/dns/change.rb +4 -6
- data/lib/google/cloud/dns/change/list.rb +10 -15
- data/lib/google/cloud/dns/project.rb +17 -21
- data/lib/google/cloud/dns/record.rb +2 -3
- data/lib/google/cloud/dns/record/list.rb +10 -15
- data/lib/google/cloud/dns/service.rb +1 -1
- data/lib/google/cloud/dns/version.rb +1 -1
- data/lib/google/cloud/dns/zone.rb +44 -66
- data/lib/google/cloud/dns/zone/list.rb +10 -15
- data/lib/google/cloud/dns/zone/transaction.rb +10 -15
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6947fd835bd40e0220b245a23ff5ce8fd6c345e
|
4
|
+
data.tar.gz: 7bbf7397743eceb0214d3c4dcaa3ce300ab85c4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4884ff082050f241cf3d219f2df796bc7f41c68d3df4b9fd6e38ac1d6ec50b0941f0e5493b7b90ea4c2eae210a648d029ce1653ade4ba793b0a9b2b6cb5154d
|
7
|
+
data.tar.gz: 96bcdaa9a86a8f7c4e7ba934ee6e6463761b8207a77571bda919b9038556471ff4bb42e46f893eca6ef1334bb606dd6e48633e5c28ec4e7283a8e63bb3f6ca8b
|
data/lib/google-cloud-dns.rb
CHANGED
@@ -103,19 +103,8 @@ module Google
|
|
103
103
|
def self.dns project = nil, keyfile = nil, scope: nil, retries: nil,
|
104
104
|
timeout: nil
|
105
105
|
require "google/cloud/dns"
|
106
|
-
|
107
|
-
|
108
|
-
fail ArgumentError, "project is missing" if project.empty?
|
109
|
-
|
110
|
-
if keyfile.nil?
|
111
|
-
credentials = Google::Cloud::Dns::Credentials.default scope: scope
|
112
|
-
else
|
113
|
-
credentials = Google::Cloud::Dns::Credentials.new keyfile, scope: scope
|
114
|
-
end
|
115
|
-
|
116
|
-
Google::Cloud::Dns::Project.new(
|
117
|
-
Google::Cloud::Dns::Service.new(
|
118
|
-
project, credentials, retries: retries, timeout: timeout))
|
106
|
+
Google::Cloud::Dns.new project: project, keyfile: keyfile, scope: scope,
|
107
|
+
retries: retries, timeout: timeout
|
119
108
|
end
|
120
109
|
end
|
121
110
|
end
|
data/lib/google/cloud/dns.rb
CHANGED
@@ -48,10 +48,9 @@ module Google
|
|
48
48
|
# you follow along with these examples.
|
49
49
|
#
|
50
50
|
# ```ruby
|
51
|
-
# require "google/cloud"
|
51
|
+
# require "google/cloud/dns"
|
52
52
|
#
|
53
|
-
#
|
54
|
-
# dns = gcloud.dns
|
53
|
+
# dns = Google::Cloud::Dns.new
|
55
54
|
# zone = dns.create_zone "example-com", "example.com."
|
56
55
|
# puts zone.id # unique identifier defined by the server
|
57
56
|
# ```
|
@@ -64,10 +63,9 @@ module Google
|
|
64
63
|
# You can retrieve all the zones in your project.
|
65
64
|
#
|
66
65
|
# ```ruby
|
67
|
-
# require "google/cloud"
|
66
|
+
# require "google/cloud/dns"
|
68
67
|
#
|
69
|
-
#
|
70
|
-
# dns = gcloud.dns
|
68
|
+
# dns = Google::Cloud::Dns.new
|
71
69
|
# zones = dns.zones
|
72
70
|
# zones.each do |zone|
|
73
71
|
# puts "#{zone.name} - #{zone.dns}"
|
@@ -77,10 +75,9 @@ module Google
|
|
77
75
|
# You can also retrieve a single zone by either name or id.
|
78
76
|
#
|
79
77
|
# ```ruby
|
80
|
-
# require "google/cloud"
|
78
|
+
# require "google/cloud/dns"
|
81
79
|
#
|
82
|
-
#
|
83
|
-
# dns = gcloud.dns
|
80
|
+
# dns = Google::Cloud::Dns.new
|
84
81
|
# zone = dns.zone "example-com"
|
85
82
|
# ```
|
86
83
|
#
|
@@ -91,10 +88,9 @@ module Google
|
|
91
88
|
# nameservers. Let's take a look at these records.
|
92
89
|
#
|
93
90
|
# ```ruby
|
94
|
-
# require "google/cloud"
|
91
|
+
# require "google/cloud/dns"
|
95
92
|
#
|
96
|
-
#
|
97
|
-
# dns = gcloud.dns
|
93
|
+
# dns = Google::Cloud::Dns.new
|
98
94
|
# zone = dns.zone "example-com"
|
99
95
|
# records = zone.records
|
100
96
|
# records.count #=> 2
|
@@ -114,10 +110,9 @@ module Google
|
|
114
110
|
# {Google::Cloud::Dns::Zone#add} results in a new Cloud DNS Change instance.
|
115
111
|
#
|
116
112
|
# ```ruby
|
117
|
-
# require "google/cloud"
|
113
|
+
# require "google/cloud/dns"
|
118
114
|
#
|
119
|
-
#
|
120
|
-
# dns = gcloud.dns
|
115
|
+
# dns = Google::Cloud::Dns.new
|
121
116
|
# zone = dns.zone "example-com"
|
122
117
|
# change = zone.add "www", "A", 86400, ["1.2.3.4"]
|
123
118
|
# change.additions.map &:type #=> ["A", "SOA"]
|
@@ -136,10 +131,9 @@ module Google
|
|
136
131
|
# retrieved record's domain name is always fully-qualified.
|
137
132
|
#
|
138
133
|
# ```ruby
|
139
|
-
# require "google/cloud"
|
134
|
+
# require "google/cloud/dns"
|
140
135
|
#
|
141
|
-
#
|
142
|
-
# dns = gcloud.dns
|
136
|
+
# dns = Google::Cloud::Dns.new
|
143
137
|
# zone = dns.zone "example-com"
|
144
138
|
# records = zone.records "www", "A"
|
145
139
|
# records.first.name #=> "www.example.com."
|
@@ -149,10 +143,9 @@ module Google
|
|
149
143
|
# `data` for a record.
|
150
144
|
#
|
151
145
|
# ```ruby
|
152
|
-
# require "google/cloud"
|
146
|
+
# require "google/cloud/dns"
|
153
147
|
#
|
154
|
-
#
|
155
|
-
# dns = gcloud.dns
|
148
|
+
# dns = Google::Cloud::Dns.new
|
156
149
|
# zone = dns.zone "example-com"
|
157
150
|
# change = zone.replace "www", "A", 86400, ["5.6.7.8"]
|
158
151
|
# ```
|
@@ -162,10 +155,9 @@ module Google
|
|
162
155
|
# to leave unchanged.
|
163
156
|
#
|
164
157
|
# ```ruby
|
165
|
-
# require "google/cloud"
|
158
|
+
# require "google/cloud/dns"
|
166
159
|
#
|
167
|
-
#
|
168
|
-
# dns = gcloud.dns
|
160
|
+
# dns = Google::Cloud::Dns.new
|
169
161
|
# zone = dns.zone "example-com"
|
170
162
|
# change = zone.modify "www", "A" do |r|
|
171
163
|
# r.ttl = 3600 # change only the TTL
|
@@ -175,10 +167,9 @@ module Google
|
|
175
167
|
# You can also delete records by name and type.
|
176
168
|
#
|
177
169
|
# ```ruby
|
178
|
-
# require "google/cloud"
|
170
|
+
# require "google/cloud/dns"
|
179
171
|
#
|
180
|
-
#
|
181
|
-
# dns = gcloud.dns
|
172
|
+
# dns = Google::Cloud::Dns.new
|
182
173
|
# zone = dns.zone "example-com"
|
183
174
|
# change = zone.remove "www", "A"
|
184
175
|
# record = change.deletions.first
|
@@ -190,10 +181,9 @@ module Google
|
|
190
181
|
# {Google::Cloud::Dns::Zone::Transaction}.
|
191
182
|
#
|
192
183
|
# ```ruby
|
193
|
-
# require "google/cloud"
|
184
|
+
# require "google/cloud/dns"
|
194
185
|
#
|
195
|
-
#
|
196
|
-
# dns = gcloud.dns
|
186
|
+
# dns = Google::Cloud::Dns.new
|
197
187
|
# zone = dns.zone "example-com"
|
198
188
|
# change = zone.update do |tx|
|
199
189
|
# tx.add "www", "A", 86400, "1.2.3.4"
|
@@ -210,10 +200,9 @@ module Google
|
|
210
200
|
# {Google::Cloud::Dns::Zone#update}.
|
211
201
|
#
|
212
202
|
# ```ruby
|
213
|
-
# require "google/cloud"
|
203
|
+
# require "google/cloud/dns"
|
214
204
|
#
|
215
|
-
#
|
216
|
-
# dns = gcloud.dns
|
205
|
+
# dns = Google::Cloud::Dns.new
|
217
206
|
# zone = dns.zone "example-com"
|
218
207
|
# to_add = zone.record "www", "AAAA", 86400, ["2607:f8b0:400a:801::1005"]
|
219
208
|
# to_delete = zone.records "www", "A"
|
@@ -226,10 +215,9 @@ module Google
|
|
226
215
|
# complete immediately, you can retrieve and inspect changes.
|
227
216
|
#
|
228
217
|
# ```ruby
|
229
|
-
# require "google/cloud"
|
218
|
+
# require "google/cloud/dns"
|
230
219
|
#
|
231
|
-
#
|
232
|
-
# dns = gcloud.dns
|
220
|
+
# dns = Google::Cloud::Dns.new
|
233
221
|
# zone = dns.zone "example-com"
|
234
222
|
# changes = zone.changes
|
235
223
|
# changes.each do |change|
|
@@ -244,10 +232,9 @@ module Google
|
|
244
232
|
# lines may be merged as needed into records with multiple `data` values.
|
245
233
|
#
|
246
234
|
# ```ruby
|
247
|
-
# require "google/cloud"
|
235
|
+
# require "google/cloud/dns"
|
248
236
|
#
|
249
|
-
#
|
250
|
-
# dns = gcloud.dns
|
237
|
+
# dns = Google::Cloud::Dns.new
|
251
238
|
# zone = dns.zone "example-com"
|
252
239
|
# change = zone.import "path/to/db.example.com"
|
253
240
|
# ```
|
@@ -255,10 +242,9 @@ module Google
|
|
255
242
|
# You can also export to a zone file.
|
256
243
|
#
|
257
244
|
# ```ruby
|
258
|
-
# require "google/cloud"
|
245
|
+
# require "google/cloud/dns"
|
259
246
|
#
|
260
|
-
#
|
261
|
-
# dns = gcloud.dns
|
247
|
+
# dns = Google::Cloud::Dns.new
|
262
248
|
# zone = dns.zone "example-com"
|
263
249
|
#
|
264
250
|
# zone.export "path/to/db.example.com"
|
@@ -278,13 +264,65 @@ module Google
|
|
278
264
|
# You can also set the request `timeout` value in seconds.
|
279
265
|
#
|
280
266
|
# ```ruby
|
281
|
-
# require "google/cloud"
|
267
|
+
# require "google/cloud/dns"
|
282
268
|
#
|
283
|
-
#
|
284
|
-
# dns = gcloud.dns retries: 10, timeout: 120
|
269
|
+
# dns = Google::Cloud::Dns.new retries: 10, timeout: 120
|
285
270
|
# ```
|
286
271
|
#
|
287
272
|
module Dns
|
273
|
+
##
|
274
|
+
# Creates a new `Project` instance connected to the DNS service.
|
275
|
+
# Each call creates a new connection.
|
276
|
+
#
|
277
|
+
# For more information on connecting to Google Cloud see the
|
278
|
+
# [Authentication
|
279
|
+
# Guide](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/guides/authentication).
|
280
|
+
#
|
281
|
+
# @param [String] project Identifier for a DNS project. If not present,
|
282
|
+
# the default project for the credentials is used.
|
283
|
+
# @param [String, Hash] keyfile Keyfile downloaded from Google Cloud. If
|
284
|
+
# file path the file must be readable.
|
285
|
+
# @param [String, Array<String>] scope The OAuth 2.0 scopes controlling
|
286
|
+
# the set of resources and operations that the connection can access.
|
287
|
+
# See [Using OAuth 2.0 to Access Google
|
288
|
+
# APIs](https://developers.google.com/identity/protocols/OAuth2).
|
289
|
+
#
|
290
|
+
# The default scope is:
|
291
|
+
#
|
292
|
+
# * `https://www.googleapis.com/auth/ndev.clouddns.readwrite`
|
293
|
+
# @param [Integer] retries Number of times to retry requests on server
|
294
|
+
# error. The default value is `3`. Optional.
|
295
|
+
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
296
|
+
#
|
297
|
+
# @return [Google::Cloud::Dns::Project]
|
298
|
+
#
|
299
|
+
# @example
|
300
|
+
# require "google/cloud/dns"
|
301
|
+
#
|
302
|
+
# dns = Google::Cloud::Dns.new(
|
303
|
+
# project: "my-dns-project",
|
304
|
+
# keyfile: "/path/to/keyfile.json"
|
305
|
+
# )
|
306
|
+
#
|
307
|
+
# zone = dns.zone "example-com"
|
308
|
+
#
|
309
|
+
def self.new project: nil, keyfile: nil, scope: nil, retries: nil,
|
310
|
+
timeout: nil
|
311
|
+
project ||= Google::Cloud::Dns::Project.default_project
|
312
|
+
project = project.to_s # Always cast to a string
|
313
|
+
fail ArgumentError, "project is missing" if project.empty?
|
314
|
+
|
315
|
+
if keyfile.nil?
|
316
|
+
credentials = Google::Cloud::Dns::Credentials.default scope: scope
|
317
|
+
else
|
318
|
+
credentials = Google::Cloud::Dns::Credentials.new(
|
319
|
+
keyfile, scope: scope)
|
320
|
+
end
|
321
|
+
|
322
|
+
Google::Cloud::Dns::Project.new(
|
323
|
+
Google::Cloud::Dns::Service.new(
|
324
|
+
project, credentials, retries: retries, timeout: timeout))
|
325
|
+
end
|
288
326
|
end
|
289
327
|
end
|
290
328
|
end
|
@@ -28,10 +28,9 @@ module Google
|
|
28
28
|
# server.
|
29
29
|
#
|
30
30
|
# @example
|
31
|
-
# require "google/cloud"
|
31
|
+
# require "google/cloud/dns"
|
32
32
|
#
|
33
|
-
#
|
34
|
-
# dns = gcloud.dns
|
33
|
+
# dns = Google::Cloud::Dns.new
|
35
34
|
# zone = dns.zone "example-com"
|
36
35
|
# zone.changes.each do |change|
|
37
36
|
# puts "Change includes #{change.additions.count} additions " \
|
@@ -118,10 +117,9 @@ module Google
|
|
118
117
|
# The delay between refreshes will incrementally increase.
|
119
118
|
#
|
120
119
|
# @example
|
121
|
-
# require "google/cloud"
|
120
|
+
# require "google/cloud/dns"
|
122
121
|
#
|
123
|
-
#
|
124
|
-
# dns = gcloud.dns
|
122
|
+
# dns = Google::Cloud::Dns.new
|
125
123
|
# zone = dns.zone "example-com"
|
126
124
|
# change = zone.change 1234567890
|
127
125
|
# change.done? #=> false
|
@@ -40,10 +40,9 @@ module Google
|
|
40
40
|
# @return [Boolean]
|
41
41
|
#
|
42
42
|
# @example
|
43
|
-
# require "google/cloud"
|
43
|
+
# require "google/cloud/dns"
|
44
44
|
#
|
45
|
-
#
|
46
|
-
# dns = gcloud.dns
|
45
|
+
# dns = Google::Cloud::Dns.new
|
47
46
|
# zone = dns.zone "example-com"
|
48
47
|
#
|
49
48
|
# changes = zone.changes
|
@@ -61,10 +60,9 @@ module Google
|
|
61
60
|
# @return [Change::List]
|
62
61
|
#
|
63
62
|
# @example
|
64
|
-
# require "google/cloud"
|
63
|
+
# require "google/cloud/dns"
|
65
64
|
#
|
66
|
-
#
|
67
|
-
# dns = gcloud.dns
|
65
|
+
# dns = Google::Cloud::Dns.new
|
68
66
|
# zone = dns.zone "example-com"
|
69
67
|
#
|
70
68
|
# changes = zone.changes
|
@@ -97,10 +95,9 @@ module Google
|
|
97
95
|
# @return [Enumerator]
|
98
96
|
#
|
99
97
|
# @example Iterating each change by passing a block:
|
100
|
-
# require "google/cloud"
|
98
|
+
# require "google/cloud/dns"
|
101
99
|
#
|
102
|
-
#
|
103
|
-
# dns = gcloud.dns
|
100
|
+
# dns = Google::Cloud::Dns.new
|
104
101
|
# zone = dns.zone "example-com"
|
105
102
|
# changes = zone.changes
|
106
103
|
#
|
@@ -109,10 +106,9 @@ module Google
|
|
109
106
|
# end
|
110
107
|
#
|
111
108
|
# @example Using the enumerator by not passing a block:
|
112
|
-
# require "google/cloud"
|
109
|
+
# require "google/cloud/dns"
|
113
110
|
#
|
114
|
-
#
|
115
|
-
# dns = gcloud.dns
|
111
|
+
# dns = Google::Cloud::Dns.new
|
116
112
|
# zone = dns.zone "example-com"
|
117
113
|
# changes = zone.changes
|
118
114
|
#
|
@@ -121,10 +117,9 @@ module Google
|
|
121
117
|
# end
|
122
118
|
#
|
123
119
|
# @example Limit the number of API calls made:
|
124
|
-
# require "google/cloud"
|
120
|
+
# require "google/cloud/dns"
|
125
121
|
#
|
126
|
-
#
|
127
|
-
# dns = gcloud.dns
|
122
|
+
# dns = Google::Cloud::Dns.new
|
128
123
|
# zone = dns.zone "example-com"
|
129
124
|
# changes = zone.changes
|
130
125
|
#
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
require "google/cloud/errors"
|
17
|
-
require "google/cloud/core/
|
17
|
+
require "google/cloud/core/environment"
|
18
18
|
require "google/cloud/dns/service"
|
19
19
|
require "google/cloud/dns/credentials"
|
20
20
|
require "google/cloud/dns/zone"
|
@@ -30,10 +30,9 @@ module Google
|
|
30
30
|
# Console](https://console.developers.google.com).
|
31
31
|
#
|
32
32
|
# @example
|
33
|
-
# require "google/cloud"
|
33
|
+
# require "google/cloud/dns"
|
34
34
|
#
|
35
|
-
#
|
36
|
-
# dns = gcloud.dns
|
35
|
+
# dns = Google::Cloud::Dns.new
|
37
36
|
# zone = dns.zone "example-com"
|
38
37
|
# zone.records.each do |record|
|
39
38
|
# puts record.name
|
@@ -62,11 +61,12 @@ module Google
|
|
62
61
|
# The unique ID string for the current project.
|
63
62
|
#
|
64
63
|
# @example
|
65
|
-
# require "google/cloud"
|
64
|
+
# require "google/cloud/dns"
|
66
65
|
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
66
|
+
# dns = Google::Cloud::Dns.new(
|
67
|
+
# project: "my-todo-project",
|
68
|
+
# keyfile: "/path/to/keyfile.json"
|
69
|
+
# )
|
70
70
|
#
|
71
71
|
# dns.project #=> "my-todo-project"
|
72
72
|
#
|
@@ -130,7 +130,7 @@ module Google
|
|
130
130
|
ENV["DNS_PROJECT"] ||
|
131
131
|
ENV["GOOGLE_CLOUD_PROJECT"] ||
|
132
132
|
ENV["GCLOUD_PROJECT"] ||
|
133
|
-
Google::Cloud::Core::
|
133
|
+
Google::Cloud::Core::Environment.project_id
|
134
134
|
end
|
135
135
|
|
136
136
|
##
|
@@ -142,10 +142,9 @@ module Google
|
|
142
142
|
# not exist.
|
143
143
|
#
|
144
144
|
# @example
|
145
|
-
# require "google/cloud"
|
145
|
+
# require "google/cloud/dns"
|
146
146
|
#
|
147
|
-
#
|
148
|
-
# dns = gcloud.dns
|
147
|
+
# dns = Google::Cloud::Dns.new
|
149
148
|
# zone = dns.zone "example-com"
|
150
149
|
# puts zone.name
|
151
150
|
#
|
@@ -170,20 +169,18 @@ module Google
|
|
170
169
|
# {Google::Cloud::Dns::Zone::List})
|
171
170
|
#
|
172
171
|
# @example
|
173
|
-
# require "google/cloud"
|
172
|
+
# require "google/cloud/dns"
|
174
173
|
#
|
175
|
-
#
|
176
|
-
# dns = gcloud.dns
|
174
|
+
# dns = Google::Cloud::Dns.new
|
177
175
|
# zones = dns.zones
|
178
176
|
# zones.each do |zone|
|
179
177
|
# puts zone.name
|
180
178
|
# end
|
181
179
|
#
|
182
180
|
# @example Retrieve all zones: (See {Zone::List#all})
|
183
|
-
# require "google/cloud"
|
181
|
+
# require "google/cloud/dns"
|
184
182
|
#
|
185
|
-
#
|
186
|
-
# dns = gcloud.dns
|
183
|
+
# dns = Google::Cloud::Dns.new
|
187
184
|
# zones = dns.zones
|
188
185
|
# zones.all do |zone|
|
189
186
|
# puts zone.name
|
@@ -215,10 +212,9 @@ module Google
|
|
215
212
|
# @return [Google::Cloud::Dns::Zone]
|
216
213
|
#
|
217
214
|
# @example
|
218
|
-
# require "google/cloud"
|
215
|
+
# require "google/cloud/dns"
|
219
216
|
#
|
220
|
-
#
|
221
|
-
# dns = gcloud.dns
|
217
|
+
# dns = Google::Cloud::Dns.new
|
222
218
|
# zone = dns.create_zone "example-com", "example.com."
|
223
219
|
#
|
224
220
|
def create_zone zone_name, zone_dns, description: nil,
|
@@ -31,10 +31,9 @@ module Google
|
|
31
31
|
# or `Record.new` to create new records.
|
32
32
|
#
|
33
33
|
# @example
|
34
|
-
# require "google/cloud"
|
34
|
+
# require "google/cloud/dns"
|
35
35
|
#
|
36
|
-
#
|
37
|
-
# dns = gcloud.dns
|
36
|
+
# dns = Google::Cloud::Dns.new
|
38
37
|
# zone = dns.zone "example-com"
|
39
38
|
#
|
40
39
|
# zone.records.count #=> 2
|
@@ -40,10 +40,9 @@ module Google
|
|
40
40
|
# @return [Boolean]
|
41
41
|
#
|
42
42
|
# @example
|
43
|
-
# require "google/cloud"
|
43
|
+
# require "google/cloud/dns"
|
44
44
|
#
|
45
|
-
#
|
46
|
-
# dns = gcloud.dns
|
45
|
+
# dns = Google::Cloud::Dns.new
|
47
46
|
# zone = dns.zone "example-com"
|
48
47
|
#
|
49
48
|
# records = zone.records "example.com."
|
@@ -61,10 +60,9 @@ module Google
|
|
61
60
|
# @return [Record::List]
|
62
61
|
#
|
63
62
|
# @example
|
64
|
-
# require "google/cloud"
|
63
|
+
# require "google/cloud/dns"
|
65
64
|
#
|
66
|
-
#
|
67
|
-
# dns = gcloud.dns
|
65
|
+
# dns = Google::Cloud::Dns.new
|
68
66
|
# zone = dns.zone "example-com"
|
69
67
|
#
|
70
68
|
# records = zone.records "example.com."
|
@@ -97,10 +95,9 @@ module Google
|
|
97
95
|
# @return [Enumerator]
|
98
96
|
#
|
99
97
|
# @example Iterating each record by passing a block:
|
100
|
-
# require "google/cloud"
|
98
|
+
# require "google/cloud/dns"
|
101
99
|
#
|
102
|
-
#
|
103
|
-
# dns = gcloud.dns
|
100
|
+
# dns = Google::Cloud::Dns.new
|
104
101
|
# zone = dns.zone "example-com"
|
105
102
|
# records = zone.records "example.com."
|
106
103
|
#
|
@@ -109,10 +106,9 @@ module Google
|
|
109
106
|
# end
|
110
107
|
#
|
111
108
|
# @example Using the enumerator by not passing a block:
|
112
|
-
# require "google/cloud"
|
109
|
+
# require "google/cloud/dns"
|
113
110
|
#
|
114
|
-
#
|
115
|
-
# dns = gcloud.dns
|
111
|
+
# dns = Google::Cloud::Dns.new
|
116
112
|
# zone = dns.zone "example-com"
|
117
113
|
# records = zone.records "example.com."
|
118
114
|
#
|
@@ -121,10 +117,9 @@ module Google
|
|
121
117
|
# end
|
122
118
|
#
|
123
119
|
# @example Limit the number of API calls made:
|
124
|
-
# require "google/cloud"
|
120
|
+
# require "google/cloud/dns"
|
125
121
|
#
|
126
|
-
#
|
127
|
-
# dns = gcloud.dns
|
122
|
+
# dns = Google::Cloud::Dns.new
|
128
123
|
# zone = dns.zone "example-com"
|
129
124
|
# records = zone.records "example.com."
|
130
125
|
#
|
@@ -37,7 +37,7 @@ module Google
|
|
37
37
|
@project = project
|
38
38
|
@credentials = credentials
|
39
39
|
@service = API::DnsService.new
|
40
|
-
@service.client_options.application_name = "
|
40
|
+
@service.client_options.application_name = "gcloud-ruby"
|
41
41
|
@service.client_options.application_version = \
|
42
42
|
Google::Cloud::Dns::VERSION
|
43
43
|
@service.request_options.retries = retries || 3
|
@@ -32,10 +32,9 @@ module Google
|
|
32
32
|
# have a unique name.
|
33
33
|
#
|
34
34
|
# @example
|
35
|
-
# require "google/cloud"
|
35
|
+
# require "google/cloud/dns"
|
36
36
|
#
|
37
|
-
#
|
38
|
-
# dns = gcloud.dns
|
37
|
+
# dns = Google::Cloud::Dns.new
|
39
38
|
# zone = dns.zone "example-com"
|
40
39
|
# zone.records.each do |record|
|
41
40
|
# puts record.name
|
@@ -127,18 +126,16 @@ module Google
|
|
127
126
|
# @return [Boolean] Returns `true` if the zone was deleted.
|
128
127
|
#
|
129
128
|
# @example
|
130
|
-
# require "google/cloud"
|
129
|
+
# require "google/cloud/dns"
|
131
130
|
#
|
132
|
-
#
|
133
|
-
# dns = gcloud.dns
|
131
|
+
# dns = Google::Cloud::Dns.new
|
134
132
|
# zone = dns.zone "example-com"
|
135
133
|
# zone.delete
|
136
134
|
#
|
137
135
|
# @example The zone can be forcefully deleted with the `force` option:
|
138
|
-
# require "google/cloud"
|
136
|
+
# require "google/cloud/dns"
|
139
137
|
#
|
140
|
-
#
|
141
|
-
# dns = gcloud.dns
|
138
|
+
# dns = Google::Cloud::Dns.new
|
142
139
|
# zone = dns.zone "example-com"
|
143
140
|
# zone.delete force: true
|
144
141
|
#
|
@@ -155,10 +152,9 @@ module Google
|
|
155
152
|
# will be kept.
|
156
153
|
#
|
157
154
|
# @example
|
158
|
-
# require "google/cloud"
|
155
|
+
# require "google/cloud/dns"
|
159
156
|
#
|
160
|
-
#
|
161
|
-
# dns = gcloud.dns
|
157
|
+
# dns = Google::Cloud::Dns.new
|
162
158
|
# zone = dns.zone "example-com"
|
163
159
|
# zone.clear!
|
164
160
|
#
|
@@ -177,10 +173,9 @@ module Google
|
|
177
173
|
# does not exist.
|
178
174
|
#
|
179
175
|
# @example
|
180
|
-
# require "google/cloud"
|
176
|
+
# require "google/cloud/dns"
|
181
177
|
#
|
182
|
-
#
|
183
|
-
# dns = gcloud.dns
|
178
|
+
# dns = Google::Cloud::Dns.new
|
184
179
|
# zone = dns.zone "example-com"
|
185
180
|
# change = zone.change "2"
|
186
181
|
# if change
|
@@ -214,10 +209,9 @@ module Google
|
|
214
209
|
# {Google::Cloud::Dns::Change::List})
|
215
210
|
#
|
216
211
|
# @example
|
217
|
-
# require "google/cloud"
|
212
|
+
# require "google/cloud/dns"
|
218
213
|
#
|
219
|
-
#
|
220
|
-
# dns = gcloud.dns
|
214
|
+
# dns = Google::Cloud::Dns.new
|
221
215
|
# zone = dns.zone "example-com"
|
222
216
|
# changes = zone.changes
|
223
217
|
# changes.each do |change|
|
@@ -225,18 +219,16 @@ module Google
|
|
225
219
|
# end
|
226
220
|
#
|
227
221
|
# @example The changes can be sorted by change sequence:
|
228
|
-
# require "google/cloud"
|
222
|
+
# require "google/cloud/dns"
|
229
223
|
#
|
230
|
-
#
|
231
|
-
# dns = gcloud.dns
|
224
|
+
# dns = Google::Cloud::Dns.new
|
232
225
|
# zone = dns.zone "example-com"
|
233
226
|
# changes = zone.changes order: :desc
|
234
227
|
#
|
235
228
|
# @example Retrieve all changes: (See {Change::List#all})
|
236
|
-
# require "google/cloud"
|
229
|
+
# require "google/cloud/dns"
|
237
230
|
#
|
238
|
-
#
|
239
|
-
# dns = gcloud.dns
|
231
|
+
# dns = Google::Cloud::Dns.new
|
240
232
|
# zone = dns.zone "example-com"
|
241
233
|
# changes = zone.changes
|
242
234
|
# changes.all do |change|
|
@@ -274,10 +266,9 @@ module Google
|
|
274
266
|
# {Google::Cloud::Dns::Record::List})
|
275
267
|
#
|
276
268
|
# @example
|
277
|
-
# require "google/cloud"
|
269
|
+
# require "google/cloud/dns"
|
278
270
|
#
|
279
|
-
#
|
280
|
-
# dns = gcloud.dns
|
271
|
+
# dns = Google::Cloud::Dns.new
|
281
272
|
# zone = dns.zone "example-com"
|
282
273
|
# records = zone.records
|
283
274
|
# records.each do |record|
|
@@ -285,19 +276,17 @@ module Google
|
|
285
276
|
# end
|
286
277
|
#
|
287
278
|
# @example Records can be filtered by name and type:
|
288
|
-
# require "google/cloud"
|
279
|
+
# require "google/cloud/dns"
|
289
280
|
#
|
290
|
-
#
|
291
|
-
# dns = gcloud.dns
|
281
|
+
# dns = Google::Cloud::Dns.new
|
292
282
|
# zone = dns.zone "example-com"
|
293
283
|
# records = zone.records "www", "A"
|
294
284
|
# records.first.name #=> "www.example.com."
|
295
285
|
#
|
296
286
|
# @example Retrieve all records:
|
297
|
-
# require "google/cloud"
|
287
|
+
# require "google/cloud/dns"
|
298
288
|
#
|
299
|
-
#
|
300
|
-
# dns = gcloud.dns
|
289
|
+
# dns = Google::Cloud::Dns.new
|
301
290
|
# zone = dns.zone "example-com"
|
302
291
|
# records = zone.records "example.com."
|
303
292
|
#
|
@@ -321,10 +310,9 @@ module Google
|
|
321
310
|
# @return [Google::Cloud::Dns::Record]
|
322
311
|
#
|
323
312
|
# @example
|
324
|
-
# require "google/cloud"
|
313
|
+
# require "google/cloud/dns"
|
325
314
|
#
|
326
|
-
#
|
327
|
-
# dns = gcloud.dns
|
315
|
+
# dns = Google::Cloud::Dns.new
|
328
316
|
# zone = dns.zone "example-com"
|
329
317
|
# record = zone.record "example.com.", "A", 86400, ["1.2.3.4"]
|
330
318
|
# zone.add record
|
@@ -344,10 +332,9 @@ module Google
|
|
344
332
|
# @return [File] An object on the local file system.
|
345
333
|
#
|
346
334
|
# @example
|
347
|
-
# require "google/cloud"
|
335
|
+
# require "google/cloud/dns"
|
348
336
|
#
|
349
|
-
#
|
350
|
-
# dns = gcloud.dns
|
337
|
+
# dns = Google::Cloud::Dns.new
|
351
338
|
# zone = dns.zone "example-com"
|
352
339
|
#
|
353
340
|
# zone.export "path/to/db.example.com"
|
@@ -400,10 +387,9 @@ module Google
|
|
400
387
|
# Record instances.
|
401
388
|
#
|
402
389
|
# @example
|
403
|
-
# require "google/cloud"
|
390
|
+
# require "google/cloud/dns"
|
404
391
|
#
|
405
|
-
#
|
406
|
-
# dns = gcloud.dns
|
392
|
+
# dns = Google::Cloud::Dns.new
|
407
393
|
# zone = dns.zone "example-com"
|
408
394
|
# change = zone.import "path/to/db.example.com"
|
409
395
|
#
|
@@ -447,10 +433,9 @@ module Google
|
|
447
433
|
# @return [Google::Cloud::Dns::Change]
|
448
434
|
#
|
449
435
|
# @example Using a block:
|
450
|
-
# require "google/cloud"
|
436
|
+
# require "google/cloud/dns"
|
451
437
|
#
|
452
|
-
#
|
453
|
-
# dns = gcloud.dns
|
438
|
+
# dns = Google::Cloud::Dns.new
|
454
439
|
# zone = dns.zone "example-com"
|
455
440
|
# change = zone.update do |tx|
|
456
441
|
# tx.add "example.com.", "A", 86400, "1.2.3.4"
|
@@ -463,20 +448,18 @@ module Google
|
|
463
448
|
# end
|
464
449
|
#
|
465
450
|
# @example Or you can provide the record objects to add and remove:
|
466
|
-
# require "google/cloud"
|
451
|
+
# require "google/cloud/dns"
|
467
452
|
#
|
468
|
-
#
|
469
|
-
# dns = gcloud.dns
|
453
|
+
# dns = Google::Cloud::Dns.new
|
470
454
|
# zone = dns.zone "example-com"
|
471
455
|
# new_record = zone.record "example.com.", "A", 86400, ["1.2.3.4"]
|
472
456
|
# old_record = zone.record "example.com.", "A", 18600, ["1.2.3.4"]
|
473
457
|
# change = zone.update [new_record], [old_record]
|
474
458
|
#
|
475
459
|
# @example Using a lambda or Proc to update current SOA serial number:
|
476
|
-
# require "google/cloud"
|
460
|
+
# require "google/cloud/dns"
|
477
461
|
#
|
478
|
-
#
|
479
|
-
# dns = gcloud.dns
|
462
|
+
# dns = Google::Cloud::Dns.new
|
480
463
|
# zone = dns.zone "example-com"
|
481
464
|
# new_record = zone.record "example.com.", "A", 86400, ["1.2.3.4"]
|
482
465
|
# change = zone.update new_record, soa_serial: lambda { |sn| sn + 10 }
|
@@ -542,10 +525,9 @@ module Google
|
|
542
525
|
# @return [Google::Cloud::Dns::Change]
|
543
526
|
#
|
544
527
|
# @example
|
545
|
-
# require "google/cloud"
|
528
|
+
# require "google/cloud/dns"
|
546
529
|
#
|
547
|
-
#
|
548
|
-
# dns = gcloud.dns
|
530
|
+
# dns = Google::Cloud::Dns.new
|
549
531
|
# zone = dns.zone "example-com"
|
550
532
|
# change = zone.add "example.com.", "A", 86400, ["1.2.3.4"]
|
551
533
|
#
|
@@ -577,10 +559,9 @@ module Google
|
|
577
559
|
# @return [Google::Cloud::Dns::Change]
|
578
560
|
#
|
579
561
|
# @example
|
580
|
-
# require "google/cloud"
|
562
|
+
# require "google/cloud/dns"
|
581
563
|
#
|
582
|
-
#
|
583
|
-
# dns = gcloud.dns
|
564
|
+
# dns = Google::Cloud::Dns.new
|
584
565
|
# zone = dns.zone "example-com"
|
585
566
|
# change = zone.remove "example.com.", "A"
|
586
567
|
#
|
@@ -619,10 +600,9 @@ module Google
|
|
619
600
|
# @return [Google::Cloud::Dns::Change]
|
620
601
|
#
|
621
602
|
# @example
|
622
|
-
# require "google/cloud"
|
603
|
+
# require "google/cloud/dns"
|
623
604
|
#
|
624
|
-
#
|
625
|
-
# dns = gcloud.dns
|
605
|
+
# dns = Google::Cloud::Dns.new
|
626
606
|
# zone = dns.zone "example-com"
|
627
607
|
# change = zone.replace "example.com.", "A", 86400, ["5.6.7.8"]
|
628
608
|
#
|
@@ -661,10 +641,9 @@ module Google
|
|
661
641
|
# @return [Google::Cloud::Dns::Change]
|
662
642
|
#
|
663
643
|
# @example
|
664
|
-
# require "google/cloud"
|
644
|
+
# require "google/cloud/dns"
|
665
645
|
#
|
666
|
-
#
|
667
|
-
# dns = gcloud.dns
|
646
|
+
# dns = Google::Cloud::Dns.new
|
668
647
|
# zone = dns.zone "example-com"
|
669
648
|
# change = zone.modify "example.com.", "MX" do |mx|
|
670
649
|
# mx.ttl = 3600 # change only the TTL
|
@@ -690,10 +669,9 @@ module Google
|
|
690
669
|
# @return [String] A fully qualified domain name.
|
691
670
|
#
|
692
671
|
# @example
|
693
|
-
# require "google/cloud"
|
672
|
+
# require "google/cloud/dns"
|
694
673
|
#
|
695
|
-
#
|
696
|
-
# dns = gcloud.dns
|
674
|
+
# dns = Google::Cloud::Dns.new
|
697
675
|
# zone = dns.zone "example-com"
|
698
676
|
# zone.fqdn "www" #=> "www.example.com."
|
699
677
|
# zone.fqdn "@" #=> "example.com."
|
@@ -39,10 +39,9 @@ module Google
|
|
39
39
|
# @return [Boolean]
|
40
40
|
#
|
41
41
|
# @example
|
42
|
-
# require "google/cloud"
|
42
|
+
# require "google/cloud/dns"
|
43
43
|
#
|
44
|
-
#
|
45
|
-
# dns = gcloud.dns
|
44
|
+
# dns = Google::Cloud::Dns.new
|
46
45
|
#
|
47
46
|
# zones = dns.zones
|
48
47
|
# if zones.next?
|
@@ -59,10 +58,9 @@ module Google
|
|
59
58
|
# @return [Zone::List]
|
60
59
|
#
|
61
60
|
# @example
|
62
|
-
# require "google/cloud"
|
61
|
+
# require "google/cloud/dns"
|
63
62
|
#
|
64
|
-
#
|
65
|
-
# dns = gcloud.dns
|
63
|
+
# dns = Google::Cloud::Dns.new
|
66
64
|
#
|
67
65
|
# zones = dns.zones
|
68
66
|
# if zones.next?
|
@@ -95,10 +93,9 @@ module Google
|
|
95
93
|
# @return [Enumerator]
|
96
94
|
#
|
97
95
|
# @example Iterating each zone by passing a block:
|
98
|
-
# require "google/cloud"
|
96
|
+
# require "google/cloud/dns"
|
99
97
|
#
|
100
|
-
#
|
101
|
-
# dns = gcloud.dns
|
98
|
+
# dns = Google::Cloud::Dns.new
|
102
99
|
# zones = dns.zones
|
103
100
|
#
|
104
101
|
# zones.all do |zone|
|
@@ -106,10 +103,9 @@ module Google
|
|
106
103
|
# end
|
107
104
|
#
|
108
105
|
# @example Using the enumerator by not passing a block:
|
109
|
-
# require "google/cloud"
|
106
|
+
# require "google/cloud/dns"
|
110
107
|
#
|
111
|
-
#
|
112
|
-
# dns = gcloud.dns
|
108
|
+
# dns = Google::Cloud::Dns.new
|
113
109
|
# zones = dns.zones
|
114
110
|
#
|
115
111
|
# all_names = zones.all.map do |zone|
|
@@ -117,10 +113,9 @@ module Google
|
|
117
113
|
# end
|
118
114
|
#
|
119
115
|
# @example Limit the number of API calls made:
|
120
|
-
# require "google/cloud"
|
116
|
+
# require "google/cloud/dns"
|
121
117
|
#
|
122
|
-
#
|
123
|
-
# dns = gcloud.dns
|
118
|
+
# dns = Google::Cloud::Dns.new
|
124
119
|
# zones = dns.zones
|
125
120
|
#
|
126
121
|
# zones.all(request_limit: 10) do |zone|
|
@@ -25,10 +25,9 @@ module Google
|
|
25
25
|
# Cloud DNS API.
|
26
26
|
#
|
27
27
|
# @example
|
28
|
-
# require "google/cloud"
|
28
|
+
# require "google/cloud/dns"
|
29
29
|
#
|
30
|
-
#
|
31
|
-
# dns = gcloud.dns
|
30
|
+
# dns = Google::Cloud::Dns.new
|
32
31
|
# zone = dns.zone "example-com"
|
33
32
|
# zone.update do |tx|
|
34
33
|
# tx.add "example.com.", "A", 86400, "1.2.3.4"
|
@@ -70,10 +69,9 @@ module Google
|
|
70
69
|
# example: `192.0.2.1` or `example.com.`.
|
71
70
|
#
|
72
71
|
# @example
|
73
|
-
# require "google/cloud"
|
72
|
+
# require "google/cloud/dns"
|
74
73
|
#
|
75
|
-
#
|
76
|
-
# dns = gcloud.dns
|
74
|
+
# dns = Google::Cloud::Dns.new
|
77
75
|
# zone = dns.zone "example-com"
|
78
76
|
# zone.update do |tx|
|
79
77
|
# tx.add "example.com.", "A", 86400, "1.2.3.4"
|
@@ -94,10 +92,9 @@ module Google
|
|
94
92
|
# For example: `A`, `AAAA`, `CNAME`, `MX`, or `TXT`.
|
95
93
|
#
|
96
94
|
# @example
|
97
|
-
# require "google/cloud"
|
95
|
+
# require "google/cloud/dns"
|
98
96
|
#
|
99
|
-
#
|
100
|
-
# dns = gcloud.dns
|
97
|
+
# dns = Google::Cloud::Dns.new
|
101
98
|
# zone = dns.zone "example-com"
|
102
99
|
# zone.update do |tx|
|
103
100
|
# tx.remove "example.com.", "TXT"
|
@@ -126,10 +123,9 @@ module Google
|
|
126
123
|
# example: `192.0.2.1` or `example.com.`.
|
127
124
|
#
|
128
125
|
# @example
|
129
|
-
# require "google/cloud"
|
126
|
+
# require "google/cloud/dns"
|
130
127
|
#
|
131
|
-
#
|
132
|
-
# dns = gcloud.dns
|
128
|
+
# dns = Google::Cloud::Dns.new
|
133
129
|
# zone = dns.zone "example-com"
|
134
130
|
# zone.update do |tx|
|
135
131
|
# tx.replace "example.com.",
|
@@ -156,10 +152,9 @@ module Google
|
|
156
152
|
# @yieldparam [Record] record the record to be modified
|
157
153
|
#
|
158
154
|
# @example
|
159
|
-
# require "google/cloud"
|
155
|
+
# require "google/cloud/dns"
|
160
156
|
#
|
161
|
-
#
|
162
|
-
# dns = gcloud.dns
|
157
|
+
# dns = Google::Cloud::Dns.new
|
163
158
|
# zone.update do |tx|
|
164
159
|
# tx.modify "www.example.com.", "CNAME" do |cname|
|
165
160
|
# cname.ttl = 86400 # only change the TTL
|
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.21.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: 2016-
|
12
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.21.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.21.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: google-api-client
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,6 +165,20 @@ dependencies:
|
|
165
165
|
- - "~>"
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0.9'
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: yard-doctest
|
170
|
+
requirement: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - "~>"
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: 0.1.6
|
175
|
+
type: :development
|
176
|
+
prerelease: false
|
177
|
+
version_requirements: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - "~>"
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: 0.1.6
|
168
182
|
description: google-cloud-dns is the official library for Google Cloud DNS.
|
169
183
|
email:
|
170
184
|
- mike@blowmage.com
|