Class: Selectel::V2::Client
- Inherits:
-
Object
- Object
- Selectel::V2::Client
- Defined in:
- lib/selectel.rb
Instance Method Summary collapse
-
#all_project_quotas ⇒ Object
Show quotas info for all domain projects.
-
#capabilities ⇒ Object
Capabilities Get possible values for different variables GET /capabilities.
-
#create_project(props) ⇒ Object
Create new project and optionally set quotas on it.
-
#delete_project(id) ⇒ Object
Delete Project and all it’s objects.
-
#initialize(token) ⇒ Client
constructor
A new instance of Client.
-
#project(id) ⇒ Object
Get full information about Project.
-
#project_quotas(project_id) ⇒ Object
GET /quotas/projects/project_id.
-
#projects ⇒ Object
Get list of projects in current domain.
-
#quotas ⇒ Object
Quotas.
-
#quotas_free ⇒ Object
Get amount of resources available to be allocated to projects.
-
#traffic ⇒ Object
Traffic GET /traffic.
-
#update_project(id, props) ⇒ Object
Update Project’s properties.
-
#update_project_quotas(project_id, opts = {}) ⇒ Object
PATCH /quotas/projects/project_id.
Constructor Details
#initialize(token) ⇒ Client
Returns a new instance of Client.
12 13 14 |
# File 'lib/selectel.rb', line 12 def initialize(token) @token = token end |
Instance Method Details
#all_project_quotas ⇒ Object
Show quotas info for all domain projects.
GET /quotas/projects
64 65 66 |
# File 'lib/selectel.rb', line 64 def all_project_quotas execute(:get, 'quotas/projects') end |
#capabilities ⇒ Object
Capabilities Get possible values for different variables GET /capabilities
87 88 89 |
# File 'lib/selectel.rb', line 87 def capabilities execute(:get, 'capabilities') end |
#create_project(props) ⇒ Object
Create new project and optionally set quotas on it. POST /projects
26 27 28 |
# File 'lib/selectel.rb', line 26 def create_project(props) execute(:post, 'projects', json: props) end |
#delete_project(id) ⇒ Object
Delete Project and all it’s objects. DELETE /projects/project_id
44 45 46 |
# File 'lib/selectel.rb', line 44 def delete_project(id) execute(:get,"projects/#{id}") end |
#project(id) ⇒ Object
Get full information about Project. GET /projects/project_id
32 33 34 |
# File 'lib/selectel.rb', line 32 def project(id) execute(:get,"projects/#{id}") end |
#project_quotas(project_id) ⇒ Object
GET /quotas/projects/project_id
69 70 71 |
# File 'lib/selectel.rb', line 69 def project_quotas(project_id) execute(:get, "quotas/projects/#{project_id}") end |
#projects ⇒ Object
Get list of projects in current domain. GET /projects
20 21 22 |
# File 'lib/selectel.rb', line 20 def projects execute(:get, 'projects') end |
#quotas ⇒ Object
Quotas
Get total amount of resources available to be allocated to projects.
GET /quotas
52 53 54 |
# File 'lib/selectel.rb', line 52 def quotas execute(:get, 'quotas') end |
#quotas_free ⇒ Object
Get amount of resources available to be allocated to projects.
GET /quotas/free
58 59 60 |
# File 'lib/selectel.rb', line 58 def quotas_free execute(:get, 'quotas/free') end |
#traffic ⇒ Object
Traffic GET /traffic
80 81 82 |
# File 'lib/selectel.rb', line 80 def traffic execute(:get, 'traffic') end |
#update_project(id, props) ⇒ Object
Update Project’s properties. PATCH /projects/project_id
38 39 40 |
# File 'lib/selectel.rb', line 38 def update_project(id, props) execute(:patch, "projects/#{id}", json: props) end |
#update_project_quotas(project_id, opts = {}) ⇒ Object
PATCH /quotas/projects/project_id
74 75 76 |
# File 'lib/selectel.rb', line 74 def update_project_quotas(project_id, opts = {}) execute(:patch, "quotas/projects/#{project_id}", json: opts) end |