swagger

package
v0.0.0-...-a406aea Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	HostNetworksManagementApi *HostNetworksManagementApiService

	VMManagementApi *VMManagementApiService

	VMNetworkAdaptersManagementApi *VMNetworkAdaptersManagementApiService

	VMPowerManagementApi *VMPowerManagementApiService

	VMSharedFoldersManagementApi *VMSharedFoldersManagementApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the VMware Workstation REST API API v1.3.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type GenericSwaggerError

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

GenericSwaggerError Provides access to the body, error and model on returned errors.

func (GenericSwaggerError) Body

func (e GenericSwaggerError) Body() []byte

Body returns the raw bytes of the response

func (GenericSwaggerError) Error

func (e GenericSwaggerError) Error() string

Error returns non-empty string if there was an error.

func (GenericSwaggerError) Model

func (e GenericSwaggerError) Model() interface{}

Model returns the unpacked model of the error

type HostNetworksManagementApiService

type HostNetworksManagementApiService service

func (*HostNetworksManagementApiService) CreateNetwork

func (a *HostNetworksManagementApiService) CreateNetwork(ctx context.Context, parameters CreateVmnetParameter) (Network, *http.Response, error)

HostNetworksManagementApiService Creates a virtual network

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param parameters Host network to be created

@return Network

func (*HostNetworksManagementApiService) DeletePortforward

func (a *HostNetworksManagementApiService) DeletePortforward(ctx context.Context, vmnet string, protocol string, port int32) (*http.Response, error)

HostNetworksManagementApiService Deletes port forwarding

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vmnet NAT type of virtual network
  • @param protocol Protocol type: tcp, udp
  • @param port Host port number

func (*HostNetworksManagementApiService) GetAllNetworks

func (a *HostNetworksManagementApiService) GetAllNetworks(ctx context.Context) (Networks, *http.Response, error)

HostNetworksManagementApiService Returns all virtual networks

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return Networks

func (*HostNetworksManagementApiService) GetMACToIPs

func (a *HostNetworksManagementApiService) GetMACToIPs(ctx context.Context, vmnet string) (MactoIps, *http.Response, error)

HostNetworksManagementApiService Returns all MAC-to-IP settings for DHCP service

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vmnet Virtual network that has DHCP enabled

@return MactoIps

func (*HostNetworksManagementApiService) GetPortforwards

func (a *HostNetworksManagementApiService) GetPortforwards(ctx context.Context, vmnet string) (Portforwards, *http.Response, error)

HostNetworksManagementApiService Returns all port forwardings

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vmnet NAT type of virtual network

@return Portforwards

func (*HostNetworksManagementApiService) UpdateMacToIP

func (a *HostNetworksManagementApiService) UpdateMacToIP(ctx context.Context, vmnet string, mac string, parameters MacToIpParameter) (ErrorModel, *http.Response, error)

HostNetworksManagementApiService Updates the MAC-to-IP binding

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vmnet Virtual network that enabled DHCP
  • @param mac Mac address that want to be mapped with a given IP
  • @param parameters IP that will be assigned to given Mac address. If empty IP, the original Mac to IP binding will be deleted

@return ErrorModel

func (*HostNetworksManagementApiService) UpdatePortforward

func (a *HostNetworksManagementApiService) UpdatePortforward(ctx context.Context, vmnet string, protocol string, port int32, parameters PortforwardParameter) (ErrorModel, *http.Response, error)

HostNetworksManagementApiService Updates port forwarding

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param vmnet NAT type of virtual network
  • @param protocol Protocol type: tcp, udp
  • @param port Host port number
  • @param parameters Guest to forward to

@return ErrorModel

type VMManagementApiService

type VMManagementApiService service

func (*VMManagementApiService) ConfigVMParams

func (a *VMManagementApiService) ConfigVMParams(ctx context.Context, id string, parameters ConfigVmParamsParameter) (ErrorModel, *http.Response, error)

VMManagementApiService update the vm config params

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param parameters Parameters set to the VM

@return ErrorModel

func (*VMManagementApiService) CreateVM

func (a *VMManagementApiService) CreateVM(ctx context.Context, params VmCloneParameter) (VmInformation, *http.Response, error)

VMManagementApiService Creates a copy of the VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param params Parameters of VM to create

@return VmInformation

func (*VMManagementApiService) DeleteVM

func (a *VMManagementApiService) DeleteVM(ctx context.Context, id string) (*http.Response, error)

VMManagementApiService Deletes a VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM

func (*VMManagementApiService) GetAllVMs

func (a *VMManagementApiService) GetAllVMs(ctx context.Context) ([]Vmid, *http.Response, error)

VMManagementApiService Returns a list of VM IDs and paths for all VMs

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().

@return []Vmid

func (*VMManagementApiService) GetVM

func (a *VMManagementApiService) GetVM(ctx context.Context, id string) (VmInformation, *http.Response, error)

VMManagementApiService Returns the VM setting information of a VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM

@return VmInformation

func (*VMManagementApiService) GetVMParams

func (a *VMManagementApiService) GetVMParams(ctx context.Context, id string, name string) (ConfigVmParamsParameter, *http.Response, error)

VMManagementApiService Get the VM config params

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param name Name of the param

@return ConfigVmParamsParameter

func (*VMManagementApiService) GetVMRestrictions

