droplet_kit 1.2.3 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/droplet_kit.gemspec +2 -2
- data/lib/droplet_kit.rb +20 -3
- data/lib/droplet_kit/client.rb +2 -0
- data/lib/droplet_kit/error_handling_resourcable.rb +19 -0
- data/lib/droplet_kit/mappings/domain_record_mapping.rb +6 -6
- data/lib/droplet_kit/mappings/floating_ip_mapping.rb +19 -0
- data/lib/droplet_kit/models/floating_ip.rb +10 -0
- data/lib/droplet_kit/paginated_resource.rb +1 -1
- data/lib/droplet_kit/resources/account_resource.rb +2 -0
- data/lib/droplet_kit/resources/action_resource.rb +2 -0
- data/lib/droplet_kit/resources/domain_record_resource.rb +2 -0
- data/lib/droplet_kit/resources/domain_resource.rb +2 -0
- data/lib/droplet_kit/resources/droplet_action_resource.rb +4 -0
- data/lib/droplet_kit/resources/droplet_resource.rb +3 -1
- data/lib/droplet_kit/resources/droplet_upgrade_resource.rb +2 -0
- data/lib/droplet_kit/resources/floating_ip_action_resource.rb +30 -0
- data/lib/droplet_kit/resources/floating_ip_resource.rb +29 -0
- data/lib/droplet_kit/resources/image_action_resource.rb +4 -0
- data/lib/droplet_kit/resources/image_resource.rb +2 -0
- data/lib/droplet_kit/resources/region_resource.rb +2 -0
- data/lib/droplet_kit/resources/size_resource.rb +2 -0
- data/lib/droplet_kit/resources/ssh_key_resource.rb +2 -0
- data/lib/droplet_kit/version.rb +1 -1
- data/spec/fixtures/droplet_actions/change_kernel.json +27 -0
- data/spec/fixtures/droplet_actions/disable_backups.json +27 -0
- data/spec/fixtures/droplet_actions/enable_ipv6.json +27 -0
- data/spec/fixtures/droplet_actions/enable_private_networking.json +27 -0
- data/spec/fixtures/droplet_actions/find.json +19 -0
- data/spec/fixtures/droplet_actions/password_reset.json +27 -0
- data/spec/fixtures/droplet_actions/power_cycle.json +27 -0
- data/spec/fixtures/droplet_actions/power_off.json +27 -0
- data/spec/fixtures/droplet_actions/power_on.json +27 -0
- data/spec/fixtures/droplet_actions/reboot.json +27 -0
- data/spec/fixtures/droplet_actions/rebuild.json +27 -0
- data/spec/fixtures/droplet_actions/rename.json +27 -0
- data/spec/fixtures/droplet_actions/resize.json +27 -0
- data/spec/fixtures/droplet_actions/restore.json +27 -0
- data/spec/fixtures/droplet_actions/shutdown.json +27 -0
- data/spec/fixtures/droplet_actions/snapshot.json +27 -0
- data/spec/fixtures/droplet_actions/upgrade.json +27 -0
- data/spec/fixtures/floating_ip_actions/all.json +41 -0
- data/spec/fixtures/floating_ip_actions/assign.json +27 -0
- data/spec/fixtures/floating_ip_actions/find.json +19 -0
- data/spec/fixtures/floating_ip_actions/unassign.json +27 -0
- data/spec/fixtures/floating_ips/all.json +186 -0
- data/spec/fixtures/floating_ips/all_empty.json +7 -0
- data/spec/fixtures/floating_ips/create.json +29 -0
- data/spec/fixtures/floating_ips/create_with_droplet.json +44 -0
- data/spec/fixtures/floating_ips/find.json +28 -0
- data/spec/fixtures/image_actions/convert.json +27 -0
- data/spec/fixtures/image_actions/transfer.json +27 -0
- data/spec/fixtures/images/private.json +31 -0
- data/spec/fixtures/images/type.json +31 -0
- data/spec/lib/droplet_kit/resources/account_resource_spec.rb +5 -0
- data/spec/lib/droplet_kit/resources/action_resource_spec.rb +7 -0
- data/spec/lib/droplet_kit/resources/domain_record_resource_spec.rb +13 -6
- data/spec/lib/droplet_kit/resources/domain_resource_spec.rb +10 -3
- data/spec/lib/droplet_kit/resources/droplet_action_resource_spec.rb +28 -34
- data/spec/lib/droplet_kit/resources/droplet_resource_spec.rb +36 -17
- data/spec/lib/droplet_kit/resources/droplet_upgrade_resource_spec.rb +6 -0
- data/spec/lib/droplet_kit/resources/floating_ip_action_resource_spec.rb +137 -0
- data/spec/lib/droplet_kit/resources/floating_ip_resource_spec.rb +91 -0
- data/spec/lib/droplet_kit/resources/image_action_resource_spec.rb +31 -28
- data/spec/lib/droplet_kit/resources/image_resource_spec.rb +11 -4
- data/spec/lib/droplet_kit/resources/region_resource_spec.rb +6 -0
- data/spec/lib/droplet_kit/resources/size_resource_spec.rb +6 -0
- data/spec/lib/droplet_kit/resources/ssh_key_resource_spec.rb +7 -0
- data/spec/support/request_stub_helpers.rb +1 -1
- data/spec/support/shared_examples/common_errors.rb +27 -0
- data/spec/support/shared_examples/paginated_endpoint.rb +2 -1
- data/spec/support/shared_examples/unsuccessful_create.rb +8 -0
- metadata +109 -38
- data/spec/support/null_hash_load.rb +0 -5
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "enable_private_networking",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "test",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": null,
|
9
|
+
"resource_type": "backend",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": ["512mb"],
|
16
|
+
"features": ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "password_reset",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "power_cycle",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "power_off",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "power_on",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "reboot",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "rebuild",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "rename",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "resize",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "restore",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "shutdown",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "snapshot",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "upgrade",
|
6
|
+
"started_at": "2014-07-29T14:35:27Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "droplet",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"actions": [
|
3
|
+
{
|
4
|
+
"id": 19,
|
5
|
+
"status": "completed",
|
6
|
+
"type": "assign_ip",
|
7
|
+
"started_at": "2014-10-28T17:11:05Z",
|
8
|
+
"completed_at": "2014-10-28T17:11:06Z",
|
9
|
+
"resource_id": 45646587,
|
10
|
+
"resource_type": "floating_ip",
|
11
|
+
"region_slug": "nyc1",
|
12
|
+
"region": {
|
13
|
+
"name": "New York",
|
14
|
+
"slug": "nyc1",
|
15
|
+
"available": true,
|
16
|
+
"sizes": ["512mb"],
|
17
|
+
"features": ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
18
|
+
}
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"id": 20,
|
22
|
+
"status": "completed",
|
23
|
+
"type": "release_ip",
|
24
|
+
"started_at": "2014-10-28T17:11:05Z",
|
25
|
+
"completed_at": "2014-10-28T17:11:06Z",
|
26
|
+
"resource_id": 45646587,
|
27
|
+
"resource_type": "floating_ip",
|
28
|
+
"region_slug": "nyc1",
|
29
|
+
"region": {
|
30
|
+
"name": "New York",
|
31
|
+
"slug": "nyc1",
|
32
|
+
"available": true,
|
33
|
+
"sizes": ["512mb"],
|
34
|
+
"features": ["virtio", "private_networking", "backups", "ipv6", "metadata"]
|
35
|
+
}
|
36
|
+
}
|
37
|
+
],
|
38
|
+
"meta": {
|
39
|
+
"total": 2
|
40
|
+
}
|
41
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
"action": {
|
3
|
+
"id": 2,
|
4
|
+
"status": "in-progress",
|
5
|
+
"type": "assign",
|
6
|
+
"started_at": "2014-08-05T15:15:28Z",
|
7
|
+
"completed_at": null,
|
8
|
+
"resource_id": 12,
|
9
|
+
"resource_type": "floating_ip",
|
10
|
+
"region_slug": "nyc1",
|
11
|
+
"region": {
|
12
|
+
"name": "New York",
|
13
|
+
"slug": "nyc1",
|
14
|
+
"available": true,
|
15
|
+
"sizes": [
|
16
|
+
"512mb"
|
17
|
+
],
|
18
|
+
"features": [
|
19
|
+
"virtio",
|
20
|
+
"private_networking",
|
21
|
+
"backups",
|
22
|
+
"ipv6",
|
23
|
+
"metadata"
|
24
|
+
]
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|