civo 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e6b0cf3e74f437501e52e3196a281af455d264a
4
- data.tar.gz: 0f23cf6dbea7718d4d4d640328372d5248a4d75d
3
+ metadata.gz: 0ae1200748a7acec28b552dcde19a42cf1f7db52
4
+ data.tar.gz: c718dc9717e12fc1fda54971635eceb3a8be1a18
5
5
  SHA512:
6
- metadata.gz: f78d6940b72dd64f98777bcdf6ebd1aa3c958d9cf78f2c35630c702f578c112d3222676776ddd7221cfbefefa861ac74fc680ea929d67db02f11ffccb045dafb
7
- data.tar.gz: b3c31ac10ece78765201c47c7c34d37b0a1e6dfc50abc655e771f3858e40f78dbde9724b22b548b96e8b7fac9feb49d3c974a1d6d1356dc97e69bda5f78fe626
6
+ metadata.gz: 50da13f911407aa417a627857f9fb303e6edcd0422bf4bc15193003e24b62060b905465329c625c60c6d71d5c2eeac9cbc394ae99426653b9fd090b88d55edc8
7
+ data.tar.gz: 426f6b5695941cbef536eeeecf0917656864347b805899a513d4b7f48bfa30a14658719a7e6976a223863c391dd53a99c9524e37d9f5c9197d643a4a92869585
@@ -1,8 +1,8 @@
1
1
  module Civo
2
2
  class Account < Base
3
- get :all, "/v1/accounts"
4
- post :create, "/v1/accounts", requires: [:name]
5
- put :reset, "/v1/accounts/:name", requires: [:name]
6
- delete :remove, "/v1/accounts/:name", requires: [:name]
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/accounts"
4
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/accounts", requires: [:name]
5
+ put :reset, "/v#{ENV["CIVO_API_VERSION"] || "1"}/accounts/:name", requires: [:name]
6
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/accounts/:name", requires: [:name]
7
7
  end
8
8
  end
@@ -1,6 +1,6 @@
1
1
  module Civo
2
2
  class Action < Base
3
- get :all, "/v1/actions"
4
- post :create, "/v1/actions"
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/actions"
4
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/actions"
5
5
  end
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module Civo
2
2
  class AuditLog < Base
3
- get :global, "/v1/auditlogs"
4
- get :instance, "/v1/auditlogs/:id"
3
+ get :global, "/v#{ENV["CIVO_API_VERSION"] || "1"}/auditlogs"
4
+ get :instance, "/v#{ENV["CIVO_API_VERSION"] || "1"}/auditlogs/:id"
5
5
  end
6
6
  end
@@ -1,5 +1,5 @@
1
1
  module Civo
2
2
  class Charge < Base
3
- get :for, "/v1/charges"
3
+ get :for, "/v#{ENV["CIVO_API_VERSION"] || "1"}/charges"
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  module Civo
2
2
  class Firewall < Base
3
- get :all, "/v1/firewalls"
4
- post :create, "/v1/firewalls", required: [:name]
5
- delete :remove, "/v1/firewalls/:name", required: [:name]
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/firewalls"
4
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/firewalls", required: [:name]
5
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/firewalls/:name", required: [:name]
6
6
  end
7
7
  end
@@ -1,8 +1,8 @@
1
1
  module Civo
2
2
  class FirewallRule < Base
3
- get :all, "/v1/firewalls/:name/rules", required: [:name]
4
- post :create, "/v1/firewalls/:name/rules", required: [:name, :protocol, :start_port,
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/firewalls/:name/rules", required: [:name]
4
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/firewalls/:name/rules", required: [:name, :protocol, :start_port,
5
5
  :cidr, :direction]
6
- delete :remove, "/v1/firewalls/:name/rules/:id", required: [:name, :id]
6
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/firewalls/:name/rules/:id", required: [:name, :id]
7
7
  end
8
8
  end
@@ -1,19 +1,19 @@
1
1
  module Civo
2
2
  class Instance < Base
3
- get :all, "/v1/instances"
4
- get :find, "/v1/instances/:id", requires: [:id]
5
- post :create, "/v1/instances", requires: [:hostname, :size, :region, :ssh_key],
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances"
4
+ get :find, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id", requires: [:id]
5
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances", requires: [:hostname, :size, :region, :ssh_key],
6
6
  defaults: {public_ip: true, template: "ubuntu-14.04", initial_user: "civo"}
