Class: Fog::Identity::OpenStack::V3::Service

Inherits:
OpenStack::Model show all
Defined in:
lib/fog/identity/openstack/v3/models/service.rb

Instance Attribute Summary

Attributes inherited from OpenStack::Model

#project

Instance Method Summary collapse

Methods inherited from OpenStack::Model

#initialize

Constructor Details

This class inherits a constructor from Fog::OpenStack::Model

Instance Method Details

#createObject


38
39
40
41
42
43
# File 'lib/fog/identity/openstack/v3/models/service.rb', line 38

def create
  merge_attributes(
    service.create_service(attributes).body['service']
  )
  self
end

#destroyObject


19
20
21
22
23
# File 'lib/fog/identity/openstack/v3/models/service.rb', line 19

def destroy
  requires :id
  service.delete_service(id)
  true
end

#saveObject


33
34
35
36
# File 'lib/fog/identity/openstack/v3/models/service.rb', line 33

def save
  requires :name
  identity ? update : create
end

#to_sObject


15
16
17
# File 'lib/fog/identity/openstack/v3/models/service.rb', line 15

def to_s
  name
end

#update(attr = nil) ⇒ Object


25
26
27
28
29
30
31
# File 'lib/fog/identity/openstack/v3/models/service.rb', line 25

def update(attr = nil)
  requires :id
  merge_attributes(
    service.update_service(id, attr || attributes).body['service']
  )
  self
end