func (a *VMManagementApiService) GetVMRestrictions(ctx context.Context, id string) (VmRestrictionsInformation, *http.Response, error)

VMManagementApiService Returns the restrictions information of the VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM

@return VmRestrictionsInformation

func (*VMManagementApiService) RegisterVM

func (a *VMManagementApiService) RegisterVM(ctx context.Context, parameters VmRegisterParameter) (VmRrgistrationInformation, *http.Response, error)

VMManagementApiService Register VM to VM Library

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param parameters Parameters of the VM to register

@return VmRrgistrationInformation

func (*VMManagementApiService) UpdateVM

func (a *VMManagementApiService) UpdateVM(ctx context.Context, id string, parameters VmParameter) (VmInformation, *http.Response, error)

VMManagementApiService Updates the VM settings

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param parameters VM definition

@return VmInformation

type VMNetworkAdaptersManagementApiService

type VMNetworkAdaptersManagementApiService service

func (*VMNetworkAdaptersManagementApiService) CreateNICDevice

func (a *VMNetworkAdaptersManagementApiService) CreateNICDevice(ctx context.Context, id string, parameters NicDeviceParameter) (NicDevice, *http.Response, error)

VMNetworkAdaptersManagementApiService Creates a network adapter in the VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param parameters Parameters of network adapter to create

@return NicDevice

func (*VMNetworkAdaptersManagementApiService) DeleteNICDevice

func (a *VMNetworkAdaptersManagementApiService) DeleteNICDevice(ctx context.Context, id string, index string) (*http.Response, error)

VMNetworkAdaptersManagementApiService Deletes a VM network adapter

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param index Index of VM network adapter

func (*VMNetworkAdaptersManagementApiService) GetAllNICDevices

func (a *VMNetworkAdaptersManagementApiService) GetAllNICDevices(ctx context.Context, id string) (NicDevices, *http.Response, error)

VMNetworkAdaptersManagementApiService Returns all network adapters in the VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM

@return NicDevices

func (*VMNetworkAdaptersManagementApiService) GetIPAddress

func (a *VMNetworkAdaptersManagementApiService) GetIPAddress(ctx context.Context, id string) (InlineResponse200, *http.Response, error)

VMNetworkAdaptersManagementApiService Returns the IP address of a VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM

@return InlineResponse200

func (*VMNetworkAdaptersManagementApiService) GetNicInfo

func (a *VMNetworkAdaptersManagementApiService) GetNicInfo(ctx context.Context, id string) (NicIpStackAll, *http.Response, error)

VMNetworkAdaptersManagementApiService Returns the IP stack configuration of all NICs of a VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM

@return NicIpStackAll

func (*VMNetworkAdaptersManagementApiService) UpdateNICDevice

func (a *VMNetworkAdaptersManagementApiService) UpdateNICDevice(ctx context.Context, id string, index string, parameters NicDeviceParameter) (NicDevice, *http.Response, error)

VMNetworkAdaptersManagementApiService Updates a network adapter in the VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param index Index of VM network adapter
  • @param parameters Parameters of network adapter to update to

@return NicDevice

type VMPowerManagementApiService

type VMPowerManagementApiService service

func (*VMPowerManagementApiService) ChangePowerState

func (a *VMPowerManagementApiService) ChangePowerState(ctx context.Context, id string, operation VmPowerOperation) (VmPowerState, *http.Response, error)

VMPowerManagementApiService Changes the VM power state

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param operation VM power operation: on, off, shutdown, suspend, pause, unpause

@return VmPowerState

func (*VMPowerManagementApiService) GetPowerState

func (a *VMPowerManagementApiService) GetPowerState(ctx context.Context, id string) (VmPowerState, *http.Response, error)

VMPowerManagementApiService Returns the power state of the VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM

@return VmPowerState

type VMSharedFoldersManagementApiService

type VMSharedFoldersManagementApiService service

func (*VMSharedFoldersManagementApiService) CreateSharedFolder

func (a *VMSharedFoldersManagementApiService) CreateSharedFolder(ctx context.Context, id string, parameters SharedFolder) (SharedFolders, *http.Response, error)

VMSharedFoldersManagementApiService Mounts a new shared folder in the VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param parameters Parameters of the shared folder to mount

@return SharedFolders

func (*VMSharedFoldersManagementApiService) DeleteSharedFolder

func (a *VMSharedFoldersManagementApiService) DeleteSharedFolder(ctx context.Context, id string, folderId string) (*http.Response, error)

VMSharedFoldersManagementApiService Deletes a shared folder

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param folderId ID of shared folder

func (*VMSharedFoldersManagementApiService) GetAllSharedFolders

func (a *VMSharedFoldersManagementApiService) GetAllSharedFolders(ctx context.Context, id string) (SharedFolders, *http.Response, error)

VMSharedFoldersManagementApiService Returns all shared folders mounted in the VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM

@return SharedFolders

func (*VMSharedFoldersManagementApiService) UpdataSharedFolder

func (a *VMSharedFoldersManagementApiService) UpdataSharedFolder(ctx context.Context, id string, folderId string, parameters SharedFolderParameter) (SharedFolders, *http.Response, error)

VMSharedFoldersManagementApiService Updates a shared folder mounted in the VM

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param id ID of VM
  • @param folderId ID of VM shared folder
  • @param parameters Parameters of the shared folder to update to

@return SharedFolders

Jump to

Keyboard shortcuts

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