7
- delete :remove, "/v1/instances/:id", requires: [:id]
8
- post :reboot, "/v1/instances/:id/reboots", requires: [:id]
9
- post :hard_reboot, "/v1/instances/:id/hard_reboots", requires: [:id]
10
- post :soft_reboot, "/v1/instances/:id/soft_reboots", requires: [:id]
11
- put :rebuild, "/v1/instances/:id/rebuild", requires: [:id]
12
- put :stop, "/v1/instances/:id/stop", requires: [:id]
13
- put :start, "/v1/instances/:id/start", requires: [:id]
14
- put :upgrade, "/v1/instances/:id", requires: [:size, :id]
15
- put :restore, "/v1/instances/:id/restore", requires: [:snapshot, :id]
16
- put :firewall, "/v1/instances/:id/firewall", requires: [:name, :id]
7
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id", requires: [:id]
8
+ post :reboot, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/reboots", requires: [:id]
9
+ post :hard_reboot, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/hard_reboots", requires: [:id]
10
+ post :soft_reboot, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/soft_reboots", requires: [:id]
11
+ put :rebuild, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/rebuild", requires: [:id]
12
+ put :stop, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/stop", requires: [:id]
13
+ put :start, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/start", requires: [:id]
14
+ put :upgrade, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id", requires: [:size, :id]
15
+ put :restore, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/restore", requires: [:snapshot, :id]
16
+ put :firewall, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/firewall", requires: [:name, :id]
17
17
 
18
18
  def nice_ip_addresses
19
19
  @ip_addresses ||= (self._attributes[:ip_addresses].items rescue []).map do |ip|
@@ -1,7 +1,7 @@
1
1
  module Civo
2
2
  class Ip < Base
3
- post :create, "/v1/instances/:id/ip", requires: [:id], defaults: {public: true}
4
- delete :remove, "/v1/instances/:id/ip/:ip_address", requires: [:id, :ip_address]
5
- put :connect, "/v1/instances/:id/ip/:ip_address", requires: [:id, :ip_address, :private_ip]
3
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/ip", requires: [:id], defaults: {public: true}
4
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/ip/:ip_address", requires: [:id, :ip_address]
5
+ put :connect, "/v#{ENV["CIVO_API_VERSION"] || "1"}/instances/:id/ip/:ip_address", requires: [:id, :ip_address, :private_ip]
6
6
  end
7
7
  end
@@ -1,6 +1,6 @@
1
1
  module Civo
2
2
  class Quota < Base
3
- get :current, "/v1/quota"
4
- put :update, "/v1/quota/:name", requires: [:name]
3
+ get :current, "/v#{ENV["CIVO_API_VERSION"] || "1"}/quota"
4
+ put :update, "/v#{ENV["CIVO_API_VERSION"] || "1"}/quota/:name", requires: [:name]
5
5
  end
6
6
  end
@@ -1,5 +1,5 @@
1
1
  module Civo
2
2
  class Region < Base
3
- get :all, "/v1/regions"
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/regions"
4
4
  end
5
5
  end
@@ -1,6 +1,6 @@
1
1
  module Civo
2
2
  class Size < Base
3
- get :all, "/v1/sizes"
4
- put :reset, "/v1/sizes"
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/sizes"
4
+ put :reset, "/v#{ENV["CIVO_API_VERSION"] || "1"}/sizes"
5
5
  end
6
6
  end
@@ -1,8 +1,8 @@
1
1
  module Civo
2
2
  class Snapshot < Base
3
- get :all, "/v1/snapshots"
4
- get :find, "/v1/snapshots/:name", required: [:name]
5
- put :create, "/v1/snapshots/:name", required: [:name, :instance_id]
6
- delete :remove, "/v1/snapshots/:name", required: [:name]
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/snapshots"
4
+ get :find, "/v#{ENV["CIVO_API_VERSION"] || "1"}/snapshots/:name", required: [:name]
5
+ put :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/snapshots/:name", required: [:name, :instance_id]
6
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/snapshots/:name", required: [:name]
7
7
  end
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Civo
2
2
  class SshKey < Base
