Class: RenderAPI::Clients::Services

Inherits:
Base
  • Object
show all
Defined in:
lib/render_api/clients/services.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from RenderAPI::Clients::Base

Instance Method Details

#create(**payload) ⇒ Object



8
9
10
# File 'lib/render_api/clients/services.rb', line 8

def create(**payload)
  endpoint.post("/services", body: payload)
end

#delete(service_id) ⇒ Object



12
13
14
# File 'lib/render_api/clients/services.rb', line 12

def delete(service_id)
  endpoint.delete("/services/#{service_id}")
end

#find(service_id) ⇒ Object



16
17
18
# File 'lib/render_api/clients/services.rb', line 16

def find(service_id)
  endpoint.get("/services/#{service_id}")
end

#listObject



20
21
22
# File 'lib/render_api/clients/services.rb', line 20

def list(...)
  endpoint.get("/services", params: list_parameters(...))
end

#list_headers(service_id) ⇒ Object



24
25
26
27
28
# File 'lib/render_api/clients/services.rb', line 24

def list_headers(service_id, ...)
  endpoint.get(
    "/services/#{service_id}/headers", params: list_parameters(...)
  )
end

#list_routes(service_id) ⇒ Object



30
31
32
33
34
# File 'lib/render_api/clients/services.rb', line 30

def list_routes(service_id, ...)
  endpoint.get(
    "/services/#{service_id}/routes", params: list_parameters(...)
  )
end

#list_variables(service_id) ⇒ Object



36
37
38
39
40
# File 'lib/render_api/clients/services.rb', line 36

def list_variables(service_id, ...)
  endpoint.get(
    "/services/#{service_id}/env-vars", params: list_parameters(...)
  )
end

#resume(service_id) ⇒ Object



42
43
44
# File 'lib/render_api/clients/services.rb', line 42

def resume(service_id)
  endpoint.post("/services/#{service_id}/resume")
end

#scale(service_id, num_instances:) ⇒ Object



46
47
48
49
50
51
# File 'lib/render_api/clients/services.rb', line 46

def scale(service_id, num_instances:)
  endpoint.post(
    "/services/#{service_id}/scale",
    body: { num_instances: num_instances }
  )
end

#suspend(service_id) ⇒ Object



53
54
55
# File 'lib/render_api/clients/services.rb', line 53

def suspend(service_id)
  endpoint.post("/services/#{service_id}/suspend")
end

#update(service_id, **payload) ⇒ Object



57
58
59
# File 'lib/render_api/clients/services.rb', line 57

def update(service_id, **payload)
  endpoint.patch("/services/#{service_id}", body: payload)
end

#update_variables(service_id, payloads) ⇒ Object



61
62
63
# File 'lib/render_api/clients/services.rb', line 61

def update_variables(service_id, payloads)
  endpoint.put("/services/#{service_id}/env-vars", body: payloads)
end