idcf-dns 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -4
- data/lib/idcf/dns/client_extensions/record.rb +8 -8
- data/lib/idcf/dns/response.rb +1 -5
- data/lib/idcf/dns/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b861ba7b2191302c0ed3274701013ee502adf511
|
4
|
+
data.tar.gz: c28eb0197d213f6f3d68cabf592c385093800949
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5268d175b7674ccfc191b2c443a5415f04469710912c96324aa54b488cb6a230e2b5a928f5bddea479a2de5b2e308f5736050a55344739ab06d747705af8e553
|
7
|
+
data.tar.gz: d6da59613a8567de2e9c65569f4348424a32ac8ad1e5b6159c13ff99fdf38bf01886e19a0ffb7845d8a58030384f243d6c9f8f75d20c01fb544d86610c281c24
|
data/README.md
CHANGED
@@ -34,12 +34,18 @@ client =
|
|
34
34
|
secret_key: ENV["IDCF_SECRET_KEY"]
|
35
35
|
)
|
36
36
|
|
37
|
+
# Call GET request directly
|
38
|
+
# returns Response object
|
37
39
|
response = client.get("zones")
|
38
40
|
response.success? #=> true
|
41
|
+
response.status #=> 200
|
42
|
+
|
43
|
+
# Response#body returns HTTP response body as a hash or an array
|
39
44
|
response.body #=> [zone1, zone2, ...]
|
40
45
|
response.body[0] #=> zone1
|
46
|
+
|
47
|
+
# Response#[] is alias to Response#body[]
|
41
48
|
response[0] #=> zone1
|
42
|
-
response.status #=> 200
|
43
49
|
```
|
44
50
|
|
45
51
|
#### Zones
|
@@ -100,18 +106,18 @@ records = client.list_records(zone_uuid).body
|
|
100
106
|
records[0]["name"] #=> "baz.foobar.example.com"
|
101
107
|
|
102
108
|
# Get a record
|
103
|
-
record = client.get_record(
|
109
|
+
record = client.get_record(zone_uuid, record_uuid).body
|
104
110
|
record["name"] #=> "baz.foobar.example.com"
|
105
111
|
```
|
106
112
|
|
107
113
|
##### Update record
|
108
114
|
```ruby
|
109
|
-
client.update_record(
|
115
|
+
client.update_record(zone_uuid, record_uuid, content: "210.140.158.1")
|
110
116
|
```
|
111
117
|
|
112
118
|
##### Delete record
|
113
119
|
```ruby
|
114
|
-
client.delete_record(
|
120
|
+
client.delete_record(zone_uuid, record_uuid)
|
115
121
|
```
|
116
122
|
|
117
123
|
### Advanced usage
|
@@ -22,21 +22,21 @@ module Idcf
|
|
22
22
|
|
23
23
|
# Delete a record.
|
24
24
|
#
|
25
|
-
# @param uuid [String] UUID of record
|
26
25
|
# @param zone_uuid [String] UUID of zone
|
26
|
+
# @param uuid [String] UUID of record
|
27
27
|
# @param headers [Hash] HTTP request headers
|
28
28
|
# @return [Response] HTTP response object
|
29
|
-
def delete_record(
|
29
|
+
def delete_record(zone_uuid, uuid, headers = {})
|
30
30
|
delete!("zones/#{zone_uuid}/records/#{uuid}", {}, headers)
|
31
31
|
end
|
32
32
|
|
33
33
|
# Get a record.
|
34
34
|
#
|
35
|
-
# @param uuid [String] UUID of record
|
36
35
|
# @param zone_uuid [String] UUID of zone
|
36
|
+
# @param uuid [String] UUID of record
|
37
37
|
# @param headers [Hash] HTTP request headers
|
38
38
|
# @return [Response] HTTP response object
|
39
|
-
def get_record(
|
39
|
+
def get_record(zone_uuid, uuid, headers = {})
|
40
40
|
get!("zones/#{zone_uuid}/records/#{uuid}", {}, headers)
|
41
41
|
end
|
42
42
|
|
@@ -50,8 +50,8 @@ module Idcf
|
|
50
50
|
|
51
51
|
# Update a record.
|
52
52
|
#
|
53
|
-
# @param uuid [String] UUID of record
|
54
53
|
# @param zone_uuid [String] UUID of zone
|
54
|
+
# @param uuid [String] UUID of record
|
55
55
|
# @param attributes [Hash] request attributes
|
56
56
|
# @option attributes [String] :name name of record
|
57
57
|
# @option attributes [String] :type type of record
|
@@ -61,18 +61,18 @@ module Idcf
|
|
61
61
|
# @option attributes [Integer] :priority priority of record
|
62
62
|
# @param headers [Hash] HTTP request headers
|
63
63
|
# @return [Response] HTTP response object
|
64
|
-
def update_record(
|
64
|
+
def update_record(zone_uuid, uuid, attributes, headers = {})
|
65
65
|
Validators::Record.validate_attributes!(attributes, :update)
|
66
66
|
put!("zones/#{zone_uuid}/records/#{uuid}", attributes, headers)
|
67
67
|
end
|
68
68
|
|
69
69
|
# Get a record object.
|
70
70
|
#
|
71
|
-
# @param uuid [String] UUID of record
|
72
71
|
# @param zone_uuid [String] UUID of zone
|
72
|
+
# @param uuid [String] UUID of record
|
73
73
|
# @param headers [Hash] HTTP request headers
|
74
74
|
# @return [Resources::Record] a record object
|
75
|
-
def record(
|
75
|
+
def record(zone_uuid, uuid, headers = {})
|
76
76
|
Resources::Record.new(self, get_record(uuid, zone_uuid, headers).body)
|
77
77
|
end
|
78
78
|
|
data/lib/idcf/dns/response.rb
CHANGED
data/lib/idcf/dns/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: idcf-dns
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nownabe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|