civo 1.5.16 → 1.5.19

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
  SHA256:
3
- metadata.gz: 0e7a9a987eb0de240f316af529552fbb6b038c58f367382f8aeb542274317c61
4
- data.tar.gz: 121aa514d4bcff474d7db16eb460e63b5e813d6d36b54a300893fc1fe7df57b2
3
+ metadata.gz: 2b44235a1c7c733cc6bd71f2658fb529e2620d58ce81de263f82e5d1b4a642a7
4
+ data.tar.gz: 17d88e518d5255a320ad00f43523eeab37f80ae048cb08de6af15c5ae01bb752
5
5
  SHA512:
6
- metadata.gz: 5284d573abe0b23375e9d92e97dc76b3d47b84bffd2870588c478ad9afe395d14d67374d117e24b3b583ddc9b0e9ad24ffaa955212e347ecb03899441d84aae7
7
- data.tar.gz: 103f84dd0f22f6e733aa8e72c0cc3f35bb9197031e9f824c4ea148e76fa689530c4a448bc236a198707d169a51baf9a4e041b5bf78a6b90e5ba977440dccd178
6
+ metadata.gz: a7b025cc1d177f3a4258607b8c702f92cccb2389023c2ffe412f551f7a4fbd49a67c5442cba202ac5458d3152a45b312f0515406c04dffbd398bdece0c91781f
7
+ data.tar.gz: d8c49d8425202a4b256ca4fe8314545d91af79f2f682dd005d8fcd59ebe685421ba4ecdcdbf980000fa517d503b5da1a98e75502d71928da35ad4db5d31c43c4
@@ -1,113 +1,13 @@
1
1
  module Civo
2
2
  class Database < Base
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
3
+ get :all, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases", requires: [:region]
4
+ post :create, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases", requires: [:name, :size, :nodes, :region]
5
+ get :find, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id", requires: [:id, :region]
6
+ patch :update, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id", requires: [:id, :region]
7
+ delete :remove, "/v#{ENV["CIVO_API_VERSION"] || "2"}/databases/:id", requires: [:id, :region]
9
8
 
10
9
  def to_partial_path
11
10
  "civo/database"
12
11
  end
13
-
14
- def databases
15
- [
16
- {
17
- "id": "dd13bc84-1224-476e-8c0c-f15630ec9523",
18
- "name": "dancing-in-the-moonlight-2",
19
- "replicas": 1,
20
- "size": "g3.db.xsmall",
21
- "software": "MySQL",
22
- "software_version": "8.0",
23
- "public_ip": "",
24
- "network_id": "b064d568-5869-427c-827a-77d48cde6a2e",
25
- "firewall_id": "0c681c22-c449-43b4-a7dc-f3644a8d21f2",
26
- "status": "Pending",
27
- "snapshots": []
28
- },
29
- {
30
- "id": "9c59d8dd-f514-4f6a-86bf-6bef835ac84f",
31
- "name": "dancing-in-the-moonlight",
32
- "replicas": 1,
33
- "size": "g3.db.xsmall",
34
- "software": "MySQL",
35
- "software_version": "8.0",
36
- "public_ip": "",
37
- "network_id": "b064d568-5869-427c-827a-77d48cde6a2e",
38
- "firewall_id": "0c681c22-c449-43b4-a7dc-f3644a8d21f2",
39
- "status": "Pending",
40
- "snapshots": []
41
- },
42
- {
43
- "id": "1de75ca8-46d3-4196-b31f-58698c0c1708",
44
- "name": "to-be-updated-new",
45
- "replicas": 2,
46
- "size": "g3.db.xsmall",
47
- "software": "MySQL",
48
- "software_version": "8.0",
49
- "public_ip": "",
50
- "network_id": "b064d568-5869-427c-827a-77d48cde6a2e",
51
- "firewall_id": "dc468f86-c96d-4f04-ac42-508885b1115f",
52
- "status": "Pending",
53
- "snapshots": []
54
- }
55
- ].to_json
56
- end
57
-
58
- def get_database
59
- {
60
- "id": "0e07ce5f-179b-44e0-83cf-47ae9ca7b4ad",
61
- "name": "my-user-friendly-database-name",
62
- "replicas": 1,
63
- "size": "g3.db.xsmall",
64
- "software": "MySQL",
65
- "software_version": "8.0",
66
- "public_ip": "10.90.100.30",
67
- "port": 3306,
68
- "username": "root",
69
- "password": "h03K5gID9S39nZZd",
70
- "network_id": "b064d568-5869-427c-827a-77d48cde6a2e",
71
- "firewall_id": "0c681c22-c449-43b4-a7dc-f3644a8d21f2",
72
- "status": "Ready"
73
- }.to_json
74
- end
75
-
76
- def create_database
77
- {
78
- "id": "0e07ce5f-179b-44e0-83cf-47ae9ca7b4ad",
79
- "name": "Mysite-DB",
80
- "replicas": 2,
81
- "size": "g3.db.xsmall",
82
- "software": "MySQL",
83
- "software_version": "8.0",
84
- "public_ip": "84.127.44.100",
85
- "network_id": "5be0646d-6e63-4aa9-8123-87adb447138c",
86
- "snapshots": []
87
- }.to_json
88
- end
89
-
90
- def update_database
91
- {
92
- "id": "5cc0696d-6663-48a9-8123-87adb997138c",
93
- "name": "Mysite-DB-renamed",
94
- "replicas": 3,
95
- "size": 10,
96
- "software": "PostgreSQL",
97
- "software_version": "10.1",
98
- "public_ip": "84.127.44.100",
99
- "network_id": "5be0646d-6e63-4aa9-8123-87adb447138c",
100
- "snapshots": []
101
- }.to_json
102
- end
103
-
104
- def restore_database
105
- { result: "OK" }.to_json
106
- end
107
-
108
- def delete_database
109
- { result: "OK" }.to_json
110
- end
111
-
112
12
  end
