Sha256: 19338f08b706b62920b42245eb74fa511be1499da23fd851be3fff71dab5916a

Contents?: true

Size: 1.07 KB

Versions: 25

Compression:

Stored size: 1.07 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
      end

      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
      end
    end
  end
end

Version data entries

25 entries across 23 versions & 3 rubygems

Version Path
fog-openstack-0.1.31 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.10 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.1.30 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.1.29 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.9 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.1.28 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.8 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.7 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.6 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.5 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.4 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.3 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.2 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.3.0 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.2.4 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.2.3 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.2.2 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.2.1 lib/fog/compute/openstack/requests/server_actions.rb
fog-openstack-0.2.0 lib/fog/compute/openstack/requests/server_actions.rb
fog-zj-0.1.28 lib/fog/compute/openstack/requests/server_actions.rb