vsphere

package
v0.0.0-...-e9e6512 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: Apache-2.0, BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPluginCapability

func NewPluginCapability(cap cmi.PluginCapability_RPC_Type) *cmi.PluginCapability

NewPluginCapability TODO

Types

type IdentityPlugin

type IdentityPlugin struct {
	*cmicommon.DefaultIdentityServer
}

IdentityPlugin implements the cmi.IdentityServer clients

func NewIdentityPlugin

func NewIdentityPlugin(p *Plugin, spi PluginSPI) *IdentityPlugin

NewIdentityPlugin returns a new IdentityPlugin

func (*IdentityPlugin) GetPluginCapabilities

GetPluginCapabilities gets capabilities of the plugin

func (*IdentityPlugin) GetPluginInfo

GetPluginInfo returns the Server details

func (*IdentityPlugin) Probe

Probe tries to probe the server and returns a response

type MachinePlugin

type MachinePlugin struct {
	*cmicommon.DefaultMachineServer
	SPI PluginSPI
}

MachinePlugin implements the cmi.MachineServer It also implements the pluginSPI interface

func NewMachinePlugin

func NewMachinePlugin(p *Plugin, spi PluginSPI) *MachinePlugin

NewMachinePlugin returns a new MachinePlugin

func (*MachinePlugin) CreateMachine

CreateMachine handles a machine creation request REQUIRED METHOD

REQUEST PARAMETERS (cmi.CreateMachineRequest) MachineName string Contains the name of the machine object for whom an VM is to be created at the provider ProviderSpec bytes(blob) Template/Configuration of the machine to be created is given by at the provider Secrets map<string,bytes> (Optional) Contains a map from string to string contains any cloud specific secrets that can be used by the provider LastKnownState bytes(blob) (Optional) Last known state of VM during last operation. Could be helpful to continue operation from previous state

RESPONSE PARAMETERS (cmi.CreateMachineResponse) ProviderID string Unique identification of the VM at the cloud provider. This could be the same/different from req.MachineName.

ProviderID typically matches with the node.Spec.ProviderID on the node object.
Eg: gce://project-name/region/vm-ProviderID

NodeName string Returns the name of the node-object that the VM register's with Kubernetes.

This could be different from req.MachineName as well

LastKnownState bytes(blob) (Optional) Last known state of VM during the current operation.

Could be helpful to continue operations in future requests.

OPTIONAL IMPLEMENTATION LOGIC It is optionally expected by the safety controller to use an identification mechanisms to map the VM Created by a providerSpec. These could be done using tag(s)/resource-groups etc. This logic is used by safety controller to delete orphan VMs which are not backed by any machine CRD

func (*MachinePlugin) DeleteMachine

DeleteMachine handles a machine deletion request

REQUEST PARAMETERS (cmi.DeleteMachineRequest) MachineName string Contains the name of the machine object for the backing VM(s) have to be deleted ProviderSpec bytes(blob) Template/Configuration of the machine to be deleted is given by at the provider Secrets map<string,bytes> (Optional) Contains a map from string to string contains any cloud specific secrets that can be used by the provider LastKnownState bytes(blob) (Optional) Last known state of VM during last operation. Could be helpful to continue operation from previous state

RESPONSE PARAMETERS (cmi.DeleteMachineResponse) LastKnownState bytes(blob) (Optional) Last known state of VM during the current operation.

Could be helpful to continue operations in future requests.

func (*MachinePlugin) GetMachineStatus

GetMachineStatus handles a machine get status request OPTIONAL METHOD

REQUEST PARAMETERS (cmi.GetMachineStatusRequest) MachineName string Contains the name of the machine object for whose status is to be retrived ProviderSpec bytes(blob) Template/Configuration of the machine whose status is to be retrived Secrets map<string,bytes> (Optional) Contains a map from string to string contains any cloud specific secrets that can be used by the provider

RESPONSE PARAMETERS (cmi.GetMachineStatueResponse) ProviderID string Unique identification of the VM at the cloud provider. This could be the same/different from req.MachineName.

ProviderID typically matches with the node.Spec.ProviderID on the node object.
Eg: gce://project-name/region/vm-ProviderID

NodeName string Returns the name of the node-object that the VM register's with Kubernetes.

This could be different from req.MachineName as well

func (*MachinePlugin) GetVolumeIDs

GetVolumeIDs returns a list of Volume IDs for all PV Specs for whom an provider volume was found

REQUEST PARAMETERS (cmi.GetVolumeIDsRequest) PVSpecList bytes(blob) PVSpecsList is a list PV specs for whom volume-IDs are required. Plugin should parse this raw data into pre-defined list of PVSpecs.

RESPONSE PARAMETERS (cmi.GetVolumeIDsResponse) VolumeIDs repeated string VolumeIDs is a repeated list of VolumeIDs.

func (*MachinePlugin) ListMachines

ListMachines lists all the machines possibilly created by a providerSpec Identifying machines created by a given providerSpec depends on the OPTIONAL IMPLEMENTATION LOGIC you have used to identify machines created by a providerSpec. It could be tags/resource-groups etc OPTIONAL METHOD

REQUEST PARAMETERS (cmi.ListMachinesRequest) ProviderSpec bytes(blob) Template/Configuration of the machine that wouldn've been created by this ProviderSpec (Machine Class) Secrets map<string,bytes> (Optional) Contains a map from string to string contains any cloud specific secrets that can be used by the provider

RESPONSE PARAMETERS (cmi.ListMachinesResponse) MachineList map<string,string> A map containing the keys as the MachineID and value as the MachineName

for all machine's who where possibilly created by this ProviderSpec

func (*MachinePlugin) ShutDownMachine

ShutDownMachine handles a machine shutdown/power-off/stop request OPTIONAL METHOD

REQUEST PARAMETERS (cmi.ShutDownMachineRequest) ProviderSpec bytes(blob) Template/Configuration of the machine that wouldn've been created by this ProviderSpec (Machine Class) Secrets map<string,bytes> (Optional) Contains a map from string to string contains any cloud specific secrets that can be used by the provider LastKnownState bytes(blob) (Optional) Last known state of VM during last operation. Could be helpful to continue operation from previous state

RESPONSE PARAMETERS (cmi.DeleteMachineResponse) LastKnownState bytes(blob) (Optional) Last known state of VM during the current operation.

Could be helpful to continue operations in future requests.

type Plugin

type Plugin struct {
	// CMIPlugin contains details about the CMIPlugin object
	CMIPlugin *cmicommon.DefaultPlugin
	// contains filtered or unexported fields
}

Plugin returns the new provider details

func NewPlugin

func NewPlugin(endpoint string) *Plugin

NewPlugin returns a newly created plugin object

func (*Plugin) Run

func (p *Plugin) Run()

Run starts a new gRPC server to start the plugin

type PluginSPI

type PluginSPI interface {
}

PluginSPI provides an interface to deal with cloud provider session You can optionally enhance this interface to add interface methods here You can use it to mock cloud provider calls

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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