Sha256: 9cf8de6021e558476af4445e16790500d6140c80b87a9372004ca878c579323b

Contents?: true

Size: 1.19 KB

Versions: 14

Compression:

Stored size: 1.19 KB

Contents

module Fog
  module Compute
    class OpenStack
      class Real
        # Retrieve server actions.
        #
        # === Parameters
        # * server_id <~String> - The ID of the server to query for available actions.
        # === Returns
        # * actions <~Array>
        def server_actions(server_id)
          request(
            :expects  => 200,
            :method   => 'GET',
            :path     => "servers/#{server_id}/os-instance-actions"
          ).body['instanceActions']
        end # def server_actions
      end # class Real

      class Mock
        def server_actions(server_id)
          response = Excon::Response.new
          response.status = 200
          response.body = [{
            'instance_uuid' => server_id,
            'user_id'       => '7067d67a2b23435ca2366588680b66c3',
            'start_time'    => Time.now.iso8601,
            'request_id'    => "req-#{server_id}",
            'action'        => 'stop',
            'message'       => nil,
            'project_id'    => '9d5d0b877cf449fdae078659cfa12e86'
          }]
          response
        end # def server_actions
      end # class Mock
    end # class OpenStack
  end # module Compute
end # moduel Fog

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
fog-openstack-0.1.10 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.9 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.8 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.7 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.6 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.5 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.4 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.3 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.2 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.1 lib/fog/openstack/requests/compute/server_actions.rb
fog-openstack-0.1.0 lib/fog/openstack/requests/compute/server_actions.rb
fog-1.37.0 lib/fog/openstack/requests/compute/server_actions.rb
fog-1.36.0 lib/fog/openstack/requests/compute/server_actions.rb
fog-1.35.0 lib/fog/openstack/requests/compute/server_actions.rb