lib/openstack/compute/server.rb
# Makes the actual API call to get information about the given server object.  If you are attempting to track the status or project of
# a server object (for example, when rebuilding, creating, or resizing a server), you will likely call this method within a loop until
# the status becomes "ACTIVE" or other conditions are met.
#
# Returns true if the API call succeeds.
#
#  >> server.refresh
#  => true
Makes the actual API call to get information about the given server object.  If you are attempting to track the status or project of
a server object (for example, when rebuilding, creating, or resizing a server), you will likely call this method within a loop until
the status becomes "ACTIVE" or other conditions are met.

Returns true if the API call succeeds.


Makes the actual API call to get information about the given server object . If you are attempting to track the status or project of a server object ( for example when rebuilding creating or resizing a server ) you will likely call this method within a loop until the status becomes " ACTIVE " or other conditions are met . Returns true if the API call succeeds .
def populate(data=nil)
      path = "/servers/#{URI.encode(@id.to_s)}"
      if data.nil? then
          response = @compute.connection.req("GET", path)
          OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)
          data = JSON.parse(response.body)["server"]
      end
      @id        = data["id"] || data["uuid"]
      @name      = data["name"]
      @libvirt_id = data["OS-EXT-SRV-ATTR:instance_name"]
      @fault = data["fault"]
      @status    = data["status"]
      @state  = data["OS-EXT-STS:task_state"]
      @progress  = data["progress"]
      @addresses = get_addresses(data["addresses"])
      @metadata  = OpenStack::Compute::Metadata.new(@compute, path, data["metadata"])
      @hostId    = data["hostId"]
      @image   = data["image"] || data["imageId"]
      @flavor  = data["flavor"] || data["flavorId"]
      @key_name = data["key_name"] 
      @created = data["created"]
      @security_groups = (data["security_groups"] || [])
      true
    end
def populate ( data = nil ) path = "/servers/#{URI.encode(@id.to_s)}" if data . nil? then response = @compute . connection . req ( "GET" , path ) OpenStack :: Exception . raise_exception ( response ) unless response . code . match ( / ^20.$ / ) data = JSON . parse ( response . body ) [ "server" ] end @id = data [ "id" ] || data [ "uuid" ] @name = data [ "name" ] @libvirt_id = data [ "OS-EXT-SRV-ATTR:instance_name" ] @fault = data [ "fault" ] @status = data [ "status" ] @state = data [ "OS-EXT-STS:task_state" ] @progress = data [ "progress" ] @addresses = get_addresses ( data [ "addresses" ] ) @metadata = OpenStack :: Compute :: Metadata . new ( @compute , path , data [ "metadata" ] ) @hostId = data [ "hostId" ] @image = data [ "image" ] || data [ "imageId" ] @flavor = data [ "flavor" ] || data [ "flavorId" ] @key_name = data [ "key_name" ] @created = data [ "created" ] @security_groups = ( data [ "security_groups" ] || [ ] ) true end
Makes the actual API call to get information about the given server object.
Makes the actual API call to get information about the given server object .
# if provider uses the keys API extension for accessing servers
data