Class: Fog::Compute::RackspaceV2::Real

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudflock/patch/fog.rb

Instance Method Summary collapse

Instance Method Details

#rescue_server(server_id) ⇒ Excon::Response

Note:

Rescue mode is only guaranteed to be active for 90 minutes.

Puts server into rescue mode

  • Status Transition:

    • ACTIVE -> PREP_RESCUE -> RESCUE

Parameters:

  • server_id (String)

    id of server to rescue

Returns:

  • (Excon::Response)

    response

Raises:

  • (Fog::Rackspace::Errors::NotFound)
    • HTTP 404

  • (Fog::Rackspace::Errors::BadRequest)
    • HTTP 400

  • (Fog::Rackspace::Errors::InternalServerError)
    • HTTP 500

  • (Fog::Rackspace::Errors::ServiceError)

See Also:



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/cloudflock/patch/fog.rb', line 59

def rescue_server(server_id)
  data = {
    'rescue' => nil
  }

  request(
    :body => Fog::JSON.encode(data),
    :expects => [200],
    :method => 'POST',
    :path => "servers/#{server_id}/action"
  )
end

#unrescue_server(server_id) ⇒ Excon::Response

Take server out of rescue mode

  • Status Transition:

    • RESCUE -> PREP_UNRESCUE -> ACTIVE

Parameters:

  • server_id (String)

    id of server

Returns:

  • (Excon::Response)

    response

Raises:

  • (Fog::Rackspace::Errors::NotFound)
    • HTTP 404

  • (Fog::Rackspace::Errors::BadRequest)
    • HTTP 400

  • (Fog::Rackspace::Errors::InternalServerError)
    • HTTP 500

  • (Fog::Rackspace::Errors::ServiceError)

See Also:



83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/cloudflock/patch/fog.rb', line 83

def unrescue_server(server_id)
  data = {
    'unrescue' => nil
  }

  request(
    :body => Fog::JSON.encode(data),
    :expects => [202],
    :method => 'POST',
    :path => "servers/#{server_id}/action"
  )
end