Class: Fog::Compute::GoGrid::Password

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/go_grid/models/compute/password.rb

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Password

Returns a new instance of Password


16
17
18
# File 'lib/fog/go_grid/models/compute/password.rb', line 16

def initialize(attributes={})
  super
end

Instance Method Details

#destroyObject


20
21
22
23
24
# File 'lib/fog/go_grid/models/compute/password.rb', line 20

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

#imageObject


26
27
28
29
# File 'lib/fog/go_grid/models/compute/password.rb', line 26

def image
  requires :image_id
  service.grid_image_get(image_id)
end

#ready?Boolean

Returns:

  • (Boolean)

31
32
33
# File 'lib/fog/go_grid/models/compute/password.rb', line 31

def ready?
  @state == 'On'
end

#saveObject

Raises:

  • (Fog::Errors::Error)

35
36
37
38
39
40
41
# File 'lib/fog/go_grid/models/compute/password.rb', line 35

def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted?
  requires :password_id
  data = service.support_password_list()
  merge_attributes(data.body)
  true
end