3
- get :all, "/v1/sshkeys"
4
- post :create, "/v1/sshkeys", requires: [:name, :public_key]
5
- delete :remove, "/v1/sshkeys/:name", requires: [:name]
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/sshkeys"
4
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/sshkeys", requires: [:name, :public_key]
5
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/sshkeys/:name", requires: [:name]
6
6
  end
7
7
  end
@@ -1,14 +1,14 @@
1
1
  module Civo
2
2
  class Team < Base
3
- get :all, "/v1/teams"
4
- post :create, "/v1/teams"
5
- put :update, "/v1/teams/:id", requires: %i{id}
6
- delete :remove, "/v1/teams/:id", requires: %i{id}
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/teams"
4
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/teams"
5
+ put :update, "/v#{ENV["CIVO_API_VERSION"] || "1"}/teams/:id", requires: %i{id}
6
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/teams/:id", requires: %i{id}
7
7
 
8
- get :my_memberships, "/v1/team_memberships"
9
- post :member_invite, "/v1/teams/:id/memberships/:user_id", requires: %i{id user_id email_address}
10
- put :member_status, "/v1/teams/:id/memberships/:user_id", requires: %i{id user_id status}
11
- get :members, "/v1/teams/:id/memberships", requires: %i{id}
12
- delete :member_remove, "/v1/teams/:id/memberships/:user_id", requires: %i{id user_id}
8
+ get :my_memberships, "/v#{ENV["CIVO_API_VERSION"] || "1"}/team_memberships"
9
+ post :member_invite, "/v#{ENV["CIVO_API_VERSION"] || "1"}/teams/:id/memberships/:user_id", requires: %i{id user_id email_address}
10
+ put :member_status, "/v#{ENV["CIVO_API_VERSION"] || "1"}/teams/:id/memberships/:user_id", requires: %i{id user_id status}
11
+ get :members, "/v#{ENV["CIVO_API_VERSION"] || "1"}/teams/:id/memberships", requires: %i{id}
12
+ delete :member_remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/teams/:id/memberships/:user_id", requires: %i{id user_id}
13
13
  end
14
14
  end
@@ -1,9 +1,9 @@
1
1
  module Civo
2
2
  class Template < Base
3
- get :all, "/v1/templates"
4
- get :details, "/v1/templates/:id"
5
- put :save, "/v1/templates/:id"
6
- post :create, "/v1/templates", required: [:name, :image_id]
7
- delete :remove, "/v1/templates/:id"
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "1"}/templates"
4
+ get :details, "/v#{ENV["CIVO_API_VERSION"] || "1"}/templates/:id"
5
+ put :save, "/v#{ENV["CIVO_API_VERSION"] || "1"}/templates/:id"
6
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/templates", required: [:name, :image_id]
7
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/templates/:id"
8
8
  end
9
9
  end
@@ -1,13 +1,13 @@
1
1
  module Civo
2
2
  class User < Base
3
- get :ping, "/v1/ping"
4
- post :create, "/v1/users", required: %i{first_name last_name email_address}
5
- put :confirm, "/v1/users/confirm/:token"
6
- put :password, "/v1/users/password/:token"
7
- post :token, "/v1/users/token"
8
- post :login, "/v1/users/login"
9
- put :flags, "/v1/users/:id/flags"
10
- put :update, "/v1/users/:id"
11
- get :find, "/v1/users/:id"
3
+ get :ping, "/v#{ENV["CIVO_API_VERSION"] || "1"}/ping"
4
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "1"}/users", required: %i{first_name last_name email_address}
5
+ put :confirm, "/v#{ENV["CIVO_API_VERSION"] || "1"}/users/confirm/:token"
6
+ put :password, "/v#{ENV["CIVO_API_VERSION"] || "1"}/users/password/:token"
7
+ post :token, "/v#{ENV["CIVO_API_VERSION"] || "1"}/users/token"
8
+ post :login, "/v#{ENV["CIVO_API_VERSION"] || "1"}/users/login"
9
+ put :flags, "/v#{ENV["CIVO_API_VERSION"] || "1"}/users/:id/flags"
10
+ put :update, "/v#{ENV["CIVO_API_VERSION"] || "1"}/users/:id"
11
+ get :find, "/v#{ENV["CIVO_API_VERSION"] || "1"}/users/:id"
12
12
  end
13
13
  end
data/lib/civo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Civo
2
- VERSION = "0.4.4"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: civo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-04 00:00:00.000000000 Z
11
+ date: 2016-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flexirest