remoteconsoles

package
v0.15.1-0...-d274060 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package remoteconsoles provides the ability to create server remote consoles through the Compute API. You need to specify at least "2.6" microversion for the ComputeClient to use that API.

Example of Creating a new RemoteConsole

computeClient, err := openstack.NewComputeV2(providerClient, endpointOptions)
computeClient.Microversion = "2.6"

createOpts := remoteconsoles.CreateOpts{
  Protocol: remoteconsoles.ConsoleProtocolVNC,
  Type:     remoteconsoles.ConsoleTypeNoVNC,
}
serverID := "b16ba811-199d-4ffd-8839-ba96c1185a67"

remtoteConsole, err := remoteconsoles.Create(computeClient, serverID, createOpts).Extract()
if err != nil {
  panic(err)
}

fmt.Printf("Console URL: %s\n", remtoteConsole.URL)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleProtocol

type ConsoleProtocol string

ConsoleProtocol represents valid remote console protocol. It can be used to create a remote console with one of the pre-defined protocol.

const (
	// ConsoleProtocolVNC represents the VNC console protocol.
	ConsoleProtocolVNC ConsoleProtocol = "vnc"

	// ConsoleProtocolSPICE represents the SPICE console protocol.
	ConsoleProtocolSPICE ConsoleProtocol = "spice"

	// ConsoleProtocolRDP represents the RDP console protocol.
	ConsoleProtocolRDP ConsoleProtocol = "rdp"

	// ConsoleProtocolSerial represents the Serial console protocol.
	ConsoleProtocolSerial ConsoleProtocol = "serial"

	// ConsoleProtocolMKS represents the MKS console protocol.
	ConsoleProtocolMKS ConsoleProtocol = "mks"
)

type ConsoleType

type ConsoleType string

ConsoleType represents valid remote console type. It can be used to create a remote console with one of the pre-defined type.

const (
	// ConsoleTypeNoVNC represents the VNC console type.
	ConsoleTypeNoVNC ConsoleType = "novnc"

	// ConsoleTypeXVPVNC represents the XVP VNC console type.
	ConsoleTypeXVPVNC ConsoleType = "xvpvnc"

	// ConsoleTypeRDPHTML5 represents the RDP HTML5 console type.
	ConsoleTypeRDPHTML5 ConsoleType = "rdp-html5"

	// ConsoleTypeSPICEHTML5 represents the SPICE HTML5 console type.
	ConsoleTypeSPICEHTML5 ConsoleType = "spice-html5"

	// ConsoleTypeSerial represents the Serial console type.
	ConsoleTypeSerial ConsoleType = "serial"

	// ConsoleTypeWebMKS represents the Web MKS console type.
	ConsoleTypeWebMKS ConsoleType = "webmks"
)

type CreateOpts

type CreateOpts struct {
	// Protocol specifies the protocol of a new remote console.
	Protocol ConsoleProtocol `json:"protocol" required:"true"`

	// Type specifies the type of a new remote console.
	Type ConsoleType `json:"type" required:"true"`
}

CreateOpts specifies parameters to the Create request.

func (CreateOpts) ToRemoteConsoleCreateMap

func (opts CreateOpts) ToRemoteConsoleCreateMap() (map[string]interface{}, error)

ToRemoteConsoleCreateMap builds a request body from the CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToRemoteConsoleCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult represents the result of a create operation. Call its Extract method to interpret it as a RemoteConsole.

func Create

func Create(client *gophercloud.ServiceClient, serverID string, opts CreateOptsBuilder) (r CreateResult)

Create requests the creation of a new remote console on the specified server.

func (CreateResult) Extract

func (r CreateResult) Extract() (*RemoteConsole, error)

Extract interprets any commonResult as a RemoteConsole.

type RemoteConsole

type RemoteConsole struct {
	// Protocol contains remote console protocol.
	// You can use the RemoteConsoleProtocol custom type to unmarshal raw JSON
	// response into the pre-defined valid console protocol.
	Protocol string `json:"protocol"`

	// Type contains remote console type.
	// You can use the RemoteConsoleType custom type to unmarshal raw JSON
	// response into the pre-defined valid console type.
	Type string `json:"type"`

	// URL can be used to connect to the remote console.
	URL string `json:"url"`
}

RemoteConsole represents the Compute service remote console object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL