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 +4 -4
- data/app/models/civo/account.rb +4 -4
- data/app/models/civo/action.rb +2 -2
- data/app/models/civo/audit_log.rb +2 -2
- data/app/models/civo/charge.rb +1 -1
- data/app/models/civo/firewall.rb +3 -3
- data/app/models/civo/firewall_rule.rb +3 -3
- data/app/models/civo/instance.rb +13 -13
- data/app/models/civo/ip.rb +3 -3
- data/app/models/civo/quota.rb +2 -2
- data/app/models/civo/region.rb +1 -1
- data/app/models/civo/size.rb +2 -2
- data/app/models/civo/snapshot.rb +4 -4
- data/app/models/civo/ssh_key.rb +3 -3
- data/app/models/civo/team.rb +9 -9
- data/app/models/civo/template.rb +5 -5
- data/app/models/civo/user.rb +9 -9
- data/lib/civo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ae1200748a7acec28b552dcde19a42cf1f7db52
|
4
|
+
data.tar.gz: c718dc9717e12fc1fda54971635eceb3a8be1a18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50da13f911407aa417a627857f9fb303e6edcd0422bf4bc15193003e24b62060b905465329c625c60c6d71d5c2eeac9cbc394ae99426653b9fd090b88d55edc8
|
7
|
+
data.tar.gz: 426f6b5695941cbef536eeeecf0917656864347b805899a513d4b7f48bfa30a14658719a7e6976a223863c391dd53a99c9524e37d9f5c9197d643a4a92869585
|
data/app/models/civo/account.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Civo
|
2
2
|
class Account < Base
|
3
|
-
get :all, "/
|
4
|
-
post :create, "/
|
5
|
-
put :reset, "/
|
6
|
-
delete :remove, "/
|
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
|
data/app/models/civo/action.rb
CHANGED
data/app/models/civo/charge.rb
CHANGED
data/app/models/civo/firewall.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Civo
|
2
2
|
class Firewall < Base
|
3
|
-
get :all, "/
|
4
|
-
post :create, "/
|
5
|
-
delete :remove, "/
|
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, "/
|
4
|
-
post :create, "/
|
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, "/
|
6
|
+
delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "1"}/firewalls/:name/rules/:id", required: [:name, :id]
|
7
7
|
end
|
8
8
|
end
|
data/app/models/civo/instance.rb
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
module Civo
|
2
2
|
class Instance < Base
|
3
|
-
get :all, "/
|
4
|
-
get :find, "/
|
5
|
-
post :create, "/
|
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, "/
|
8
|
-
post :reboot, "/
|
9
|
-
post :hard_reboot, "/
|
10
|
-
post :soft_reboot, "/
|
11
|
-
put :rebuild, "/
|
12
|
-
put :stop, "/
|
13
|
-
put :start, "/
|
14
|
-
put :upgrade, "/
|
15
|
-
put :restore, "/
|
16
|
-
put :firewall, "/
|
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|
|
data/app/models/civo/ip.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Civo
|
2
2
|
class Ip < Base
|
3
|
-
post :create, "/
|
4
|
-
delete :remove, "/
|
5
|
-
put :connect, "/
|
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
|
data/app/models/civo/quota.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Civo
|
2
2
|
class Quota < Base
|
3
|
-
get :current, "/
|
4
|
-
put :update, "/
|
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
|
data/app/models/civo/region.rb
CHANGED
data/app/models/civo/size.rb
CHANGED
data/app/models/civo/snapshot.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Civo
|
2
2
|
class Snapshot < Base
|
3
|
-
get :all, "/
|
4
|
-
get :find, "/
|
5
|
-
put :create, "/
|
6
|
-
delete :remove, "/
|
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
|
data/app/models/civo/ssh_key.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Civo
|
2
2
|
class SshKey < Base
|
3
|
-
get :all, "/
|
4
|
-
post :create, "/
|
5
|
-
delete :remove, "/
|
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
|
data/app/models/civo/team.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
module Civo
|
2
2
|
class Team < Base
|
3
|
-
get :all, "/
|
4
|
-
post :create, "/
|
5
|
-
put :update, "/
|
6
|
-
delete :remove, "/
|
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, "/
|
9
|
-
post :member_invite, "/
|
10
|
-
put :member_status, "/
|
11
|
-
get :members, "/
|
12
|
-
delete :member_remove, "/
|
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
|
data/app/models/civo/template.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Civo
|
2
2
|
class Template < Base
|
3
|
-
get :all, "/
|
4
|
-
get :details, "/
|
5
|
-
put :save, "/
|
6
|
-
post :create, "/
|
7
|
-
delete :remove, "/
|
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
|
data/app/models/civo/user.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Civo
|
2
2
|
class User < Base
|
3
|
-
get :ping, "/
|
4
|
-
post :create, "/
|
5
|
-
put :confirm, "/
|
6
|
-
put :password, "/
|
7
|
-
post :token, "/
|
8
|
-
post :login, "/
|
9
|
-
put :flags, "/
|
10
|
-
put :update, "/
|
11
|
-
get :find, "/
|
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
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
|
+
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-
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flexirest
|