Sha256: d40a01430d8b3dd800d5d4aee4edeca8d63582bd44b34204ab5b5b31aa4f1db7

Contents?: true

Size: 1.19 KB

Versions: 125

Compression:

Stored size: 1.19 KB

Contents

module Fog
  module Compute
    class OpenStack
      class Real
        # Get a vnc console for an instance.
        #
        # === Parameters
        # * server_id <~String> - The ID of the server.
        # * console_type <~String> - Type of vnc console to get ('novnc' or 'xvpvnc').
        # === Returns
        # * response <~Excon::Response>:
        #   * body <~Hash>:
        #     * url <~String>
        #     * type <~String>
        def get_vnc_console(server_id, console_type)
          body = {
            'os-getVNCConsole' => {
              'type' => console_type
            }
          }
          server_action(server_id, body)
        end # def get_vnc_console
      end # class Real

      class Mock
        def get_vnc_console(server_id, console_type)
          response = Excon::Response.new
          response.status = 200
          response.body = {
            "console" => {
              "url"  => "http://192.168.27.100:6080/vnc_auto.html?token=c3606020-d1b7-445d-a88f-f7af48dd6a20",
              "type" => "novnc"
            }
          }
          response
        end # def get_vnc_console
      end # class Mock
    end # class OpenStack
  end # module Compute
end # module Fog

Version data entries

125 entries across 125 versions & 17 rubygems

Version Path
fog-openstack-0.1.10 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.9 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.8 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.7 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.6 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.5 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.4 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.3 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.2 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.1 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-openstack-0.1.0 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-1.37.0 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-1.36.0 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-1.35.0 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-2.0.0.pre.0 lib/fog/openstack/requests/compute/get_vnc_console.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-1.34.0 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-1.33.0 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-1.32.0 lib/fog/openstack/requests/compute/get_vnc_console.rb
fog-1.31.0 lib/fog/openstack/requests/compute/get_vnc_console.rb