113
13
  end
@@ -2,8 +2,9 @@ module Civo
2
2
  class Network < Base
3
3
  if ENV["CIVO_API_VERSION"] == "2"
4
4
  get :all, "/v2/networks"
5
- post :create, "/v2/networks", required: [:label]
6
- put :update, "/v2/networks/:id"
5
+ get :find, "/v2/networks/:id"
6
+ post :create, "/v2/networks", required: [:label], request_body_type: :json
7
+ put :update, "/v2/networks/:id", request_body_type: :json
7
8
  delete :remove, "/v2/networks/:id", required: [:id]
8
9
  put :pseudo_migrate, "/v2/network-pseudo-migrate"
9
10
  else
@@ -0,0 +1,13 @@
1
+ module Civo
2
+ class Subnet < Base
3
+ get :all, "/v2/networks/:network_id/subnets", requires: [:region]
4
+ post :create, "/v2/networks/:network_id/subnets", requires: [:name, :region]
5
+ delete :remove, "/v2/networks/:network_id/subnets/:id", requires: [:id, :region]
6
+ post :allocate, "/v2/networks/:network_id/subnets/:id/routes", requires: [:id, :region]
7
+ delete :release, "/v2/networks/:network_id/subnets/:id/routes", requires: [:id, :region]
8
+
9
+ def to_partial_path
10
+ "civo/subnet"
11
+ end
12
+ end
13
+ end
data/lib/civo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Civo
2
- VERSION = "1.5.16"
2
+ VERSION = "1.5.19"
3
3
  end
data/lib/civo.rb CHANGED
@@ -37,6 +37,7 @@ require_relative "../app/models/civo/role"
37
37
  require_relative "../app/models/civo/size"
38
38
  require_relative "../app/models/civo/snapshot"
39
39
  require_relative "../app/models/civo/ssh_key"
40
+ require_relative "../app/models/civo/subnet"
40
41
  require_relative "../app/models/civo/system"
41
42
  require_relative "../app/models/civo/team"
42
43
  require_relative "../app/models/civo/team_member"
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.16
4
+ version: 1.5.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-20 00:00:00.000000000 Z
11
+ date: 2023-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flexirest
@@ -105,6 +105,7 @@ files:
105
105
  - app/models/civo/size.rb
106
106
  - app/models/civo/snapshot.rb
107
107
  - app/models/civo/ssh_key.rb
108
+ - app/models/civo/subnet.rb
108
109
  - app/models/civo/system.rb
109
110
  - app/models/civo/team.rb
110
111
  - app/models/civo/team_member.rb