Class: Fog::OpenStack::Identity::V3::OsCredential
- Inherits:
-
Model
- Object
- Model
- Model
- Fog::OpenStack::Identity::V3::OsCredential
show all
- Defined in:
- lib/fog/openstack/identity/v3/models/os_credential.rb
Instance Attribute Summary
Attributes inherited from Model
#project
Instance Method Summary
collapse
Methods inherited from Model
#initialize
Instance Method Details
#create ⇒ Object
42
43
44
45
46
47
48
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 42
def create
merge_attributes(
service.create_os_credential(attributes).body['credential']
)
@parsed_blob = nil
self
end
|
#destroy ⇒ Object
20
21
22
23
24
25
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 20
def destroy
requires :id
service.delete_os_credential(id)
@parsed_blob = nil
true
end
|
#fingerprint ⇒ Object
63
64
65
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 63
def fingerprint
parsed_blob['fingerprint'] if blob
end
|
#name ⇒ Object
55
56
57
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 55
def name
parsed_blob['name'] if blob
end
|
#parsed_blob ⇒ Object
50
51
52
53
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 50
def parsed_blob
@parsed_blob = ::JSON.parse(blob) unless @parsed_blob
@parsed_blob
end
|
#private_key ⇒ Object
67
68
69
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 67
def private_key
parsed_blob['private_key'] if blob
end
|
#public_key ⇒ Object
59
60
61
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 59
def public_key
parsed_blob['public_key'] if blob
end
|
#save ⇒ Object
36
37
38
39
40
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 36
def save
requires :blob, :type
@parsed_blob = nil
identity ? update : create
end
|
#to_s ⇒ Object
16
17
18
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 16
def to_s
name
end
|
#update(attr = nil) ⇒ Object
27
28
29
30
31
32
33
34
|
# File 'lib/fog/openstack/identity/v3/models/os_credential.rb', line 27
def update(attr = nil)
requires :id
merge_attributes(
service.update_os_credential(id, attr || attributes).body['credential']
)
@parsed_blob = nil
self
end
|