def action(id, act, *args) 
      data = case act
        when "reboot" then {'reboot' =>{"type" => args[0]}}	
        when "vnc" then {'os-getVNCConsole' => { "type" => "novnc" }} 
        when "stop" then {'os-stop' => 'null'}
        when "start" then {'os-start' => 'null'}
        when "pause" then {'pause' => 'null'}
        when "unpause" then {'unpause' => 'null'}
        when "suspend" then {'suspend' => 'null'}
        when "resume" then {'resume' => 'null'}
        when "create_image" then {'createImage' => {'name' => args[0], 'metadata' => args[1]}} 
        else raise "Invalid Action"
        end
      return post_request(address("/servers/" + id + "/action"), data, @token)
    end
def action(id, act, *args) 
      data = case act
        when "reboot" then {'reboot' =>{"type" => args[0]}}	
        when "vnc" then {'os-getVNCConsole' => { "type" => "novnc" }} 
        when "stop" then {'os-stop' => 'null'}
        when "start" then {'os-start' => 'null'}
        when "pause" then {'pause' => 'null'}
        when "unpause" then {'unpause' => 'null'}
        when "suspend" then {'suspend' => 'null'}
        when "resume" then {'resume' => 'null'}
        when "create_image" then {'createImage' => {'name' => args[0], 'metadata' => args[1]}} 
        else raise "Invalid Action"
        end
      return post_request(address("/servers/" + id + "/action"), data, @token)
    end
Perform an action on a server on Openstack, by passing an id,
 and an action, some actions require more data.

 E.g. action(id, "reboot", "hard")