Class: Selectel::V2::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/selectel.rb

Instance Method Summary collapse

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_quotasObject

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

#capabilitiesObject

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

#projectsObject

Get list of projects in current domain. GET /projects



20
21
22
# File 'lib/selectel.rb', line 20

def projects
  execute(:get, 'projects')
end

#quotasObject

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_freeObject

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

#trafficObject

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