vultr 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/vultr/collection.rb +2 -1
- data/lib/vultr/version.rb +1 -1
- metadata +17 -183
- data/.github/workflows/ci.yml +0 -38
- data/.gitignore +0 -23
- data/.standard.yml +0 -1
- data/Appraisals +0 -8
- data/Gemfile +0 -8
- data/Rakefile +0 -14
- data/bin/console +0 -21
- data/bin/setup +0 -8
- data/bin/test +0 -6
- data/gemfiles/faraday_1.gemfile +0 -12
- data/gemfiles/faraday_1.gemfile.lock +0 -104
- data/gemfiles/faraday_2.gemfile +0 -11
- data/gemfiles/faraday_2.gemfile.lock +0 -87
- data/test/fixtures/account/info.json +0 -11
- data/test/fixtures/applications/list.json +0 -29
- data/test/fixtures/backups/list.json +0 -18
- data/test/fixtures/backups/retrieve.json +0 -9
- data/test/fixtures/bare_metals/bandwidth.json +0 -12
- data/test/fixtures/bare_metals/create.json +0 -26
- data/test/fixtures/bare_metals/list.json +0 -36
- data/test/fixtures/bare_metals/list_ipv4.json +0 -18
- data/test/fixtures/bare_metals/list_ipv6.json +0 -17
- data/test/fixtures/bare_metals/reinstall.json +0 -25
- data/test/fixtures/bare_metals/retrieve.json +0 -26
- data/test/fixtures/bare_metals/update.json +0 -26
- data/test/fixtures/bare_metals/upgrades.json +0 -47
- data/test/fixtures/bare_metals/user_data.json +0 -5
- data/test/fixtures/bare_metals/vnc.json +0 -5
- data/test/fixtures/block_storage/attach.json +0 -4
- data/test/fixtures/block_storage/create.json +0 -13
- data/test/fixtures/block_storage/detach.json +0 -4
- data/test/fixtures/block_storage/list.json +0 -22
- data/test/fixtures/block_storage/retrieve.json +0 -13
- data/test/fixtures/domains/create.json +0 -6
- data/test/fixtures/domains/dnssec.json +0 -7
- data/test/fixtures/domains/list.json +0 -15
- data/test/fixtures/domains/record.json +0 -10
- data/test/fixtures/domains/records.json +0 -19
- data/test/fixtures/domains/retrieve.json +0 -6
- data/test/fixtures/domains/soa.json +0 -6
- data/test/fixtures/firewall/create.json +0 -11
- data/test/fixtures/firewall/create_rule.json +0 -9
- data/test/fixtures/firewall/delete.json +0 -1
- data/test/fixtures/firewall/delete_rule.json +0 -1
- data/test/fixtures/firewall/list.json +0 -20
- data/test/fixtures/firewall/list_rules.json +0 -22
- data/test/fixtures/firewall/retrieve.json +0 -11
- data/test/fixtures/firewall/retrieve_rule.json +0 -13
- data/test/fixtures/firewall/update.json +0 -1
- data/test/fixtures/instances/attach_iso.json +0 -6
- data/test/fixtures/instances/attach_private_network.json +0 -1
- data/test/fixtures/instances/backup_schedule.json +0 -10
- data/test/fixtures/instances/bandwidth.json +0 -12
- data/test/fixtures/instances/create.json +0 -36
- data/test/fixtures/instances/create_ipv4_reverse.json +0 -1
- data/test/fixtures/instances/create_ipv6_reverse.json +0 -1
- data/test/fixtures/instances/delete.json +0 -1
- data/test/fixtures/instances/delete_ipv4.json +0 -1
- data/test/fixtures/instances/delete_ipv6.json +0 -1
- data/test/fixtures/instances/detach_iso.json +0 -5
- data/test/fixtures/instances/detach_private_network.json +0 -1
- data/test/fixtures/instances/halt.json +0 -1
- data/test/fixtures/instances/halt_instances.json +0 -1
- data/test/fixtures/instances/ipv4.json +0 -9
- data/test/fixtures/instances/ipv6_reverse.json +0 -15
- data/test/fixtures/instances/iso.json +0 -6
- data/test/fixtures/instances/list.json +0 -44
- data/test/fixtures/instances/list_ipv4.json +0 -32
- data/test/fixtures/instances/list_ipv6.json +0 -17
- data/test/fixtures/instances/list_private_networks.json +0 -16
- data/test/fixtures/instances/neighbors.json +0 -6
- data/test/fixtures/instances/reboot.json +0 -1
- data/test/fixtures/instances/reboot_instances.json +0 -1
- data/test/fixtures/instances/reinstall.json +0 -35
- data/test/fixtures/instances/restore.json +0 -7
- data/test/fixtures/instances/retrieve.json +0 -35
- data/test/fixtures/instances/set_backup_schedule.json +0 -1
- data/test/fixtures/instances/set_default_reverse_dns_entry.json +0 -1
- data/test/fixtures/instances/start.json +0 -1
- data/test/fixtures/instances/start_instances.json +0 -1
- data/test/fixtures/instances/update.json +0 -1
- data/test/fixtures/instances/upgrades.json +0 -55
- data/test/fixtures/instances/user_data.json +0 -5
- data/test/fixtures/isos/create.json +0 -8
- data/test/fixtures/isos/list.json +0 -20
- data/test/fixtures/isos/list_public.json +0 -17
- data/test/fixtures/isos/retrieve.json +0 -11
- data/test/fixtures/kubernetes/config.json +0 -3
- data/test/fixtures/kubernetes/create.json +0 -39
- data/test/fixtures/kubernetes/create_node_pool.json +0 -25
- data/test/fixtures/kubernetes/list.json +0 -85
- data/test/fixtures/kubernetes/list_node_pools.json +0 -56
- data/test/fixtures/kubernetes/list_resources.json +0 -26
- data/test/fixtures/kubernetes/retrieve.json +0 -39
- data/test/fixtures/kubernetes/retrieve_node_pool.json +0 -25
- data/test/fixtures/kubernetes/update_node_pool.json +0 -19
- data/test/fixtures/load_balancers/create.json +0 -48
- data/test/fixtures/load_balancers/create_forwarding_rule.json +0 -1
- data/test/fixtures/load_balancers/delete.json +0 -1
- data/test/fixtures/load_balancers/delete_forwarding_rule.json +0 -1
- data/test/fixtures/load_balancers/list.json +0 -57
- data/test/fixtures/load_balancers/list_firewall_rules.json +0 -17
- data/test/fixtures/load_balancers/list_forwarding_rules.json +0 -18
- data/test/fixtures/load_balancers/retrieve.json +0 -48
- data/test/fixtures/load_balancers/retrieve_firewall_rule.json +0 -8
- data/test/fixtures/load_balancers/retrieve_forwarding_rule.json +0 -9
- data/test/fixtures/load_balancers/update.json +0 -1
- data/test/fixtures/object_storage/create.json +0 -14
- data/test/fixtures/object_storage/delete.json +0 -1
- data/test/fixtures/object_storage/list.json +0 -22
- data/test/fixtures/object_storage/list_clusters.json +0 -17
- data/test/fixtures/object_storage/regenerate_keys.json +0 -7
- data/test/fixtures/object_storage/retrieve.json +0 -13
- data/test/fixtures/object_storage/update.json +0 -1
- data/test/fixtures/operating_systems/list.json +0 -17
- data/test/fixtures/plans/list.json +0 -22
- data/test/fixtures/plans/list_metal.json +0 -24
- data/test/fixtures/private_networks/create.json +0 -10
- data/test/fixtures/private_networks/delete.json +0 -1
- data/test/fixtures/private_networks/list.json +0 -19
- data/test/fixtures/private_networks/retrieve.json +0 -10
- data/test/fixtures/private_networks/update.json +0 -1
- data/test/fixtures/regions/list.json +0 -20
- data/test/fixtures/regions/list_availability.json +0 -24
- data/test/fixtures/reserved_ips/attach.json +0 -1
- data/test/fixtures/reserved_ips/convert.json +0 -11
- data/test/fixtures/reserved_ips/create.json +0 -11
- data/test/fixtures/reserved_ips/delete.json +0 -1
- data/test/fixtures/reserved_ips/detach.json +0 -1
- data/test/fixtures/reserved_ips/list.json +0 -29
- data/test/fixtures/reserved_ips/retrieve.json +0 -11
- data/test/fixtures/snapshots/create.json +0 -11
- data/test/fixtures/snapshots/create_from_url.json +0 -11
- data/test/fixtures/snapshots/delete.json +0 -1
- data/test/fixtures/snapshots/list.json +0 -20
- data/test/fixtures/snapshots/retrieve.json +0 -11
- data/test/fixtures/snapshots/update.json +0 -1
- data/test/fixtures/ssh_keys/create.json +0 -8
- data/test/fixtures/ssh_keys/delete.json +0 -1
- data/test/fixtures/ssh_keys/list.json +0 -17
- data/test/fixtures/ssh_keys/retrieve.json +0 -8
- data/test/fixtures/ssh_keys/update.json +0 -1
- data/test/fixtures/startup_scripts/create.json +0 -10
- data/test/fixtures/startup_scripts/delete.json +0 -1
- data/test/fixtures/startup_scripts/list.json +0 -18
- data/test/fixtures/startup_scripts/retrieve.json +0 -10
- data/test/fixtures/startup_scripts/update.json +0 -1
- data/test/fixtures/users/create.json +0 -9
- data/test/fixtures/users/delete.json +0 -1
- data/test/fixtures/users/list.json +0 -29
- data/test/fixtures/users/retrieve.json +0 -20
- data/test/fixtures/users/update.json +0 -1
- data/test/test_helper.rb +0 -19
- data/test/vultr/client_test.rb +0 -8
- data/test/vultr/object_test.rb +0 -21
- data/test/vultr/resources/account_test.rb +0 -12
- data/test/vultr/resources/applications_test.rb +0 -15
- data/test/vultr/resources/backups_test.rb +0 -24
- data/test/vultr/resources/bare_metal_test.rb +0 -267
- data/test/vultr/resources/block_storage_test.rb +0 -85
- data/test/vultr/resources/dns_test.rb +0 -134
- data/test/vultr/resources/firewall_test.rb +0 -88
- data/test/vultr/resources/instances_test.rb +0 -325
- data/test/vultr/resources/iso_test.rb +0 -58
- data/test/vultr/resources/kubernetes_test.rb +0 -185
- data/test/vultr/resources/load_balancers_test.rb +0 -110
- data/test/vultr/resources/object_storage_test.rb +0 -71
- data/test/vultr/resources/operating_systems_test.rb +0 -15
- data/test/vultr/resources/plans_test.rb +0 -25
- data/test/vultr/resources/private_networks_test.rb +0 -50
- data/test/vultr/resources/regions_test.rb +0 -26
- data/test/vultr/resources/reserved_ips_test.rb +0 -67
- data/test/vultr/resources/snapshots_test.rb +0 -60
- data/test/vultr/resources/ssh_keys_test.rb +0 -50
- data/test/vultr/resources/startup_scripts_test.rb +0 -50
- data/test/vultr/resources/users_test.rb +0 -50
- data/vultr.gemspec +0 -24
|
@@ -1,60 +0,0 @@
|
|
|
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
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
|
@@ -1,50 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Run `rake vultr.gemspec` to update the gemspec.
|
|
2
|
-
|
|
3
|
-
lib = File.expand_path("../lib", __FILE__)
|
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
-
require "vultr/version"
|
|
6
|
-
|
|
7
|
-
Gem::Specification.new do |s|
|
|
8
|
-
s.name = "vultr"
|
|
9
|
-
s.version = Vultr::VERSION
|
|
10
|
-
s.authors = ["Gao Jiangmiao", "Chris Oliver"]
|
|
11
|
-
s.email = ["tolbkni@gmail.com", "excid3@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
|
-
|
|
17
|
-
s.files = `git ls-files -z`.split("\x0")
|
|
18
|
-
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
19
|
-
s.require_paths = ["lib"]
|
|
20
|
-
|
|
21
|
-
s.required_ruby_version = ">= 3.0"
|
|
22
|
-
|
|
23
|
-
s.add_dependency "faraday", ">= 1.0", "< 3.0"
|
|
24
|
-
end
|