civo 1.5.4 → 1.5.8
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 +1 -0
- data/app/models/civo/database.rb +83 -9
- data/app/models/civo/load_balancer.rb +59 -3
- data/lib/civo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0b949c503316c044b3afb253e360bb4b5f157451a1931f8193f633ce57fe9e8
|
4
|
+
data.tar.gz: a5bfb968fc84f2c387d59038d29e898ae2387cb9ab15b4e9760da1dc2f312520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97696f78b976ea9e3a924f495904affac30cb7a3e6dc8277c83e191a88d6f5997c22caf45bd9f16f4ba65cb013eb4344534e83677fc670d497ffd8664b50e578
|
7
|
+
data.tar.gz: a98dfadc228f17cb858be9901c75edfd3dfbe345f14dd48808ca6b0fcf79483669a89b2ab55484ed13cadb930f99495b91cc0fbda2bcc0948b2740bddd146989
|
data/app/models/civo/account.rb
CHANGED
@@ -9,6 +9,7 @@ module Civo
|
|
9
9
|
put :save, "/v#{ENV["CIVO_API_VERSION"] || "2"}/accounts/:id"
|
10
10
|
delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "2"}/accounts/:id", requires: [:id]
|
11
11
|
get :active_paid_services, "/v#{ENV["CIVO_API_VERSION"] || "2"}/accounts/:id/active_paid_services", requires: [:id]
|
12
|
+
get :ids, "/v#{ENV["CIVO_API_VERSION"] || "2"}/accounts/ids"
|
12
13
|
|
13
14
|
def to_partial_path
|
14
15
|
"civo/account"
|
data/app/models/civo/database.rb
CHANGED
@@ -1,17 +1,91 @@
|
|
1
1
|
module Civo
|
2
2
|
class Database < Base
|
3
|
-
get :all, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases"
|
4
|
-
post :create, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases", requires: [:name, :size, :region]
|
5
|
-
get :find, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id"
|
6
|
-
|
7
|
-
delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id", requires: [:id]
|
8
|
-
|
9
|
-
put :restore, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id/restore", requires: [:snapshot_id]
|
10
|
-
get :snapshots, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id/snapshots"
|
11
|
-
put :tags, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id/tags"
|
3
|
+
get :all, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases", requires: [:region], fake: :databases
|
4
|
+
post :create, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases", requires: [:name, :size, :region, :software, :network_id], fake: :create_database
|
5
|
+
get :find, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id", requires: [:region], fake: :get_database
|
6
|
+
patch :update, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id", requires: [:region], fake: :update_database
|
7
|
+
delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id", requires: [:id, :region], fake: :delete_database
|
8
|
+
post :restore, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id/restore", requires: [:region, :snapshot_id], fake: :restore_database
|
12
9
|
|
13
10
|
def to_partial_path
|
14
11
|
"civo/database"
|
15
12
|
end
|
13
|
+
|
14
|
+
def databases
|
15
|
+
[
|
16
|
+
{
|
17
|
+
"id": "5cc0696d-6663-48a9-8123-87adb997138c",
|
18
|
+
"name": "Mysite-DB",
|
19
|
+
"replicas": 2,
|
20
|
+
"size": 10,
|
21
|
+
"software": "PostgreSQL",
|
22
|
+
"software_version": "10.1",
|
23
|
+
"public_ip": "84.127.44.100",
|
24
|
+
"network_id": "5be0646d-6e63-4aa9-8123-87adb447138c",
|
25
|
+
"snapshots": [
|
26
|
+
{
|
27
|
+
"id": "5cc0696d-6663-48a9-8123-87adb997138c",
|
28
|
+
"timestamp": "2021-12-04T10:00:28Z"
|
29
|
+
}
|
30
|
+
]
|
31
|
+
}
|
32
|
+
].to_json
|
33
|
+
end
|
34
|
+
|
35
|
+
def get_database
|
36
|
+
{
|
37
|
+
"id": "5cc0696d-6663-48a9-8123-87adb997138c",
|
38
|
+
"name": "Mysite-DB",
|
39
|
+
"replicas": 2,
|
40
|
+
"size": 10,
|
41
|
+
"software": "PostgreSQL",
|
42
|
+
"software_version": "10.1",
|
43
|
+
"public_ip": "84.127.44.100",
|
44
|
+
"network_id": "5be0646d-6e63-4aa9-8123-87adb447138c",
|
45
|
+
"snapshots": [
|
46
|
+
{
|
47
|
+
"id": "5cc0696d-6663-48a9-8123-87adb997138c",
|
48
|
+
"timestamp": "2021-12-04T10:00:28Z"
|
49
|
+
}
|
50
|
+
]
|
51
|
+
}.to_json
|
52
|
+
end
|
53
|
+
|
54
|
+
def create_database
|
55
|
+
{
|
56
|
+
"id": "5cc0696d-6663-48a9-8123-87adb997138c",
|
57
|
+
"name": "Mysite-DB",
|
58
|
+
"replicas": 2,
|
59
|
+
"size": 10,
|
60
|
+
"software": "PostgreSQL",
|
61
|
+
"software_version": "10.1",
|
62
|
+
"public_ip": "84.127.44.100",
|
63
|
+
"network_id": "5be0646d-6e63-4aa9-8123-87adb447138c",
|
64
|
+
"snapshots": []
|
65
|
+
}.to_json
|
66
|
+
end
|
67
|
+
|
68
|
+
def update_database
|
69
|
+
{
|
70
|
+
"id": "5cc0696d-6663-48a9-8123-87adb997138c",
|
71
|
+
"name": "Mysite-DB-renamed",
|
72
|
+
"replicas": 3,
|
73
|
+
"size": 10,
|
74
|
+
"software": "PostgreSQL",
|
75
|
+
"software_version": "10.1",
|
76
|
+
"public_ip": "84.127.44.100",
|
77
|
+
"network_id": "5be0646d-6e63-4aa9-8123-87adb447138c",
|
78
|
+
"snapshots": []
|
79
|
+
}.to_json
|
80
|
+
end
|
81
|
+
|
82
|
+
def restore_database
|
83
|
+
{ result: "OK" }.to_json
|
84
|
+
end
|
85
|
+
|
86
|
+
def delete_database
|
87
|
+
{ result: "OK" }.to_json
|
88
|
+
end
|
89
|
+
|
16
90
|
end
|
17
91
|
end
|
@@ -2,12 +2,68 @@ module Civo
|
|
2
2
|
class LoadBalancer < Base
|
3
3
|
get :all, "/v2/loadbalancers"
|
4
4
|
get :find, "/v2/loadbalancers/:id"
|
5
|
-
post :create, "/v2/loadbalancers", required: [:hostname]
|
6
|
-
put :update, "/v2/loadbalancers/:id"
|
7
|
-
delete :remove, "/v2/loadbalancers/:id", required: [:id]
|
5
|
+
post :create, "/v2/loadbalancers", required: [:hostname], fake: :get_loadbalancer
|
6
|
+
put :update, "/v2/loadbalancers/:id", fake: :get_loadbalancer
|
7
|
+
delete :remove, "/v2/loadbalancers/:id", required: [:id], fake: :delete_loadbalancer
|
8
8
|
|
9
9
|
def to_partial_path
|
10
10
|
"civo/loadbalancer"
|
11
11
|
end
|
12
|
+
|
13
|
+
def loadbalancers
|
14
|
+
[
|
15
|
+
{
|
16
|
+
id: 23,
|
17
|
+
name: "Johnny",
|
18
|
+
algorithm: "round_robin",
|
19
|
+
state: "available",
|
20
|
+
public_ipv4: "192.168.1.10",
|
21
|
+
private_ipv4: "10.10.10.10",
|
22
|
+
firewall_id: "86E2749F-8FA1-4D49-8833-299D02E585B8",
|
23
|
+
cluster_id: "96E2749F-8FA1-4D49-8833-299D02E585B8"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
id: 223,
|
27
|
+
name: "Dep",
|
28
|
+
algorithm: "weighted_fixed",
|
29
|
+
state: "available",
|
30
|
+
public_ipv4: "192.168.1.30",
|
31
|
+
private_ipv4: "10.10.10.12",
|
32
|
+
firewall_id: "36E2749F-8FA1-4D49-8833-299D02E585B8",
|
33
|
+
cluster_id: "46E2749F-8FA1-4D49-8833-299D02E585B8"
|
34
|
+
}
|
35
|
+
].to_json
|
36
|
+
end
|
37
|
+
|
38
|
+
def get_loadbalancer
|
39
|
+
{
|
40
|
+
id: 23,
|
41
|
+
name: "Johnny",
|
42
|
+
algorithm: "round_robin",
|
43
|
+
state: "available",
|
44
|
+
public_ipv4: "192.168.1.10",
|
45
|
+
private_ipv4: "10.10.10.10",
|
46
|
+
firewall_id: "86E2749F-8FA1-4D49-8833-299D02E585B8",
|
47
|
+
cluster_id: "96E2749F-8FA1-4D49-8833-299D02E585B8",
|
48
|
+
endpoints: [
|
49
|
+
{
|
50
|
+
ip: "192.168.1.4",
|
51
|
+
protocol: "TCP",
|
52
|
+
source_port: 80,
|
53
|
+
target_port: 31579
|
54
|
+
},
|
55
|
+
{
|
56
|
+
ip: "192.168.1.5",
|
57
|
+
protocol: "TCP",
|
58
|
+
source_port: 80,
|
59
|
+
target_port: 31579
|
60
|
+
}
|
61
|
+
]
|
62
|
+
}.to_json
|
63
|
+
end
|
64
|
+
|
65
|
+
def delete_loadbalancer
|
66
|
+
{ result: "Success" }.to_json
|
67
|
+
end
|
12
68
|
end
|
13
69
|
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: 1.5.
|
4
|
+
version: 1.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: flexirest
|