Class: Morpheus::ServicePlansInterface

Inherits:
APIClient
  • Object
show all
Defined in:
lib/morpheus/api/service_plans_interface.rb

Instance Method Summary collapse

Instance Method Details

#activate(id, params = {}) ⇒ Object



33
34
35
36
37
# File 'lib/morpheus/api/service_plans_interface.rb', line 33

def activate(id, params={})
  url = "#{base_path}/#{id}/activate"
  headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  execute(method: :put, url: url, headers: headers)
end

#base_pathObject



5
6
7
# File 'lib/morpheus/api/service_plans_interface.rb', line 5

def base_path
  "/api/service-plans"
end

#create(payload) ⇒ Object



21
22
23
24
25
# File 'lib/morpheus/api/service_plans_interface.rb', line 21

def create(payload)
  url = base_path
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  execute(method: :post, url: url, headers: headers, payload: payload.to_json)
end

#deactivate(id, params = {}) ⇒ Object



39
40
41
42
43
# File 'lib/morpheus/api/service_plans_interface.rb', line 39

def deactivate(id, params={})
  url = "#{base_path}/#{id}/deactivate"
  headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  execute(method: :put, url: url, headers: headers)
end

#destroy(id, params = {}) ⇒ Object



45
46
47
48
49
# File 'lib/morpheus/api/service_plans_interface.rb', line 45

def destroy(id, params={})
  url = "#{base_path}/#{id}"
  headers = { :params => params, :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  execute(method: :delete, url: url, headers: headers)
end

#get(id, params = {}) ⇒ Object



15
16
17
18
19
# File 'lib/morpheus/api/service_plans_interface.rb', line 15

def get(id, params={})
  url = "#{base_path}/#{id}"
  headers = { params: params, authorization: "Bearer #{@access_token}" }
  execute(method: :get, url: url, headers: headers)
end

#list(params = {}) ⇒ Object



9
10
11
12
13
# File 'lib/morpheus/api/service_plans_interface.rb', line 9

def list(params={})
  url = base_path
  headers = { params: params, authorization: "Bearer #{@access_token}" }
  execute(method: :get, url: url, headers: headers)
end

#price_sets(params = {}) ⇒ Object



57
58
59
60
61
# File 'lib/morpheus/api/service_plans_interface.rb', line 57

def price_sets(params={})
  url = "#{base_path}/price-sets"
  headers = { params: params, authorization: "Bearer #{@access_token}" }
  execute(method: :get, url: url, headers: headers)
end

#provision_types(params = {}) ⇒ Object



51
52
53
54
55
# File 'lib/morpheus/api/service_plans_interface.rb', line 51

def provision_types(params={})
  url = "#{base_path}/provision-types"
  headers = { params: params, authorization: "Bearer #{@access_token}" }
  execute(method: :get, url: url, headers: headers)
end

#update(id, payload) ⇒ Object



27
28
29
30
31
# File 'lib/morpheus/api/service_plans_interface.rb', line 27

def update(id, payload)
  url = "#{base_path}/#{id}"
  headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' }
  execute(method: :put, url: url, headers: headers, payload: payload.to_json)
end