gandi_v5 0.6.0 → 0.10.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 +81 -5
- data/README.md +65 -14
- data/lib/gandi_v5.rb +139 -70
- data/lib/gandi_v5/billing/info/prepaid.rb +1 -0
- data/lib/gandi_v5/data.rb +3 -2
- data/lib/gandi_v5/data/converter.rb +3 -2
- data/lib/gandi_v5/data/converter/array_of.rb +3 -2
- data/lib/gandi_v5/data/converter/integer.rb +3 -2
- data/lib/gandi_v5/data/converter/symbol.rb +3 -2
- data/lib/gandi_v5/data/converter/time.rb +3 -2
- data/lib/gandi_v5/domain.rb +55 -18
- data/lib/gandi_v5/domain/availability/product/period.rb +1 -1
- data/lib/gandi_v5/domain/contact.rb +5 -5
- data/lib/gandi_v5/domain/tld.rb +2 -2
- data/lib/gandi_v5/domain/transfer_in.rb +172 -0
- data/lib/gandi_v5/domain/transfer_in/availability.rb +51 -0
- data/lib/gandi_v5/domain/web_forwarding.rb +182 -0
- data/lib/gandi_v5/email.rb +3 -0
- data/lib/gandi_v5/email/forward.rb +3 -9
- data/lib/gandi_v5/email/mailbox.rb +5 -11
- data/lib/gandi_v5/error/gandi_error.rb +1 -0
- data/lib/gandi_v5/live_dns.rb +2 -12
- data/lib/gandi_v5/live_dns/domain.rb +340 -29
- data/lib/gandi_v5/live_dns/domain/dnssec_key.rb +120 -0
- data/lib/gandi_v5/live_dns/domain/record.rb +81 -0
- data/lib/gandi_v5/live_dns/domain/snapshot.rb +111 -0
- data/lib/gandi_v5/live_dns/domain/tsig_key.rb +74 -0
- data/lib/gandi_v5/sharing_space.rb +27 -0
- data/lib/gandi_v5/simple_hosting.rb +13 -0
- data/lib/gandi_v5/simple_hosting/instance.rb +251 -0
- data/lib/gandi_v5/simple_hosting/instance/application.rb +45 -0
- data/lib/gandi_v5/simple_hosting/instance/database.rb +20 -0
- data/lib/gandi_v5/simple_hosting/instance/language.rb +22 -0
- data/lib/gandi_v5/simple_hosting/instance/upgrade.rb +22 -0
- data/lib/gandi_v5/simple_hosting/instance/virtual_host.rb +272 -0
- data/lib/gandi_v5/simple_hosting/instance/virtual_host/linked_dns_zone.rb +75 -0
- data/lib/gandi_v5/template.rb +271 -0
- data/lib/gandi_v5/template/dispatch.rb +109 -0
- data/lib/gandi_v5/template/payload.rb +64 -0
- data/lib/gandi_v5/template/payload/dns_record.rb +23 -0
- data/lib/gandi_v5/template/payload/web_forwarding.rb +82 -0
- data/lib/gandi_v5/version.rb +1 -1
- data/spec/.rubocop.yml +9 -9
- data/spec/features/list_domain_renewals_spec.rb +16 -0
- data/spec/features/list_email_addresses_spec.rb +39 -0
- data/spec/fixtures/bodies/GandiV5_Domain_TransferIn/fetch.yml +21 -0
- data/spec/fixtures/bodies/GandiV5_Domain_TransferIn_Availability/fetch.yml +10 -0
- data/spec/fixtures/bodies/GandiV5_Domain_WebForwarding/fetch.yml +9 -0
- data/spec/fixtures/bodies/GandiV5_Domain_WebForwarding/list.yml +9 -0
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Domain/fetch.yml +1 -2
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Domain/list_tsig.yml +3 -0
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Domain/nameservers.yml +3 -0
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Domain_DnssecKey/fetch.yml +12 -0
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Domain_DnssecKey/list.yml +9 -0
- data/spec/fixtures/bodies/{GandiV5_LiveDNS_Zone_Snapshot → GandiV5_LiveDNS_Domain_Snapshot}/fetch.yml +4 -3
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Domain_Snapshot/list.yml +5 -0
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Domain_TsigKey/fetch.yml +9 -0
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Domain_TsigKey/list.yml +4 -0
- data/spec/fixtures/bodies/GandiV5_SimpleHosting_Instance/fetch.yml +80 -0
- data/spec/fixtures/bodies/GandiV5_SimpleHosting_Instance/list.yml +38 -0
- data/spec/fixtures/bodies/GandiV5_SimpleHosting_Instance_VirtualHost/fetch.yml +26 -0
- data/spec/fixtures/bodies/GandiV5_SimpleHosting_Instance_VirtualHost/list.yml +18 -0
- data/spec/fixtures/bodies/GandiV5_Template/fetch.yml +41 -0
- data/spec/fixtures/bodies/GandiV5_Template/list.yml +20 -0
- data/spec/fixtures/bodies/GandiV5_Template_Dispatch/fetch.yml +49 -0
- data/spec/fixtures/vcr/Examples/List_domain_renewals.yml +54 -0
- data/spec/fixtures/vcr/Examples/List_email_addresses.yml +103 -0
- data/spec/spec_helper.rb +8 -7
- data/spec/units/gandi_v5/domain/transfer_in/availability_spec.rb +49 -0
- data/spec/units/gandi_v5/domain/transfer_in_spec.rb +143 -0
- data/spec/units/gandi_v5/domain/web_forwarding_spec.rb +150 -0
- data/spec/units/gandi_v5/domain_spec.rb +56 -37
- data/spec/units/gandi_v5/email/forward_spec.rb +5 -34
- data/spec/units/gandi_v5/email/mailbox_spec.rb +4 -34
- data/spec/units/gandi_v5/live_dns/domain/dnssec_key_spec.rb +128 -0
- data/spec/units/gandi_v5/live_dns/{record_set_spec.rb → domain/record_spec.rb} +1 -1
- data/spec/units/gandi_v5/live_dns/domain/snapshot_spec.rb +101 -0
- data/spec/units/gandi_v5/live_dns/domain/tsig_key_spec.rb +78 -0
- data/spec/units/gandi_v5/live_dns/domain_spec.rb +297 -118
- data/spec/units/gandi_v5/live_dns_spec.rb +0 -12
- data/spec/units/gandi_v5/simple_hosting/instance/application_spec.rb +37 -0
- data/spec/units/gandi_v5/simple_hosting/instance/virtual_host/linked_dns_zone_spec.rb +50 -0
- data/spec/units/gandi_v5/simple_hosting/instance/virtual_host_spec.rb +324 -0
- data/spec/units/gandi_v5/simple_hosting/instance_spec.rb +190 -0
- data/spec/units/gandi_v5/simple_hosting_spec.rb +9 -0
- data/spec/units/gandi_v5/template/dispatch_spec.rb +70 -0
- data/spec/units/gandi_v5/template/payload/web_forwarding_spec.rb +44 -0
- data/spec/units/gandi_v5/template_spec.rb +341 -0
- data/spec/units/gandi_v5_spec.rb +111 -14
- metadata +226 -79
- data/.gitignore +0 -26
- data/.rspec +0 -3
- data/.rubocop.yml +0 -30
- data/.travis.yml +0 -38
- data/FUNDING.yml +0 -10
- data/Gemfile +0 -6
- data/Guardfile +0 -39
- data/Rakefile +0 -3
- data/bin/console +0 -13
- data/gandi_v5.gemspec +0 -42
- data/lib/gandi_v5/domain/sharing_space.rb +0 -29
- data/lib/gandi_v5/live_dns/has_zone_records.rb +0 -153
- data/lib/gandi_v5/live_dns/record_set.rb +0 -79
- data/lib/gandi_v5/live_dns/zone.rb +0 -160
- data/lib/gandi_v5/live_dns/zone/snapshot.rb +0 -81
- data/spec/features/domain_spec.rb +0 -45
- data/spec/features/livedns_domain_spec.rb +0 -8
- data/spec/features/livedns_zone_spec.rb +0 -44
- data/spec/features/mailbox_spec.rb +0 -18
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Zone/fetch.yml +0 -11
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Zone/list.yml +0 -11
- data/spec/fixtures/bodies/GandiV5_LiveDNS_Zone_Snapshot/list.yml +0 -3
- data/spec/fixtures/vcr/Domain_features/List_domains.yml +0 -55
- data/spec/fixtures/vcr/Domain_features/Renew_domain.yml +0 -133
- data/spec/fixtures/vcr/LiveDNS_Domain_features/List_domains.yml +0 -32
- data/spec/fixtures/vcr/LiveDNS_Zone_features/List_zones.yml +0 -42
- data/spec/fixtures/vcr/LiveDNS_Zone_features/Make_and_save_snapshot.yml +0 -72
- data/spec/fixtures/vcr/LiveDNS_Zone_features/Save_zone_to_file.yml +0 -28
- data/spec/fixtures/vcr/Mailbox_features/List_mailboxes.yml +0 -39
- data/spec/units/gandi_v5/billing/info_spec.rb +0 -4
- data/spec/units/gandi_v5/domain/availability/product/period_spec.rb +0 -4
- data/spec/units/gandi_v5/domain/availability/product/price_spec.rb +0 -4
- data/spec/units/gandi_v5/domain/availability/product_spec.rb +0 -4
- data/spec/units/gandi_v5/domain/availability/tax_spec.rb +0 -4
- data/spec/units/gandi_v5/domain/contract_spec.rb +0 -4
- data/spec/units/gandi_v5/domain/dates_spec.rb +0 -4
- data/spec/units/gandi_v5/domain/restore_information_spec.rb +0 -4
- data/spec/units/gandi_v5/domain/sharing_space_spec.rb +0 -4
- data/spec/units/gandi_v5/error_spec.rb +0 -4
- data/spec/units/gandi_v5/live_dns/zone/snapshot_spec.rb +0 -66
- data/spec/units/gandi_v5/live_dns/zone_spec.rb +0 -347
@@ -1,133 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: https://api.gandi.net/v5/domain/domains/example.net
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- application/json
|
12
|
-
Authorization:
|
13
|
-
- Apikey abdce12345
|
14
|
-
Host:
|
15
|
-
- api.gandi.net
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 200
|
19
|
-
message: OK
|
20
|
-
headers:
|
21
|
-
Content-Type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
body:
|
24
|
-
encoding: UTF-8
|
25
|
-
string: |-
|
26
|
-
{
|
27
|
-
"status": [
|
28
|
-
"clientTransferProhibited"
|
29
|
-
],
|
30
|
-
"dates": {
|
31
|
-
"created_at": "2019-02-13T11:04:18Z",
|
32
|
-
"deletes_at": "2021-03-30T00:04:18Z",
|
33
|
-
"hold_begins_at": "2021-02-13T10:04:18Z",
|
34
|
-
"hold_ends_at": "2021-03-30T10:04:18Z",
|
35
|
-
"pending_delete_ends_at": "2021-05-04T10:04:18Z",
|
36
|
-
"registry_created_at": "2019-02-13T10:04:18Z",
|
37
|
-
"registry_ends_at": "2021-02-13T10:04:18Z",
|
38
|
-
"renew_begins_at": "2012-01-01T00:00:00Z",
|
39
|
-
"restore_ends_at": "2021-04-29T10:04:18Z",
|
40
|
-
"updated_at": "2019-02-25T16:20:49Z",
|
41
|
-
"authinfo_expires_at": "2020-02-25T16:20:49Z"
|
42
|
-
},
|
43
|
-
"can_tld_lock": true,
|
44
|
-
"tags": [],
|
45
|
-
"nameservers": [
|
46
|
-
"ns-25-a.gnadi.net",
|
47
|
-
"ns-113-b.gnadi.net",
|
48
|
-
"ns-58-c.gnadi.net"
|
49
|
-
],
|
50
|
-
"contacts": {
|
51
|
-
"owner": {
|
52
|
-
"city": "Paris",
|
53
|
-
"given": "Alice",
|
54
|
-
"reachability": "pending",
|
55
|
-
"family": "Doe",
|
56
|
-
"zip": "75001",
|
57
|
-
"extra_parameters": {
|
58
|
-
"birth_date": "",
|
59
|
-
"birth_department": "",
|
60
|
-
"birth_city": "",
|
61
|
-
"birth_country": ""
|
62
|
-
},
|
63
|
-
"country": "FR",
|
64
|
-
"streetaddr": "5 rue neuve",
|
65
|
-
"data_obfuscated": true,
|
66
|
-
"mail_obfuscated": true,
|
67
|
-
"phone": "+33.123456789",
|
68
|
-
"state": "FR-J",
|
69
|
-
"validation": "none",
|
70
|
-
"type": 0,
|
71
|
-
"email": "alice@example.org"
|
72
|
-
}
|
73
|
-
},
|
74
|
-
"fqdn": "example.net",
|
75
|
-
"autorenew": {
|
76
|
-
"dates": [
|
77
|
-
"2021-01-13T09:04:18Z",
|
78
|
-
"2021-01-29T10:04:18Z",
|
79
|
-
"2021-02-12T10:04:18Z"
|
80
|
-
],
|
81
|
-
"org_id": "fe0b931c-18c5-11e9-b9b5-00163ec4cb00",
|
82
|
-
"duration": 1,
|
83
|
-
"href": "http://api.test/v5/domain/domains/example.net/autorenew",
|
84
|
-
"enabled": false
|
85
|
-
},
|
86
|
-
"authinfo": "8vyhljvJg+",
|
87
|
-
"sharing_space": {
|
88
|
-
"id": "fe0b931c-18c5-11e9-b9b5-00163ec4cb00",
|
89
|
-
"name": "alice_doe"
|
90
|
-
},
|
91
|
-
"tld": "net",
|
92
|
-
"services": [
|
93
|
-
"gandilivedns",
|
94
|
-
"mailboxv2"
|
95
|
-
],
|
96
|
-
"id": "ba1167be-2f76-11e9-9dfb-00163ec4cb00",
|
97
|
-
"trustee_roles": [],
|
98
|
-
"href": "http://api.test/v5/domain/domains/example.net",
|
99
|
-
"fqdn_unicode": "example.net"
|
100
|
-
}
|
101
|
-
http_version:
|
102
|
-
recorded_at: Thu, 30 May 2019 06:22:02 GMT
|
103
|
-
|
104
|
-
- request:
|
105
|
-
method: post
|
106
|
-
uri: https://api.gandi.net/v5/domain/domains/example.net/renew
|
107
|
-
body:
|
108
|
-
encoding: US-ASCII
|
109
|
-
string: '{"duration":2}'
|
110
|
-
headers:
|
111
|
-
Accept:
|
112
|
-
- application/json
|
113
|
-
Authorization:
|
114
|
-
- Apikey abdce12345
|
115
|
-
Host:
|
116
|
-
- api.gandi.net
|
117
|
-
response:
|
118
|
-
status:
|
119
|
-
code: 200
|
120
|
-
message: OK
|
121
|
-
headers:
|
122
|
-
Content-Type:
|
123
|
-
- application/json; charset=utf-8
|
124
|
-
body:
|
125
|
-
encoding: UTF-8
|
126
|
-
string: |-
|
127
|
-
{
|
128
|
-
"message":"Domain renewed."
|
129
|
-
}
|
130
|
-
http_version:
|
131
|
-
recorded_at: Thu, 30 May 2019 06:22:02 GMT
|
132
|
-
|
133
|
-
recorded_with: VCR 4.0.0
|
@@ -1,32 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: https://dns.api.gandi.net/api/v5/domains
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- application/json
|
12
|
-
Authorization:
|
13
|
-
- Apikey abdce12345
|
14
|
-
Host:
|
15
|
-
- api.gandi.net
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 200
|
19
|
-
message: OK
|
20
|
-
headers:
|
21
|
-
Content-Type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
body:
|
24
|
-
encoding: UTF-8
|
25
|
-
string: |-
|
26
|
-
[
|
27
|
-
{"fqdn":"example.com"},
|
28
|
-
{"fqdn":"example.net"}
|
29
|
-
]
|
30
|
-
http_version:
|
31
|
-
recorded_at: Thu, 30 May 2019 06:22:02 GMT
|
32
|
-
recorded_with: VCR 4.0.0
|
@@ -1,42 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: https://dns.api.gandi.net/api/v5/zones
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- application/json
|
12
|
-
X-Api-Key:
|
13
|
-
- abdce12345
|
14
|
-
Host:
|
15
|
-
- api.gandi.net
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 200
|
19
|
-
message: OK
|
20
|
-
headers:
|
21
|
-
Content-Type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
body:
|
24
|
-
encoding: UTF-8
|
25
|
-
string: |-
|
26
|
-
[
|
27
|
-
{
|
28
|
-
"retry": 3600,
|
29
|
-
"uuid": "uuid-of-zone",
|
30
|
-
"minimum": 10800,
|
31
|
-
"refresh": 10800,
|
32
|
-
"expire": 604800,
|
33
|
-
"serial": 1432798405,
|
34
|
-
"user_uuid": "uuid-of-user",
|
35
|
-
"email": "hostmaster.gandi.net.",
|
36
|
-
"primary_ns": "a.dns.gandi.net.",
|
37
|
-
"name": "Zone Name"
|
38
|
-
}
|
39
|
-
]
|
40
|
-
http_version:
|
41
|
-
recorded_at: Thu, 30 May 2019 06:22:02 GMT
|
42
|
-
recorded_with: VCR 4.0.0
|
@@ -1,72 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: post
|
5
|
-
uri: https://dns.api.gandi.net/api/v5/zones/zone-uuid/snapshots
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- application/json
|
12
|
-
X-Api-Key:
|
13
|
-
- abdce12345
|
14
|
-
Host:
|
15
|
-
- api.gandi.net
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 200
|
19
|
-
message: OK
|
20
|
-
headers:
|
21
|
-
Content-Type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
body:
|
24
|
-
encoding: UTF-8
|
25
|
-
string: |-
|
26
|
-
{
|
27
|
-
"message": "Zone Snapshot Created",
|
28
|
-
"uuid": "snapshot-uuid"
|
29
|
-
}
|
30
|
-
http_version:
|
31
|
-
recorded_at: Thu, 30 May 2019 06:22:02 GMT
|
32
|
-
|
33
|
-
- request:
|
34
|
-
method: get
|
35
|
-
uri: https://dns.api.gandi.net/api/v5/zones/zone-uuid/snapshots/snapshot-uuid
|
36
|
-
body:
|
37
|
-
encoding: US-ASCII
|
38
|
-
string: ''
|
39
|
-
headers:
|
40
|
-
Accept:
|
41
|
-
- text/plain
|
42
|
-
X-Api-Key:
|
43
|
-
- abdce12345
|
44
|
-
Host:
|
45
|
-
- api.gandi.net
|
46
|
-
response:
|
47
|
-
status:
|
48
|
-
code: 200
|
49
|
-
message: OK
|
50
|
-
headers:
|
51
|
-
Content-Type:
|
52
|
-
- application/json; charset=utf-8
|
53
|
-
body:
|
54
|
-
encoding: UTF-8
|
55
|
-
string: |-
|
56
|
-
{
|
57
|
-
"date_created": "2016-12-16T16:51:26Z",
|
58
|
-
"uuid": "snapshot-uuid",
|
59
|
-
"zone_uuid": "zone-uuid",
|
60
|
-
"zone_data": [
|
61
|
-
{
|
62
|
-
"rrset_type": "A",
|
63
|
-
"rrset_ttl": 10800,
|
64
|
-
"rrset_name": "www",
|
65
|
-
"rrset_values": ["10.0.1.42"]
|
66
|
-
}
|
67
|
-
]
|
68
|
-
}
|
69
|
-
http_version:
|
70
|
-
recorded_at: Thu, 30 May 2019 06:22:02 GMT
|
71
|
-
|
72
|
-
recorded_with: VCR 4.0.0
|
@@ -1,28 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: https://dns.api.gandi.net/api/v5/zones/zone-uuid/records
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- text/plain
|
12
|
-
X-Api-Key:
|
13
|
-
- abdce12345
|
14
|
-
Host:
|
15
|
-
- api.gandi.net
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 200
|
19
|
-
message: OK
|
20
|
-
headers:
|
21
|
-
Content-Type:
|
22
|
-
- text/plain; charset=utf-8
|
23
|
-
body:
|
24
|
-
encoding: UTF-8
|
25
|
-
string: "Contents of zone file.\n"
|
26
|
-
http_version:
|
27
|
-
recorded_at: Thu, 30 May 2019 06:22:02 GMT
|
28
|
-
recorded_with: VCR 4.0.0
|
@@ -1,39 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: https://api.gandi.net/v5/email/mailboxes/example.net?page=1
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- application/json
|
12
|
-
Authorization:
|
13
|
-
- Apikey abdce12345
|
14
|
-
Host:
|
15
|
-
- api.gandi.net
|
16
|
-
response:
|
17
|
-
status:
|
18
|
-
code: 200
|
19
|
-
message: OK
|
20
|
-
headers:
|
21
|
-
Content-Type:
|
22
|
-
- application/json; charset=utf-8
|
23
|
-
body:
|
24
|
-
encoding: UTF-8
|
25
|
-
string: |-
|
26
|
-
[
|
27
|
-
{
|
28
|
-
"domain": "example.net",
|
29
|
-
"login": "alice",
|
30
|
-
"address": "alice@example.net",
|
31
|
-
"id": "066743e5-96e4-4a1d-9195-8b8a700a8a79",
|
32
|
-
"mailbox_type": "standard",
|
33
|
-
"quota_used": 1200,
|
34
|
-
"href": "https://api.test/api/v5/email/example.net/066743e5-96e4-4a1d-9195-8b8a700a8a79"
|
35
|
-
}
|
36
|
-
]
|
37
|
-
http_version:
|
38
|
-
recorded_at: Thu, 30 May 2019 06:22:02 GMT
|
39
|
-
recorded_with: VCR 4.0.0
|
@@ -1,66 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe GandiV5::LiveDNS::Zone::Snapshot do
|
4
|
-
subject do
|
5
|
-
described_class.new(
|
6
|
-
created_at: Time.new(2016, 12, 16, 16, 51, 26, 0),
|
7
|
-
uuid: 'snapshot-uuid',
|
8
|
-
zone_uuid: 'zone-uuid',
|
9
|
-
records: []
|
10
|
-
)
|
11
|
-
end
|
12
|
-
|
13
|
-
it '#delete' do
|
14
|
-
expect(GandiV5).to receive(:delete).with('https://dns.api.gandi.net/api/v5/zones/zone-uuid/snapshots/snapshot-uuid')
|
15
|
-
.and_return([nil, { 'message' => 'Confirmation message.' }])
|
16
|
-
expect(subject.delete).to eq 'Confirmation message.'
|
17
|
-
end
|
18
|
-
|
19
|
-
it '#fetch_zone' do
|
20
|
-
returns = double GandiV5::LiveDNS::Zone
|
21
|
-
expect(GandiV5::LiveDNS::Zone).to receive(:fetch).with('zone-uuid')
|
22
|
-
.and_return(returns)
|
23
|
-
expect(subject.fetch_zone).to be returns
|
24
|
-
end
|
25
|
-
|
26
|
-
describe '#zone' do
|
27
|
-
it 'Not previously fetched' do
|
28
|
-
returns = double GandiV5::LiveDNS::Zone
|
29
|
-
expect(subject).to receive(:fetch_zone).and_return(returns)
|
30
|
-
expect(subject.zone).to be returns
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'Previously fetched' do
|
34
|
-
returns = double GandiV5::LiveDNS::Zone
|
35
|
-
subject.instance_exec { @zone = returns }
|
36
|
-
expect(subject).to_not receive(:fetch_zone)
|
37
|
-
expect(subject.zone).to be returns
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
it '.list' do
|
42
|
-
body_fixture = File.expand_path(File.join('spec', 'fixtures', 'bodies', 'GandiV5_LiveDNS_Zone_Snapshot', 'list.yml'))
|
43
|
-
expect(GandiV5).to receive(:get).with('https://dns.api.gandi.net/api/v5/zones/zone-uuid/snapshots')
|
44
|
-
.and_return([nil, YAML.load_file(body_fixture)])
|
45
|
-
expect(described_class.list('zone-uuid')).to eq('snapshot-uuid' => Time.new(2016, 12, 16, 16, 51, 26, 0))
|
46
|
-
end
|
47
|
-
|
48
|
-
describe '.fetch' do
|
49
|
-
subject { described_class.fetch 'zone-uuid', 'snapshot-uuid' }
|
50
|
-
|
51
|
-
before :each do
|
52
|
-
body_fixture = File.expand_path(File.join('spec', 'fixtures', 'bodies', 'GandiV5_LiveDNS_Zone_Snapshot', 'fetch.yml'))
|
53
|
-
expect(GandiV5).to receive(:get).with('https://dns.api.gandi.net/api/v5/zones/zone-uuid/snapshots/snapshot-uuid')
|
54
|
-
.and_return([nil, YAML.load_file(body_fixture)])
|
55
|
-
end
|
56
|
-
|
57
|
-
its('created_at') { should eq Time.new(2016, 12, 16, 16, 51, 26, 0) }
|
58
|
-
its('uuid') { should eq 'snapshot-uuid' }
|
59
|
-
its('zone_uuid') { should eq 'zone-uuid' }
|
60
|
-
its('records.count') { should eq 1 }
|
61
|
-
its('records.first.type') { should eq 'A' }
|
62
|
-
its('records.first.ttl') { should eq 10_800 }
|
63
|
-
its('records.first.name') { should eq 'www' }
|
64
|
-
its('records.first.values') { should match_array ['10.0.1.42'] }
|
65
|
-
end
|
66
|
-
end
|