vultr 0.4.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +32 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +5 -10
- data/README.md +306 -136
- data/Rakefile +10 -6
- data/bin/console +21 -0
- data/bin/setup +8 -0
- data/bin/test +6 -0
- data/lib/vultr/client.rb +111 -0
- data/lib/vultr/collection.rb +22 -0
- data/lib/vultr/error.rb +4 -0
- data/lib/vultr/object.rb +19 -0
- data/lib/vultr/objects/account.rb +4 -0
- data/lib/vultr/objects/application.rb +4 -0
- data/lib/vultr/objects/backup.rb +4 -0
- data/lib/vultr/objects/bare_metal.rb +4 -0
- data/lib/vultr/objects/block_storage.rb +4 -0
- data/lib/vultr/objects/domain.rb +4 -0
- data/lib/vultr/objects/firewall_group.rb +4 -0
- data/lib/vultr/objects/instance.rb +4 -0
- data/lib/vultr/objects/iso.rb +4 -0
- data/lib/vultr/objects/kubernetes_cluster.rb +4 -0
- data/lib/vultr/objects/load_balancer.rb +4 -0
- data/lib/vultr/objects/object_storage.rb +4 -0
- data/lib/vultr/objects/operating_system.rb +4 -0
- data/lib/vultr/objects/plan.rb +4 -0
- data/lib/vultr/objects/private_network.rb +4 -0
- data/lib/vultr/objects/region.rb +4 -0
- data/lib/vultr/objects/reserved_ip.rb +4 -0
- data/lib/vultr/objects/snapshot.rb +4 -0
- data/lib/vultr/objects/ssh_key.rb +4 -0
- data/lib/vultr/objects/startup_script.rb +4 -0
- data/lib/vultr/objects/user.rb +4 -0
- data/lib/vultr/resource.rb +52 -0
- data/lib/vultr/resources/account.rb +7 -0
- data/lib/vultr/resources/applications.rb +8 -0
- data/lib/vultr/resources/backups.rb +12 -0
- data/lib/vultr/resources/bare_metal.rb +79 -0
- data/lib/vultr/resources/block_storage.rb +32 -0
- data/lib/vultr/resources/dns.rb +58 -0
- data/lib/vultr/resources/firewall.rb +42 -0
- data/lib/vultr/resources/instances.rb +145 -0
- data/lib/vultr/resources/iso.rb +25 -0
- data/lib/vultr/resources/kubernetes.rb +61 -0
- data/lib/vultr/resources/load_balancers.rb +50 -0
- data/lib/vultr/resources/object_storage.rb +33 -0
- data/lib/vultr/resources/operating_systems.rb +8 -0
- data/lib/vultr/resources/plans.rb +13 -0
- data/lib/vultr/resources/private_networks.rb +24 -0
- data/lib/vultr/resources/regions.rb +12 -0
- data/lib/vultr/resources/reserved_ips.rb +32 -0
- data/lib/vultr/resources/snapshots.rb +28 -0
- data/lib/vultr/resources/ssh_keys.rb +24 -0
- data/lib/vultr/resources/startup_scripts.rb +24 -0
- data/lib/vultr/resources/users.rb +24 -0
- data/lib/vultr/version.rb +1 -8
- data/lib/vultr.rb +56 -887
- data/test/fixtures/account/info.json +11 -0
- data/test/fixtures/applications/list.json +29 -0
- data/test/fixtures/backups/list.json +18 -0
- data/test/fixtures/backups/retrieve.json +9 -0
- data/test/fixtures/bare_metals/bandwidth.json +12 -0
- data/test/fixtures/bare_metals/create.json +26 -0
- data/test/fixtures/bare_metals/list.json +36 -0
- data/test/fixtures/bare_metals/list_ipv4.json +18 -0
- data/test/fixtures/bare_metals/list_ipv6.json +17 -0
- data/test/fixtures/bare_metals/reinstall.json +25 -0
- data/test/fixtures/bare_metals/retrieve.json +26 -0
- data/test/fixtures/bare_metals/update.json +26 -0
- data/test/fixtures/bare_metals/upgrades.json +47 -0
- data/test/fixtures/bare_metals/user_data.json +5 -0
- data/test/fixtures/bare_metals/vnc.json +5 -0
- data/test/fixtures/block_storage/attach.json +4 -0
- data/test/fixtures/block_storage/create.json +13 -0
- data/test/fixtures/block_storage/detach.json +4 -0
- data/test/fixtures/block_storage/list.json +22 -0
- data/test/fixtures/block_storage/retrieve.json +13 -0
- data/test/fixtures/domains/create.json +6 -0
- data/test/fixtures/domains/dnssec.json +7 -0
- data/test/fixtures/domains/list.json +15 -0
- data/test/fixtures/domains/record.json +10 -0
- data/test/fixtures/domains/records.json +19 -0
- data/test/fixtures/domains/retrieve.json +6 -0
- data/test/fixtures/domains/soa.json +6 -0
- data/test/fixtures/firewall/create.json +11 -0
- data/test/fixtures/firewall/create_rule.json +9 -0
- data/test/fixtures/firewall/delete.json +1 -0
- data/test/fixtures/firewall/delete_rule.json +1 -0
- data/test/fixtures/firewall/list.json +20 -0
- data/test/fixtures/firewall/list_rules.json +22 -0
- data/test/fixtures/firewall/retrieve.json +11 -0
- data/test/fixtures/firewall/retrieve_rule.json +13 -0
- data/test/fixtures/firewall/update.json +1 -0
- data/test/fixtures/instances/attach_iso.json +6 -0
- data/test/fixtures/instances/attach_private_network.json +1 -0
- data/test/fixtures/instances/backup_schedule.json +10 -0
- data/test/fixtures/instances/bandwidth.json +12 -0
- data/test/fixtures/instances/create.json +36 -0
- data/test/fixtures/instances/create_ipv4_reverse.json +1 -0
- data/test/fixtures/instances/create_ipv6_reverse.json +1 -0
- data/test/fixtures/instances/delete.json +1 -0
- data/test/fixtures/instances/delete_ipv4.json +1 -0
- data/test/fixtures/instances/delete_ipv6.json +1 -0
- data/test/fixtures/instances/detach_iso.json +5 -0
- data/test/fixtures/instances/detach_private_network.json +1 -0
- data/test/fixtures/instances/halt.json +1 -0
- data/test/fixtures/instances/halt_instances.json +1 -0
- data/test/fixtures/instances/ipv4.json +9 -0
- data/test/fixtures/instances/ipv6_reverse.json +15 -0
- data/test/fixtures/instances/iso.json +6 -0
- data/test/fixtures/instances/list.json +44 -0
- data/test/fixtures/instances/list_ipv4.json +32 -0
- data/test/fixtures/instances/list_ipv6.json +17 -0
- data/test/fixtures/instances/list_private_networks.json +16 -0
- data/test/fixtures/instances/neighbors.json +6 -0
- data/test/fixtures/instances/reboot.json +1 -0
- data/test/fixtures/instances/reboot_instances.json +1 -0
- data/test/fixtures/instances/reinstall.json +35 -0
- data/test/fixtures/instances/restore.json +7 -0
- data/test/fixtures/instances/retrieve.json +35 -0
- data/test/fixtures/instances/set_backup_schedule.json +1 -0
- data/test/fixtures/instances/set_default_reverse_dns_entry.json +1 -0
- data/test/fixtures/instances/start.json +1 -0
- data/test/fixtures/instances/start_instances.json +1 -0
- data/test/fixtures/instances/update.json +1 -0
- data/test/fixtures/instances/upgrades.json +55 -0
- data/test/fixtures/instances/user_data.json +5 -0
- data/test/fixtures/isos/create.json +8 -0
- data/test/fixtures/isos/list.json +20 -0
- data/test/fixtures/isos/list_public.json +17 -0
- data/test/fixtures/isos/retrieve.json +11 -0
- data/test/fixtures/kubernetes/config.json +3 -0
- data/test/fixtures/kubernetes/create.json +39 -0
- data/test/fixtures/kubernetes/create_node_pool.json +25 -0
- data/test/fixtures/kubernetes/list.json +85 -0
- data/test/fixtures/kubernetes/list_node_pools.json +56 -0
- data/test/fixtures/kubernetes/list_resources.json +26 -0
- data/test/fixtures/kubernetes/retrieve.json +39 -0
- data/test/fixtures/kubernetes/retrieve_node_pool.json +25 -0
- data/test/fixtures/kubernetes/update_node_pool.json +19 -0
- data/test/fixtures/load_balancers/create.json +48 -0
- data/test/fixtures/load_balancers/create_forwarding_rule.json +1 -0
- data/test/fixtures/load_balancers/delete.json +1 -0
- data/test/fixtures/load_balancers/delete_forwarding_rule.json +1 -0
- data/test/fixtures/load_balancers/list.json +57 -0
- data/test/fixtures/load_balancers/list_firewall_rules.json +17 -0
- data/test/fixtures/load_balancers/list_forwarding_rules.json +18 -0
- data/test/fixtures/load_balancers/retrieve.json +48 -0
- data/test/fixtures/load_balancers/retrieve_firewall_rule.json +8 -0
- data/test/fixtures/load_balancers/retrieve_forwarding_rule.json +9 -0
- data/test/fixtures/load_balancers/update.json +1 -0
- data/test/fixtures/object_storage/create.json +14 -0
- data/test/fixtures/object_storage/delete.json +1 -0
- data/test/fixtures/object_storage/list.json +22 -0
- data/test/fixtures/object_storage/list_clusters.json +17 -0
- data/test/fixtures/object_storage/regenerate_keys.json +7 -0
- data/test/fixtures/object_storage/retrieve.json +13 -0
- data/test/fixtures/object_storage/update.json +1 -0
- data/test/fixtures/operating_systems/list.json +17 -0
- data/test/fixtures/plans/list.json +22 -0
- data/test/fixtures/plans/list_metal.json +24 -0
- data/test/fixtures/private_networks/create.json +10 -0
- data/test/fixtures/private_networks/delete.json +1 -0
- data/test/fixtures/private_networks/list.json +19 -0
- data/test/fixtures/private_networks/retrieve.json +10 -0
- data/test/fixtures/private_networks/update.json +1 -0
- data/test/fixtures/regions/list.json +20 -0
- data/test/fixtures/regions/list_availability.json +24 -0
- data/test/fixtures/reserved_ips/attach.json +1 -0
- data/test/fixtures/reserved_ips/convert.json +11 -0
- data/test/fixtures/reserved_ips/create.json +11 -0
- data/test/fixtures/reserved_ips/delete.json +1 -0
- data/test/fixtures/reserved_ips/detach.json +1 -0
- data/test/fixtures/reserved_ips/list.json +29 -0
- data/test/fixtures/reserved_ips/retrieve.json +11 -0
- data/test/fixtures/snapshots/create.json +11 -0
- data/test/fixtures/snapshots/create_from_url.json +11 -0
- data/test/fixtures/snapshots/delete.json +1 -0
- data/test/fixtures/snapshots/list.json +20 -0
- data/test/fixtures/snapshots/retrieve.json +11 -0
- data/test/fixtures/snapshots/update.json +1 -0
- data/test/fixtures/ssh_keys/create.json +8 -0
- data/test/fixtures/ssh_keys/delete.json +1 -0
- data/test/fixtures/ssh_keys/list.json +17 -0
- data/test/fixtures/ssh_keys/retrieve.json +8 -0
- data/test/fixtures/ssh_keys/update.json +1 -0
- data/test/fixtures/startup_scripts/create.json +10 -0
- data/test/fixtures/startup_scripts/delete.json +1 -0
- data/test/fixtures/startup_scripts/list.json +18 -0
- data/test/fixtures/startup_scripts/retrieve.json +10 -0
- data/test/fixtures/startup_scripts/update.json +1 -0
- data/test/fixtures/users/create.json +9 -0
- data/test/fixtures/users/delete.json +1 -0
- data/test/fixtures/users/list.json +29 -0
- data/test/fixtures/users/retrieve.json +20 -0
- data/test/fixtures/users/update.json +1 -0
- data/test/test_helper.rb +18 -5
- data/test/vultr/client_test.rb +8 -0
- data/test/vultr/object_test.rb +21 -0
- data/test/vultr/resources/account_test.rb +12 -0
- data/test/vultr/resources/applications_test.rb +15 -0
- data/test/vultr/resources/backups_test.rb +24 -0
- data/test/vultr/resources/bare_metal_test.rb +267 -0
- data/test/vultr/resources/block_storage_test.rb +85 -0
- data/test/vultr/resources/dns_test.rb +134 -0
- data/test/vultr/resources/firewall_test.rb +88 -0
- data/test/vultr/resources/instances_test.rb +325 -0
- data/test/vultr/resources/iso_test.rb +58 -0
- data/test/vultr/resources/kubernetes_test.rb +185 -0
- data/test/vultr/resources/load_balancers_test.rb +110 -0
- data/test/vultr/resources/object_storage_test.rb +71 -0
- data/test/vultr/resources/operating_systems_test.rb +15 -0
- data/test/vultr/resources/plans_test.rb +25 -0
- data/test/vultr/resources/private_networks_test.rb +50 -0
- data/test/vultr/resources/regions_test.rb +26 -0
- data/test/vultr/resources/reserved_ips_test.rb +67 -0
- data/test/vultr/resources/snapshots_test.rb +60 -0
- data/test/vultr/resources/ssh_keys_test.rb +50 -0
- data/test/vultr/resources/startup_scripts_test.rb +50 -0
- data/test/vultr/resources/users_test.rb +50 -0
- data/vultr.gemspec +17 -17
- metadata +394 -48
- data/test/vultr/vultr_account_test.rb +0 -29
- data/test/vultr/vultr_app_test.rb +0 -26
- data/test/vultr/vultr_backup_test.rb +0 -22
- data/test/vultr/vultr_iso_test.rb +0 -27
- data/test/vultr/vultr_os_test.rb +0 -21
- data/test/vultr/vultr_plan_test.rb +0 -22
- data/test/vultr/vultr_region_test.rb +0 -33
- data/test/vultr/vultr_snapshot_test.rb +0 -30
- data/test/vultr/vultr_sshkey_test.rb +0 -50
- data/test/vultr/vultr_startupscript_test.rb +0 -53
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class RegionsResourceTest < Minitest::Test
|
6
|
+
def test_list
|
7
|
+
stub = stub_request("regions", response: stub_response(fixture: "regions/list"))
|
8
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
9
|
+
regions = client.regions.list
|
10
|
+
|
11
|
+
assert_equal Vultr::Collection, regions.class
|
12
|
+
assert_equal Vultr::Region, regions.data.first.class
|
13
|
+
assert_equal 1, regions.total
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_list_availability
|
17
|
+
region_id = "all"
|
18
|
+
stub = stub_request("regions/#{region_id}/availability", response: stub_response(fixture: "regions/list_availability"))
|
19
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
20
|
+
availabilities = client.regions.list_availability(region_id: region_id)
|
21
|
+
|
22
|
+
assert_equal Vultr::Object, availabilities.class
|
23
|
+
assert_equal availabilities.available_plans.first, "vc2-1c-1gb"
|
24
|
+
assert_equal availabilities.available_plans.size, 20
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class ReservedIpsResourceTest < Minitest::Test
|
6
|
+
def test_list
|
7
|
+
stub = stub_request("reserved-ips", response: stub_response(fixture: "reserved_ips/list"))
|
8
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
9
|
+
reserved_ips = client.reserved_ips.list
|
10
|
+
|
11
|
+
assert_equal Vultr::Collection, reserved_ips.class
|
12
|
+
assert_equal Vultr::ReservedIp, reserved_ips.data.first.class
|
13
|
+
assert_equal 2, reserved_ips.total
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_create
|
17
|
+
body = {region: "ewr", ip_type: "v4", label: "Example Reserved IPv4"}
|
18
|
+
stub = stub_request("reserved-ips", method: :post, body: body, response: stub_response(fixture: "reserved_ips/create", status: 201))
|
19
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
20
|
+
reserved_ip = client.reserved_ips.create(**body)
|
21
|
+
|
22
|
+
assert_equal Vultr::ReservedIp, reserved_ip.class
|
23
|
+
assert_equal "Example Reserved IPv4", reserved_ip.label
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_retrieve
|
27
|
+
reserved_ip_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
28
|
+
stub = stub_request("reserved-ips/#{reserved_ip_id}", response: stub_response(fixture: "reserved_ips/retrieve"))
|
29
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
30
|
+
reserved_ip = client.reserved_ips.retrieve(reserved_ip: reserved_ip_id)
|
31
|
+
|
32
|
+
assert_equal Vultr::ReservedIp, reserved_ip.class
|
33
|
+
assert_equal "Example Reserved IPv4", reserved_ip.label
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_delete
|
37
|
+
reserved_ip_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
38
|
+
stub = stub_request("reserved-ips/#{reserved_ip_id}", method: :delete, response: stub_response(fixture: "reserved_ips/retrieve"))
|
39
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
40
|
+
assert client.reserved_ips.delete(reserved_ip: reserved_ip_id)
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_attach
|
44
|
+
reserved_ip_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
45
|
+
body = {instance_id: "3f26dfe9-6a18-4f3d-a543-0cbca7a3e496"}
|
46
|
+
stub = stub_request("reserved-ips/#{reserved_ip_id}/attach", method: :post, body: body, response: stub_response(fixture: "reserved_ips/attach"))
|
47
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
48
|
+
assert client.reserved_ips.attach(reserved_ip: reserved_ip_id, instance_id: body[:instance_id])
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_detach
|
52
|
+
reserved_ip_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
53
|
+
stub = stub_request("reserved-ips/#{reserved_ip_id}/detach", method: :post, response: stub_response(fixture: "reserved_ips/attach"))
|
54
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
55
|
+
assert client.reserved_ips.detach(reserved_ip: reserved_ip_id)
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_convert
|
59
|
+
body = {ip_address: "192.0.2.123", label: "Example Reserved IPv4"}
|
60
|
+
stub = stub_request("reserved-ips/convert", method: :post, body: body, response: stub_response(fixture: "reserved_ips/convert", status: 201))
|
61
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
62
|
+
reserved_ip = client.reserved_ips.convert(**body)
|
63
|
+
|
64
|
+
assert Vultr::ReservedIp, reserved_ip.class
|
65
|
+
assert "Example Resreved IPv4", reserved_ip.label
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class SnapshotsResourceTest < Minitest::Test
|
6
|
+
def test_list
|
7
|
+
stub = stub_request("snapshots", response: stub_response(fixture: "snapshots/list"))
|
8
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
9
|
+
snapshots = client.snapshots.list
|
10
|
+
|
11
|
+
assert_equal Vultr::Collection, snapshots.class
|
12
|
+
assert_equal Vultr::Snapshot, snapshots.data.first.class
|
13
|
+
assert_equal 1, snapshots.total
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_create
|
17
|
+
body = {instance_id: "cb676a46-66fd-4dfb-b839-443f2e6c0b60", description: "Example Snapshot"}
|
18
|
+
stub = stub_request("snapshots", method: :post, body: body, response: stub_response(fixture: "snapshots/create", status: 201))
|
19
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
20
|
+
snapshot = client.snapshots.create(**body)
|
21
|
+
|
22
|
+
assert_equal Vultr::Snapshot, snapshot.class
|
23
|
+
assert_equal "Example Snapshot", snapshot.description
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_retrieve
|
27
|
+
snapshot_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
28
|
+
stub = stub_request("snapshots/#{snapshot_id}", response: stub_response(fixture: "snapshots/retrieve"))
|
29
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
30
|
+
snapshot = client.snapshots.retrieve(snapshot_id: snapshot_id)
|
31
|
+
|
32
|
+
assert_equal Vultr::Snapshot, snapshot.class
|
33
|
+
assert_equal "Example Snapshot", snapshot.description
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_create_from_url
|
37
|
+
body = {url: "http://example.com/disk_image.raw"}
|
38
|
+
stub = stub_request("snapshots/create-from-url", method: :post, body: body, response: stub_response(fixture: "snapshots/create_from_url"))
|
39
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
40
|
+
snapshot = client.snapshots.create_from_url(body[:url])
|
41
|
+
|
42
|
+
assert_equal Vultr::Snapshot, snapshot.class
|
43
|
+
assert_equal "Example Snapshot", snapshot.description
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_update
|
47
|
+
snapshot_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
48
|
+
body = {description: "Changed"}
|
49
|
+
stub = stub_request("snapshots/#{snapshot_id}", method: :put, body: body, response: stub_response(fixture: "snapshots/update"))
|
50
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
51
|
+
assert client.snapshots.update(snapshot_id: snapshot_id, **body)
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_delete
|
55
|
+
snapshot_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
56
|
+
stub = stub_request("snapshots/#{snapshot_id}", method: :delete, response: stub_response(fixture: "snapshots/delete"))
|
57
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
58
|
+
assert client.snapshots.delete(snapshot_id: snapshot_id)
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class SshKeysResourceTest < Minitest::Test
|
6
|
+
def test_list
|
7
|
+
stub = stub_request("ssh-keys", response: stub_response(fixture: "ssh_keys/list"))
|
8
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
9
|
+
ssh_keys = client.ssh_keys.list
|
10
|
+
|
11
|
+
assert_equal Vultr::Collection, ssh_keys.class
|
12
|
+
assert_equal Vultr::SshKey, ssh_keys.data.first.class
|
13
|
+
assert_equal 1, ssh_keys.total
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_create
|
17
|
+
body = {name: "Example SSH Key", ssh_key: "ssh-rsa AA... user@example.com"}
|
18
|
+
stub = stub_request("ssh-keys", method: :post, body: body, response: stub_response(fixture: "ssh_keys/create", status: 201))
|
19
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
20
|
+
ssh_key = client.ssh_keys.create(**body)
|
21
|
+
|
22
|
+
assert_equal Vultr::SshKey, ssh_key.class
|
23
|
+
assert_equal "Example SSH Key", ssh_key.name
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_restrieve
|
27
|
+
ssh_key_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
28
|
+
stub = stub_request("ssh-keys/#{ssh_key_id}", response: stub_response(fixture: "ssh_keys/retrieve"))
|
29
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
30
|
+
ssh_key = client.ssh_keys.retrieve(ssh_key_id: ssh_key_id)
|
31
|
+
|
32
|
+
assert_equal Vultr::SshKey, ssh_key.class
|
33
|
+
assert_equal "Example SSH Key", ssh_key.name
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_update
|
37
|
+
ssh_key_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
38
|
+
body = {name: "Changed"}
|
39
|
+
stub = stub_request("ssh-keys/#{ssh_key_id}", method: :patch, body: body, response: stub_response(fixture: "ssh_keys/update"))
|
40
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
41
|
+
assert client.ssh_keys.update(ssh_key_id: ssh_key_id, **body)
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_delete
|
45
|
+
ssh_key_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
46
|
+
stub = stub_request("ssh-keys/#{ssh_key_id}", method: :delete, response: stub_response(fixture: "ssh_keys/delete"))
|
47
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
48
|
+
assert client.ssh_keys.delete(ssh_key_id: ssh_key_id)
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class StartupScriptsResourceTest < Minitest::Test
|
6
|
+
def test_list
|
7
|
+
stub = stub_request("startup-scripts", response: stub_response(fixture: "startup_scripts/list"))
|
8
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
9
|
+
startup_scripts = client.startup_scripts.list
|
10
|
+
|
11
|
+
assert_equal Vultr::Collection, startup_scripts.class
|
12
|
+
assert_equal Vultr::StartupScript, startup_scripts.data.first.class
|
13
|
+
assert_equal 1, startup_scripts.total
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_create
|
17
|
+
body = {name: "Example Startup Script", type: "pxe", script: "QmFzZTY0IEV4YW1wbGUgRGF0YQ=="}
|
18
|
+
stub = stub_request("startup-scripts", method: :post, body: body, response: stub_response(fixture: "startup_scripts/create", status: 201))
|
19
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
20
|
+
startup_script = client.startup_scripts.create(**body)
|
21
|
+
|
22
|
+
assert_equal Vultr::StartupScript, startup_script.class
|
23
|
+
assert_equal "Example Startup Script", startup_script.name
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_restrieve
|
27
|
+
startup_script_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
28
|
+
stub = stub_request("startup-scripts/#{startup_script_id}", response: stub_response(fixture: "startup_scripts/retrieve"))
|
29
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
30
|
+
startup_script = client.startup_scripts.retrieve(startup_script_id: startup_script_id)
|
31
|
+
|
32
|
+
assert_equal Vultr::StartupScript, startup_script.class
|
33
|
+
assert_equal "Example Startup Script", startup_script.name
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_update
|
37
|
+
startup_script_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
38
|
+
body = {name: "Changed"}
|
39
|
+
stub = stub_request("startup-scripts/#{startup_script_id}", method: :patch, body: body, response: stub_response(fixture: "startup_scripts/update"))
|
40
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
41
|
+
assert client.startup_scripts.update(startup_script_id: startup_script_id, **body)
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_delete
|
45
|
+
startup_script_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
46
|
+
stub = stub_request("startup-scripts/#{startup_script_id}", method: :delete, response: stub_response(fixture: "startup_scripts/delete"))
|
47
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
48
|
+
assert client.startup_scripts.delete(startup_script_id: startup_script_id)
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "test_helper"
|
4
|
+
|
5
|
+
class UsersResourceTest < Minitest::Test
|
6
|
+
def test_list
|
7
|
+
stub = stub_request("users", response: stub_response(fixture: "users/list"))
|
8
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
9
|
+
users = client.users.list
|
10
|
+
|
11
|
+
assert_equal Vultr::Collection, users.class
|
12
|
+
assert_equal Vultr::User, users.data.first.class
|
13
|
+
assert_equal 1, users.total
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_create
|
17
|
+
body = {name: "Test user", email: "user@example.com", password: "password"}
|
18
|
+
stub = stub_request("users", method: :post, body: body, response: stub_response(fixture: "users/create", status: 201))
|
19
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
20
|
+
user = client.users.create(**body)
|
21
|
+
|
22
|
+
assert_equal Vultr::User, user.class
|
23
|
+
assert_equal "user@example.com", user.email
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_retrieve
|
27
|
+
user_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
28
|
+
stub = stub_request("users/#{user_id}", response: stub_response(fixture: "users/retrieve"))
|
29
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
30
|
+
user = client.users.retrieve(user_id: user_id)
|
31
|
+
|
32
|
+
assert_equal Vultr::User, user.class
|
33
|
+
assert_equal "user@example.com", user.email
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_update
|
37
|
+
user_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
38
|
+
body = {name: "Changed"}
|
39
|
+
stub = stub_request("users/#{user_id}", method: :patch, body: body, response: stub_response(fixture: "users/update"))
|
40
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
41
|
+
assert client.users.update(user_id: user_id, **body)
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_delete
|
45
|
+
user_id = "cb676a46-66fd-4dfb-b839-443f2e6c0b60"
|
46
|
+
stub = stub_request("users/#{user_id}", method: :delete, response: stub_response(fixture: "users/delete"))
|
47
|
+
client = Vultr::Client.new(api_key: "fake", adapter: :test, stubs: stub)
|
48
|
+
assert client.users.delete(user_id: user_id)
|
49
|
+
end
|
50
|
+
end
|
data/vultr.gemspec
CHANGED
@@ -1,26 +1,26 @@
|
|
1
1
|
# Run `rake vultr.gemspec` to update the gemspec.
|
2
2
|
|
3
|
-
lib = File.expand_path(
|
3
|
+
lib = File.expand_path("../lib", __FILE__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require
|
5
|
+
require "vultr/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
|
-
s.name
|
9
|
-
s.version
|
10
|
-
s.authors
|
11
|
-
s.email
|
12
|
-
s.summary
|
13
|
-
s.description
|
14
|
-
s.homepage
|
15
|
-
s.license
|
8
|
+
s.name = "vultr"
|
9
|
+
s.version = Vultr::VERSION
|
10
|
+
s.authors = ["Gao Jiangmiao"]
|
11
|
+
s.email = ["tolbkni@gmail.com"]
|
12
|
+
s.summary = "Ruby bindings for VULTR API."
|
13
|
+
s.description = "Ruby bindings for VULTR API. VULTR APIs can be found here: https://www.vultr.com/api/"
|
14
|
+
s.homepage = "https://github.com/tolbkni/vultr.rb"
|
15
|
+
s.license = "MIT"
|
16
16
|
|
17
|
-
s.files
|
18
|
-
s.executables
|
19
|
-
s.test_files
|
20
|
-
s.require_paths = [
|
17
|
+
s.files = `git ls-files -z`.split("\x0")
|
18
|
+
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
20
|
+
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.required_ruby_version =
|
22
|
+
s.required_ruby_version = ">= 2.4"
|
23
23
|
|
24
|
-
s.add_dependency
|
25
|
-
s.add_dependency
|
24
|
+
s.add_dependency "faraday", "~> 1.7"
|
25
|
+
s.add_dependency "faraday_middleware", "~> 1.1"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,62 +1,54 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vultr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gao Jiangmiao
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '1.0'
|
19
|
+
version: '1.7'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.12.0
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '1.
|
26
|
+
version: '1.7'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: faraday_middleware
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
31
|
+
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
40
|
-
- - "<"
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
version: '1.0'
|
33
|
+
version: '1.1'
|
43
34
|
type: :runtime
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
46
37
|
requirements:
|
47
|
-
- - "
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 0.12.0
|
50
|
-
- - "<"
|
38
|
+
- - "~>"
|
51
39
|
- !ruby/object:Gem::Version
|
52
|
-
version: '1.
|
40
|
+
version: '1.1'
|
53
41
|
description: 'Ruby bindings for VULTR API. VULTR APIs can be found here: https://www.vultr.com/api/'
|
54
42
|
email:
|
55
43
|
- tolbkni@gmail.com
|
56
|
-
executables:
|
44
|
+
executables:
|
45
|
+
- console
|
46
|
+
- setup
|
47
|
+
- test
|
57
48
|
extensions: []
|
58
49
|
extra_rdoc_files: []
|
59
50
|
files:
|
51
|
+
- ".github/workflows/ci.yml"
|
60
52
|
- ".gitignore"
|
61
53
|
- ".travis.yml"
|
62
54
|
- CHANGELOG.md
|
@@ -64,25 +56,227 @@ files:
|
|
64
56
|
- LICENSE.txt
|
65
57
|
- README.md
|
66
58
|
- Rakefile
|
59
|
+
- bin/console
|
60
|
+
- bin/setup
|
61
|
+
- bin/test
|
67
62
|
- lib/vultr.rb
|
63
|
+
- lib/vultr/client.rb
|
64
|
+
- lib/vultr/collection.rb
|
65
|
+
- lib/vultr/error.rb
|
66
|
+
- lib/vultr/object.rb
|
67
|
+
- lib/vultr/objects/account.rb
|
68
|
+
- lib/vultr/objects/application.rb
|
69
|
+
- lib/vultr/objects/backup.rb
|
70
|
+
- lib/vultr/objects/bare_metal.rb
|
71
|
+
- lib/vultr/objects/block_storage.rb
|
72
|
+
- lib/vultr/objects/domain.rb
|
73
|
+
- lib/vultr/objects/firewall_group.rb
|
74
|
+
- lib/vultr/objects/instance.rb
|
75
|
+
- lib/vultr/objects/iso.rb
|
76
|
+
- lib/vultr/objects/kubernetes_cluster.rb
|
77
|
+
- lib/vultr/objects/load_balancer.rb
|
78
|
+
- lib/vultr/objects/object_storage.rb
|
79
|
+
- lib/vultr/objects/operating_system.rb
|
80
|
+
- lib/vultr/objects/plan.rb
|
81
|
+
- lib/vultr/objects/private_network.rb
|
82
|
+
- lib/vultr/objects/region.rb
|
83
|
+
- lib/vultr/objects/reserved_ip.rb
|
84
|
+
- lib/vultr/objects/snapshot.rb
|
85
|
+
- lib/vultr/objects/ssh_key.rb
|
86
|
+
- lib/vultr/objects/startup_script.rb
|
87
|
+
- lib/vultr/objects/user.rb
|
88
|
+
- lib/vultr/resource.rb
|
89
|
+
- lib/vultr/resources/account.rb
|
90
|
+
- lib/vultr/resources/applications.rb
|
91
|
+
- lib/vultr/resources/backups.rb
|
92
|
+
- lib/vultr/resources/bare_metal.rb
|
93
|
+
- lib/vultr/resources/block_storage.rb
|
94
|
+
- lib/vultr/resources/dns.rb
|
95
|
+
- lib/vultr/resources/firewall.rb
|
96
|
+
- lib/vultr/resources/instances.rb
|
97
|
+
- lib/vultr/resources/iso.rb
|
98
|
+
- lib/vultr/resources/kubernetes.rb
|
99
|
+
- lib/vultr/resources/load_balancers.rb
|
100
|
+
- lib/vultr/resources/object_storage.rb
|
101
|
+
- lib/vultr/resources/operating_systems.rb
|
102
|
+
- lib/vultr/resources/plans.rb
|
103
|
+
- lib/vultr/resources/private_networks.rb
|
104
|
+
- lib/vultr/resources/regions.rb
|
105
|
+
- lib/vultr/resources/reserved_ips.rb
|
106
|
+
- lib/vultr/resources/snapshots.rb
|
107
|
+
- lib/vultr/resources/ssh_keys.rb
|
108
|
+
- lib/vultr/resources/startup_scripts.rb
|
109
|
+
- lib/vultr/resources/users.rb
|
68
110
|
- lib/vultr/version.rb
|
111
|
+
- test/fixtures/account/info.json
|
112
|
+
- test/fixtures/applications/list.json
|
113
|
+
- test/fixtures/backups/list.json
|
114
|
+
- test/fixtures/backups/retrieve.json
|
115
|
+
- test/fixtures/bare_metals/bandwidth.json
|
116
|
+
- test/fixtures/bare_metals/create.json
|
117
|
+
- test/fixtures/bare_metals/list.json
|
118
|
+
- test/fixtures/bare_metals/list_ipv4.json
|
119
|
+
- test/fixtures/bare_metals/list_ipv6.json
|
120
|
+
- test/fixtures/bare_metals/reinstall.json
|
121
|
+
- test/fixtures/bare_metals/retrieve.json
|
122
|
+
- test/fixtures/bare_metals/update.json
|
123
|
+
- test/fixtures/bare_metals/upgrades.json
|
124
|
+
- test/fixtures/bare_metals/user_data.json
|
125
|
+
- test/fixtures/bare_metals/vnc.json
|
126
|
+
- test/fixtures/block_storage/attach.json
|
127
|
+
- test/fixtures/block_storage/create.json
|
128
|
+
- test/fixtures/block_storage/detach.json
|
129
|
+
- test/fixtures/block_storage/list.json
|
130
|
+
- test/fixtures/block_storage/retrieve.json
|
131
|
+
- test/fixtures/domains/create.json
|
132
|
+
- test/fixtures/domains/dnssec.json
|
133
|
+
- test/fixtures/domains/list.json
|
134
|
+
- test/fixtures/domains/record.json
|
135
|
+
- test/fixtures/domains/records.json
|
136
|
+
- test/fixtures/domains/retrieve.json
|
137
|
+
- test/fixtures/domains/soa.json
|
138
|
+
- test/fixtures/firewall/create.json
|
139
|
+
- test/fixtures/firewall/create_rule.json
|
140
|
+
- test/fixtures/firewall/delete.json
|
141
|
+
- test/fixtures/firewall/delete_rule.json
|
142
|
+
- test/fixtures/firewall/list.json
|
143
|
+
- test/fixtures/firewall/list_rules.json
|
144
|
+
- test/fixtures/firewall/retrieve.json
|
145
|
+
- test/fixtures/firewall/retrieve_rule.json
|
146
|
+
- test/fixtures/firewall/update.json
|
147
|
+
- test/fixtures/instances/attach_iso.json
|
148
|
+
- test/fixtures/instances/attach_private_network.json
|
149
|
+
- test/fixtures/instances/backup_schedule.json
|
150
|
+
- test/fixtures/instances/bandwidth.json
|
151
|
+
- test/fixtures/instances/create.json
|
152
|
+
- test/fixtures/instances/create_ipv4_reverse.json
|
153
|
+
- test/fixtures/instances/create_ipv6_reverse.json
|
154
|
+
- test/fixtures/instances/delete.json
|
155
|
+
- test/fixtures/instances/delete_ipv4.json
|
156
|
+
- test/fixtures/instances/delete_ipv6.json
|
157
|
+
- test/fixtures/instances/detach_iso.json
|
158
|
+
- test/fixtures/instances/detach_private_network.json
|
159
|
+
- test/fixtures/instances/halt.json
|
160
|
+
- test/fixtures/instances/halt_instances.json
|
161
|
+
- test/fixtures/instances/ipv4.json
|
162
|
+
- test/fixtures/instances/ipv6_reverse.json
|
163
|
+
- test/fixtures/instances/iso.json
|
164
|
+
- test/fixtures/instances/list.json
|
165
|
+
- test/fixtures/instances/list_ipv4.json
|
166
|
+
- test/fixtures/instances/list_ipv6.json
|
167
|
+
- test/fixtures/instances/list_private_networks.json
|
168
|
+
- test/fixtures/instances/neighbors.json
|
169
|
+
- test/fixtures/instances/reboot.json
|
170
|
+
- test/fixtures/instances/reboot_instances.json
|
171
|
+
- test/fixtures/instances/reinstall.json
|
172
|
+
- test/fixtures/instances/restore.json
|
173
|
+
- test/fixtures/instances/retrieve.json
|
174
|
+
- test/fixtures/instances/set_backup_schedule.json
|
175
|
+
- test/fixtures/instances/set_default_reverse_dns_entry.json
|
176
|
+
- test/fixtures/instances/start.json
|
177
|
+
- test/fixtures/instances/start_instances.json
|
178
|
+
- test/fixtures/instances/update.json
|
179
|
+
- test/fixtures/instances/upgrades.json
|
180
|
+
- test/fixtures/instances/user_data.json
|
181
|
+
- test/fixtures/isos/create.json
|
182
|
+
- test/fixtures/isos/list.json
|
183
|
+
- test/fixtures/isos/list_public.json
|
184
|
+
- test/fixtures/isos/retrieve.json
|
185
|
+
- test/fixtures/kubernetes/config.json
|
186
|
+
- test/fixtures/kubernetes/create.json
|
187
|
+
- test/fixtures/kubernetes/create_node_pool.json
|
188
|
+
- test/fixtures/kubernetes/list.json
|
189
|
+
- test/fixtures/kubernetes/list_node_pools.json
|
190
|
+
- test/fixtures/kubernetes/list_resources.json
|
191
|
+
- test/fixtures/kubernetes/retrieve.json
|
192
|
+
- test/fixtures/kubernetes/retrieve_node_pool.json
|
193
|
+
- test/fixtures/kubernetes/update_node_pool.json
|
194
|
+
- test/fixtures/load_balancers/create.json
|
195
|
+
- test/fixtures/load_balancers/create_forwarding_rule.json
|
196
|
+
- test/fixtures/load_balancers/delete.json
|
197
|
+
- test/fixtures/load_balancers/delete_forwarding_rule.json
|
198
|
+
- test/fixtures/load_balancers/list.json
|
199
|
+
- test/fixtures/load_balancers/list_firewall_rules.json
|
200
|
+
- test/fixtures/load_balancers/list_forwarding_rules.json
|
201
|
+
- test/fixtures/load_balancers/retrieve.json
|
202
|
+
- test/fixtures/load_balancers/retrieve_firewall_rule.json
|
203
|
+
- test/fixtures/load_balancers/retrieve_forwarding_rule.json
|
204
|
+
- test/fixtures/load_balancers/update.json
|
205
|
+
- test/fixtures/object_storage/create.json
|
206
|
+
- test/fixtures/object_storage/delete.json
|
207
|
+
- test/fixtures/object_storage/list.json
|
208
|
+
- test/fixtures/object_storage/list_clusters.json
|
209
|
+
- test/fixtures/object_storage/regenerate_keys.json
|
210
|
+
- test/fixtures/object_storage/retrieve.json
|
211
|
+
- test/fixtures/object_storage/update.json
|
212
|
+
- test/fixtures/operating_systems/list.json
|
213
|
+
- test/fixtures/plans/list.json
|
214
|
+
- test/fixtures/plans/list_metal.json
|
215
|
+
- test/fixtures/private_networks/create.json
|
216
|
+
- test/fixtures/private_networks/delete.json
|
217
|
+
- test/fixtures/private_networks/list.json
|
218
|
+
- test/fixtures/private_networks/retrieve.json
|
219
|
+
- test/fixtures/private_networks/update.json
|
220
|
+
- test/fixtures/regions/list.json
|
221
|
+
- test/fixtures/regions/list_availability.json
|
222
|
+
- test/fixtures/reserved_ips/attach.json
|
223
|
+
- test/fixtures/reserved_ips/convert.json
|
224
|
+
- test/fixtures/reserved_ips/create.json
|
225
|
+
- test/fixtures/reserved_ips/delete.json
|
226
|
+
- test/fixtures/reserved_ips/detach.json
|
227
|
+
- test/fixtures/reserved_ips/list.json
|
228
|
+
- test/fixtures/reserved_ips/retrieve.json
|
229
|
+
- test/fixtures/snapshots/create.json
|
230
|
+
- test/fixtures/snapshots/create_from_url.json
|
231
|
+
- test/fixtures/snapshots/delete.json
|
232
|
+
- test/fixtures/snapshots/list.json
|
233
|
+
- test/fixtures/snapshots/retrieve.json
|
234
|
+
- test/fixtures/snapshots/update.json
|
235
|
+
- test/fixtures/ssh_keys/create.json
|
236
|
+
- test/fixtures/ssh_keys/delete.json
|
237
|
+
- test/fixtures/ssh_keys/list.json
|
238
|
+
- test/fixtures/ssh_keys/retrieve.json
|
239
|
+
- test/fixtures/ssh_keys/update.json
|
240
|
+
- test/fixtures/startup_scripts/create.json
|
241
|
+
- test/fixtures/startup_scripts/delete.json
|
242
|
+
- test/fixtures/startup_scripts/list.json
|
243
|
+
- test/fixtures/startup_scripts/retrieve.json
|
244
|
+
- test/fixtures/startup_scripts/update.json
|
245
|
+
- test/fixtures/users/create.json
|
246
|
+
- test/fixtures/users/delete.json
|
247
|
+
- test/fixtures/users/list.json
|
248
|
+
- test/fixtures/users/retrieve.json
|
249
|
+
- test/fixtures/users/update.json
|
69
250
|
- test/test_helper.rb
|
70
|
-
- test/vultr/
|
71
|
-
- test/vultr/
|
72
|
-
- test/vultr/
|
73
|
-
- test/vultr/
|
74
|
-
- test/vultr/
|
75
|
-
- test/vultr/
|
76
|
-
- test/vultr/
|
77
|
-
- test/vultr/
|
78
|
-
- test/vultr/
|
79
|
-
- test/vultr/
|
251
|
+
- test/vultr/client_test.rb
|
252
|
+
- test/vultr/object_test.rb
|
253
|
+
- test/vultr/resources/account_test.rb
|
254
|
+
- test/vultr/resources/applications_test.rb
|
255
|
+
- test/vultr/resources/backups_test.rb
|
256
|
+
- test/vultr/resources/bare_metal_test.rb
|
257
|
+
- test/vultr/resources/block_storage_test.rb
|
258
|
+
- test/vultr/resources/dns_test.rb
|
259
|
+
- test/vultr/resources/firewall_test.rb
|
260
|
+
- test/vultr/resources/instances_test.rb
|
261
|
+
- test/vultr/resources/iso_test.rb
|
262
|
+
- test/vultr/resources/kubernetes_test.rb
|
263
|
+
- test/vultr/resources/load_balancers_test.rb
|
264
|
+
- test/vultr/resources/object_storage_test.rb
|
265
|
+
- test/vultr/resources/operating_systems_test.rb
|
266
|
+
- test/vultr/resources/plans_test.rb
|
267
|
+
- test/vultr/resources/private_networks_test.rb
|
268
|
+
- test/vultr/resources/regions_test.rb
|
269
|
+
- test/vultr/resources/reserved_ips_test.rb
|
270
|
+
- test/vultr/resources/snapshots_test.rb
|
271
|
+
- test/vultr/resources/ssh_keys_test.rb
|
272
|
+
- test/vultr/resources/startup_scripts_test.rb
|
273
|
+
- test/vultr/resources/users_test.rb
|
80
274
|
- vultr.gemspec
|
81
275
|
homepage: https://github.com/tolbkni/vultr.rb
|
82
276
|
licenses:
|
83
277
|
- MIT
|
84
278
|
metadata: {}
|
85
|
-
post_install_message:
|
279
|
+
post_install_message:
|
86
280
|
rdoc_options: []
|
87
281
|
require_paths:
|
88
282
|
- lib
|
@@ -90,26 +284,178 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
284
|
requirements:
|
91
285
|
- - ">="
|
92
286
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
287
|
+
version: '2.4'
|
94
288
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
289
|
requirements:
|
96
290
|
- - ">="
|
97
291
|
- !ruby/object:Gem::Version
|
98
292
|
version: '0'
|
99
293
|
requirements: []
|
100
|
-
rubygems_version: 3.
|
101
|
-
signing_key:
|
294
|
+
rubygems_version: 3.2.22
|
295
|
+
signing_key:
|
102
296
|
specification_version: 4
|
103
297
|
summary: Ruby bindings for VULTR API.
|
104
298
|
test_files:
|
299
|
+
- test/fixtures/account/info.json
|
300
|
+
- test/fixtures/applications/list.json
|
301
|
+
- test/fixtures/backups/list.json
|
302
|
+
- test/fixtures/backups/retrieve.json
|
303
|
+
- test/fixtures/bare_metals/bandwidth.json
|
304
|
+
- test/fixtures/bare_metals/create.json
|
305
|
+
- test/fixtures/bare_metals/list.json
|
306
|
+
- test/fixtures/bare_metals/list_ipv4.json
|
307
|
+
- test/fixtures/bare_metals/list_ipv6.json
|
308
|
+
- test/fixtures/bare_metals/reinstall.json
|
309
|
+
- test/fixtures/bare_metals/retrieve.json
|
310
|
+
- test/fixtures/bare_metals/update.json
|
311
|
+
- test/fixtures/bare_metals/upgrades.json
|
312
|
+
- test/fixtures/bare_metals/user_data.json
|
313
|
+
- test/fixtures/bare_metals/vnc.json
|
314
|
+
- test/fixtures/block_storage/attach.json
|
315
|
+
- test/fixtures/block_storage/create.json
|
316
|
+
- test/fixtures/block_storage/detach.json
|
317
|
+
- test/fixtures/block_storage/list.json
|
318
|
+
- test/fixtures/block_storage/retrieve.json
|
319
|
+
- test/fixtures/domains/create.json
|
320
|
+
- test/fixtures/domains/dnssec.json
|
321
|
+
- test/fixtures/domains/list.json
|
322
|
+
- test/fixtures/domains/record.json
|
323
|
+
- test/fixtures/domains/records.json
|
324
|
+
- test/fixtures/domains/retrieve.json
|
325
|
+
- test/fixtures/domains/soa.json
|
326
|
+
- test/fixtures/firewall/create.json
|
327
|
+
- test/fixtures/firewall/create_rule.json
|
328
|
+
- test/fixtures/firewall/delete.json
|
329
|
+
- test/fixtures/firewall/delete_rule.json
|
330
|
+
- test/fixtures/firewall/list.json
|
331
|
+
- test/fixtures/firewall/list_rules.json
|
332
|
+
- test/fixtures/firewall/retrieve.json
|
333
|
+
- test/fixtures/firewall/retrieve_rule.json
|
334
|
+
- test/fixtures/firewall/update.json
|
335
|
+
- test/fixtures/instances/attach_iso.json
|
336
|
+
- test/fixtures/instances/attach_private_network.json
|
337
|
+
- test/fixtures/instances/backup_schedule.json
|
338
|
+
- test/fixtures/instances/bandwidth.json
|
339
|
+
- test/fixtures/instances/create.json
|
340
|
+
- test/fixtures/instances/create_ipv4_reverse.json
|
341
|
+
- test/fixtures/instances/create_ipv6_reverse.json
|
342
|
+
- test/fixtures/instances/delete.json
|
343
|
+
- test/fixtures/instances/delete_ipv4.json
|
344
|
+
- test/fixtures/instances/delete_ipv6.json
|
345
|
+
- test/fixtures/instances/detach_iso.json
|
346
|
+
- test/fixtures/instances/detach_private_network.json
|
347
|
+
- test/fixtures/instances/halt.json
|
348
|
+
- test/fixtures/instances/halt_instances.json
|
349
|
+
- test/fixtures/instances/ipv4.json
|
350
|
+
- test/fixtures/instances/ipv6_reverse.json
|
351
|
+
- test/fixtures/instances/iso.json
|
352
|
+
- test/fixtures/instances/list.json
|
353
|
+
- test/fixtures/instances/list_ipv4.json
|
354
|
+
- test/fixtures/instances/list_ipv6.json
|
355
|
+
- test/fixtures/instances/list_private_networks.json
|
356
|
+
- test/fixtures/instances/neighbors.json
|
357
|
+
- test/fixtures/instances/reboot.json
|
358
|
+
- test/fixtures/instances/reboot_instances.json
|
359
|
+
- test/fixtures/instances/reinstall.json
|
360
|
+
- test/fixtures/instances/restore.json
|
361
|
+
- test/fixtures/instances/retrieve.json
|
362
|
+
- test/fixtures/instances/set_backup_schedule.json
|
363
|
+
- test/fixtures/instances/set_default_reverse_dns_entry.json
|
364
|
+
- test/fixtures/instances/start.json
|
365
|
+
- test/fixtures/instances/start_instances.json
|
366
|
+
- test/fixtures/instances/update.json
|
367
|
+
- test/fixtures/instances/upgrades.json
|
368
|
+
- test/fixtures/instances/user_data.json
|
369
|
+
- test/fixtures/isos/create.json
|
370
|
+
- test/fixtures/isos/list.json
|
371
|
+
- test/fixtures/isos/list_public.json
|
372
|
+
- test/fixtures/isos/retrieve.json
|
373
|
+
- test/fixtures/kubernetes/config.json
|
374
|
+
- test/fixtures/kubernetes/create.json
|
375
|
+
- test/fixtures/kubernetes/create_node_pool.json
|
376
|
+
- test/fixtures/kubernetes/list.json
|
377
|
+
- test/fixtures/kubernetes/list_node_pools.json
|
378
|
+
- test/fixtures/kubernetes/list_resources.json
|
379
|
+
- test/fixtures/kubernetes/retrieve.json
|
380
|
+
- test/fixtures/kubernetes/retrieve_node_pool.json
|
381
|
+
- test/fixtures/kubernetes/update_node_pool.json
|
382
|
+
- test/fixtures/load_balancers/create.json
|
383
|
+
- test/fixtures/load_balancers/create_forwarding_rule.json
|
384
|
+
- test/fixtures/load_balancers/delete.json
|
385
|
+
- test/fixtures/load_balancers/delete_forwarding_rule.json
|
386
|
+
- test/fixtures/load_balancers/list.json
|
387
|
+
- test/fixtures/load_balancers/list_firewall_rules.json
|
388
|
+
- test/fixtures/load_balancers/list_forwarding_rules.json
|
389
|
+
- test/fixtures/load_balancers/retrieve.json
|
390
|
+
- test/fixtures/load_balancers/retrieve_firewall_rule.json
|
391
|
+
- test/fixtures/load_balancers/retrieve_forwarding_rule.json
|
392
|
+
- test/fixtures/load_balancers/update.json
|
393
|
+
- test/fixtures/object_storage/create.json
|
394
|
+
- test/fixtures/object_storage/delete.json
|
395
|
+
- test/fixtures/object_storage/list.json
|
396
|
+
- test/fixtures/object_storage/list_clusters.json
|
397
|
+
- test/fixtures/object_storage/regenerate_keys.json
|
398
|
+
- test/fixtures/object_storage/retrieve.json
|
399
|
+
- test/fixtures/object_storage/update.json
|
400
|
+
- test/fixtures/operating_systems/list.json
|
401
|
+
- test/fixtures/plans/list.json
|
402
|
+
- test/fixtures/plans/list_metal.json
|
403
|
+
- test/fixtures/private_networks/create.json
|
404
|
+
- test/fixtures/private_networks/delete.json
|
405
|
+
- test/fixtures/private_networks/list.json
|
406
|
+
- test/fixtures/private_networks/retrieve.json
|
407
|
+
- test/fixtures/private_networks/update.json
|
408
|
+
- test/fixtures/regions/list.json
|
409
|
+
- test/fixtures/regions/list_availability.json
|
410
|
+
- test/fixtures/reserved_ips/attach.json
|
411
|
+
- test/fixtures/reserved_ips/convert.json
|
412
|
+
- test/fixtures/reserved_ips/create.json
|
413
|
+
- test/fixtures/reserved_ips/delete.json
|
414
|
+
- test/fixtures/reserved_ips/detach.json
|
415
|
+
- test/fixtures/reserved_ips/list.json
|
416
|
+
- test/fixtures/reserved_ips/retrieve.json
|
417
|
+
- test/fixtures/snapshots/create.json
|
418
|
+
- test/fixtures/snapshots/create_from_url.json
|
419
|
+
- test/fixtures/snapshots/delete.json
|
420
|
+
- test/fixtures/snapshots/list.json
|
421
|
+
- test/fixtures/snapshots/retrieve.json
|
422
|
+
- test/fixtures/snapshots/update.json
|
423
|
+
- test/fixtures/ssh_keys/create.json
|
424
|
+
- test/fixtures/ssh_keys/delete.json
|
425
|
+
- test/fixtures/ssh_keys/list.json
|
426
|
+
- test/fixtures/ssh_keys/retrieve.json
|
427
|
+
- test/fixtures/ssh_keys/update.json
|
428
|
+
- test/fixtures/startup_scripts/create.json
|
429
|
+
- test/fixtures/startup_scripts/delete.json
|
430
|
+
- test/fixtures/startup_scripts/list.json
|
431
|
+
- test/fixtures/startup_scripts/retrieve.json
|
432
|
+
- test/fixtures/startup_scripts/update.json
|
433
|
+
- test/fixtures/users/create.json
|
434
|
+
- test/fixtures/users/delete.json
|
435
|
+
- test/fixtures/users/list.json
|
436
|
+
- test/fixtures/users/retrieve.json
|
437
|
+
- test/fixtures/users/update.json
|
105
438
|
- test/test_helper.rb
|
106
|
-
- test/vultr/
|
107
|
-
- test/vultr/
|
108
|
-
- test/vultr/
|
109
|
-
- test/vultr/
|
110
|
-
- test/vultr/
|
111
|
-
- test/vultr/
|
112
|
-
- test/vultr/
|
113
|
-
- test/vultr/
|
114
|
-
- test/vultr/
|
115
|
-
- test/vultr/
|
439
|
+
- test/vultr/client_test.rb
|
440
|
+
- test/vultr/object_test.rb
|
441
|
+
- test/vultr/resources/account_test.rb
|
442
|
+
- test/vultr/resources/applications_test.rb
|
443
|
+
- test/vultr/resources/backups_test.rb
|
444
|
+
- test/vultr/resources/bare_metal_test.rb
|
445
|
+
- test/vultr/resources/block_storage_test.rb
|
446
|
+
- test/vultr/resources/dns_test.rb
|
447
|
+
- test/vultr/resources/firewall_test.rb
|
448
|
+
- test/vultr/resources/instances_test.rb
|
449
|
+
- test/vultr/resources/iso_test.rb
|
450
|
+
- test/vultr/resources/kubernetes_test.rb
|
451
|
+
- test/vultr/resources/load_balancers_test.rb
|
452
|
+
- test/vultr/resources/object_storage_test.rb
|
453
|
+
- test/vultr/resources/operating_systems_test.rb
|
454
|
+
- test/vultr/resources/plans_test.rb
|
455
|
+
- test/vultr/resources/private_networks_test.rb
|
456
|
+
- test/vultr/resources/regions_test.rb
|
457
|
+
- test/vultr/resources/reserved_ips_test.rb
|
458
|
+
- test/vultr/resources/snapshots_test.rb
|
459
|
+
- test/vultr/resources/ssh_keys_test.rb
|
460
|
+
- test/vultr/resources/startup_scripts_test.rb
|
461
|
+
- test/vultr/resources/users_test.rb
|