Class: Jellyfish::ManageIQ::Provisioner

Inherits:
Provisioner
  • Object
show all
Defined in:
lib/jellyfish/manageiq/provisioner.rb

Direct Known Subclasses

BigData, Databases

Instance Method Summary collapse

Instance Method Details

#provisionObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/jellyfish/manageiq/provisioner.rb', line 4

def provision
  @miq_settings = Jellyfish::ManageIQ.miq_settings

  provision_path = "api/service_catalogs/#{service_catalog_id}/service_templates"
  provision_url = "#{@miq_settings[:miq_url]}/api/service_templates/#{service_template_id}"

  @order_item.provision_status = :unknown
  @order_item.payload_request = payload('order', provision_url)
  @order_item.save!

  handle_response(provision_path)
end

#retireObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/jellyfish/manageiq/provisioner.rb', line 17

def retire
  @miq_settings = Jellyfish::ManageIQ.miq_settings

  retire_path = "api/services/#{instance_id}"
  retire_url = "#{@miq_settings[:miq_url]}/#{retire_path}"

  @order_item.provision_status = :unknown
  @order_item.payload_request = payload('retire', retire_url)
  @order_item.save!

  handle_response(retire_path)

  @order_item.provision_status = 'retired'
  @order_item.save!
end