ovmHelper

package
v0.0.0-...-4a0fa1c Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2018 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListVdm []Vdm

Functions

This section is empty.

Types

type CfgVm

type CfgVm struct {
	NetworkId    string
	SendMessages *[]KeyValuePair
	RootPassword *[]KeyValuePair
}

type Client

type Client struct {
	User     string
	Password string
	BaseURL  *url.URL

	Vms    *VmService
	Vmcds  *VmcdService
	Vmcsms *VmcsmService
	Vmcnms *VmcnmService
	Vns    *VnService
	Vds    *VdService
	Vdms   *VdmService
	Jobs   *JobService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(user string, password string, baseUrl string) *Client

func (*Client) Do

func (pc *Client) Do(req *http.Request, v interface{}) (*http.Response, error)

func (*Client) NewRequest

func (pc *Client) NewRequest(method string, rsc string, params map[string]string, data interface{}) (*http.Request, error)

type Id

type Id struct {
	Type  string `json:"type,omitempty"`
	Value string `json:"value,omitempty"`
	Uri   string `json:"uri,omitempty"`
	Name  string `json:"name,omitempty"`
}

type JobError

type JobError struct {
	Message string `json:"message"`
}

func (*JobError) Error

func (j *JobError) Error() string

type JobResponse

type JobResponse struct {
	Id                           *Id       `json:"id"`
	Done                         bool      `json:"done,omitempty"`
	ResultId                     *Id       `json:"resultId,omitempty"`
	ResourceGroupIds             *[]Id     `json:"resourceGroupIds,omitempty"`
	SummaryDone                  bool      `json:"summaryDone,omitempty"`
	JobGroup                     bool      `json:"jobGroup,omitempty"`
	JobRunState                  string    `json:"jobRunState,omitempty"`
	JobSummaryState              string    `json:"jobSummaryState,omitempty"`
	AbortedByUser                string    `json:"abortedByUser,omitempty"`
	ExtraInfo                    string    `json:"extraInfo,omitempty"`
	Name                         string    `json:"name,omitempty"`
	Description                  string    `json:"description,omitempty"`
	Locked                       bool      `json:"locked,omitempty"`
	ReadOnly                     bool      `json:"readOnly,omitempty"`
	Generation                   int       `json:"generation,omitempty"`
	ProgressMessage              string    `json:"progressMessage,omitempty"`
	LatestSummaryProgressMessage string    `json:"latestSummaryProgressMessage,omitempty"`
	StartTime                    int64     `json:"startTime,omitempty"`
	EndTime                      int64     `json:"endTime,omitempty"`
	ParentJobId                  *Id       `json:"parentJobId,omitempty"`
	ChildJobIds                  *[]Id     `json:"childJobIds,omitempty"`
	Error                        *JobError `json:"error,omitempty"`
	User                         string    `json:"user,omitempty"`
	WsErrorCode                  string    `json:"wsErrorCode,omitempty"`
}

type JobService

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

func (*JobService) Read

func (j *JobService) Read(id string) (*JobResponse, error)

func (*JobService) Running

func (j *JobService) Running(id string) bool

func (*JobService) WaitForJob

func (j *JobService) WaitForJob(id string)

type KeyValuePair

type KeyValuePair struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Vd

type Vd struct {
	DiskType              string `json:"diskType,omitempty"` // "VIRTUAL_DISK",
	Size                  int    `json:"size,omitempty"`     //Bytes multiple of 4096
	OnDiskSize            int    `json:"onDiskSize,omitempty"`
	Path                  string `json:"path,omitempty"`
	VmDiskMappingIds      []*Id  `json:"vmDiskMappingIds,omitempty"`
	RepositoryId          *Id    `json:"repositoryId,omitempty"`
	Shareable             bool   `json:"shareable,omitempty"`
	ImportFileName        string `json:"importFileName,omitempty"`
	AbsolutePath          string `json:"absolutePath,omitempty"`
	MountedPath           string `json:"mountedPath,omitempty"`
	AssemblyVirtualDiskId *Id    `json:"assemblyVirtualDiskId,omitempty"`
	Id                    *Id    `json:"id,omitempty"`
	Name                  string `json:"name,omitempty"`
	Description           string `json:"description,omitempty"`
	Locked                bool   `json:"locked,omitempty"`   //false,
	ReadOnly              bool   `json:"readOnly,omitempty"` //: false,
	Generation            int    `json:"generation,omitempty"`
	/*"userData" : [ {
	  "key" : "...",
	  "value" : "..."
	}, ... ],*/
	ResourceGroupIds []*Id `json:"resourceGroupIds,omitempty"`
}

type VdService

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

func (*VdService) Create

func (v *VdService) Create(repositoryId string, sparse bool, vd Vd) (*string, error)

func (*VdService) Delete

func (v *VdService) Delete(repositoryId string, vdId string) error

func (*VdService) Read

func (v *VdService) Read(id string) (*Vd, error)

func (*VdService) Update

func (v *VdService) Update(vdId string, vd Vd) error

type Vdm

type Vdm struct {
	VmId                *Id    `json:"vmId,omitempty"`
	VirtualDiskId       *Id    `json:"virtualDiskId,omitempty"`
	DiskTarget          int    `json:"diskTarget"`
	EmulatedBlockDevice bool   `json:"emulatedBlockDevice,omitempty"` // false,
	StorageElementId    *Id    `json:"storageElementId,omitempty"`
	DiskWriteMode       string `json:"diskWriteMode,omitempty"` // "READ_ONLY",READ_WRITE
	Id                  *Id    `json:"id,omitempty"`
	Name                string `json:"name,omitempty"`        //: "...",
	Description         string `json:"description,omitempty"` //  : "...",
	Locked              bool   `json:"locked,omitempty"`      // false,
	ReadOnly            bool   `json:"readOnly,omitempty"`    //false,
	Generation          int    `json:"generation,omitempty"`
	ResourceGroupIds    *[]Id  `json:"resourceGroupIds,omitempty"` //" : [ {  }, ... ]

}

vmDiskMapping element The VmDiskMapping object contains the relationships of the VirtualDisk and StorageElement for a Vm.

type VdmService

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

func (*VdmService) Create

func (v *VdmService) Create(vdm Vdm) (*string, error)

func (*VdmService) Delete

func (v *VdmService) Delete(vmId string, vdmId string) error

func (*VdmService) List

func (v *VdmService) List(vmId string) (*[]Vdm, error)

func (*VdmService) Read

func (v *VdmService) Read(vmId string, vdmId string) (*Vdm, error)

type Vm

type Vm struct {
	Id   *Id    `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
	//The following fields of the new Vm are optional:
	//BootOrder          []string
	CpuCount                 int    `json:"cpuCount,omitempty"`
	CpuCountLimit            int    `json:"cpuCountLimit,omitempty"`
	CpuPriority              int    `json:"cpuPriority,omitempty"`
	CpuUtilizationCap        int    `json:"cpuUtilizationCap,omitempty"`
	HighAvailability         bool   `json:"highAvailability,omitempty"`
	HugePagesEnabled         bool   `json:"hugePagesEnabled,omitempty"`
	KeymapName               string `json:"keymapName,omitempty"`
	Memory                   int    `json:"memory,omitempty"`
	MemoryLimit              int    `json:"memoryLimit,omitempty"`
	NetworkInstallPath       string `json:"networkInstallPath,omitempty"`
	OsType                   string `json:"osType,omitempty"`
	VmDomainType             string `json:"vmDomainType,omitempty"`
	VmMouseType              string `json:"vmMouseType,omitempty"`
	VmRunState               string `json:"vmRunState,omitempty"`
	VmStartPolicy            string `json:"vmStartPolicy,omitempty"`
	SslVncPort               int    `json:"sslVncPort,omitempty"`
	SslTtyPort               string `json:"sslTtyPort,omitempty"`
	AffinityGroupIds         []int  `json:"affinityGroupIds,omitempty"`
	OsVersion                string `json:"osVersion,omitempty"`
	KernelVersion            string `json:"kernelVersion,omitempty"`
	GuestDriverVersion       string `json:"guestDriverVersion,omitempty"`
	VmApiVersion             string `json:"vmApiVersion,omitempty"`
	CurrentMemory            int    `json:"currentMemory,omitempty"`
	CurrentCpuCount          int    `json:"currentCpuCount,omitempty"`
	CurrentDomainId          int    `json:"currentDomainId,omitempty"`
	VmConfigFileAbsolutePath string `json:"vmConfigFileAbsolutePath,omitempty"`
	VmConfigFileMountedPath  string `json:"vmConfigFileMountedPath,omitempty"`
	Architecture             string `json:"architecture,omitempty"`
	VmDiskMappingIds         *[]Id  `json:"vmDiskMappingIds,omitempty"`
	VirtualNicIds            *[]Id  `json:"virtualNicIds,omitempty"`
	RepositoryId             *Id    `json:"repositoryId,omitempty"`
	ServerPoolId             *Id    `json:"serverPoolId,omitempty"`
	ServerId                 *Id    `json:"serverId,omitempty"`
	Generation               int    `json:"generation,omitempty"`
}

type VmService

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

func (*VmService) CloneVm

func (v *VmService) CloneVm(cloneVmId string, vmCloneDefinitionId string, vm Vm, cfgVm CfgVm) (*string, error)

func (*VmService) CreateVm

func (v *VmService) CreateVm(vm Vm, cfgVm CfgVm) (*string, error)

func (*VmService) DeleteVm

func (v *VmService) DeleteVm(vmId string) error

func (*VmService) Read

func (v *VmService) Read(id string) (*Vm, error)

func (*VmService) SendMessageToVm

func (v *VmService) SendMessageToVm(vmId string, cfgVm CfgVm) error

func (*VmService) SendRootPasswordToVm

func (v *VmService) SendRootPasswordToVm(vmId string, cfgVm CfgVm) error

func (*VmService) Start

func (v *VmService) Start(id string) error

func (*VmService) Stop

func (v *VmService) Stop(id string) error

func (*VmService) UpdateVm

func (v *VmService) UpdateVm(vmId string, vm Vm) error

type Vmcd

type Vmcd struct {
	VmId                     *Id    `json:"vmId,omitempty"`
	VmCloneNetworkMappingIds *[]Id  `json:"vmCloneNetworkMappingIds,omitempty"`
	VmCloneStorageMappingIds *[]Id  `json:"vmCloneStorageMappingIds,omitempty"`
	Id                       *Id    `json:"id,omitempty"`
	Name                     string `json:"name,omitempty"`
	Description              string `json:"description,omitempty"`
	Locked                   bool   `json:"locked,imitempty"`
	ReadOnly                 bool   `json:"readOnly,omitempty"`
	Generation               int    `json:"generation,omitempty"`
	ResourceGroupIds         *[]Id  `json:"resourceGroupIds,omitempty"`
}

type VmcdService

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

func (*VmcdService) Create

func (v *VmcdService) Create(VmId string, vmcd Vmcd) (*string, error)

func (*VmcdService) Delete

func (v *VmcdService) Delete(vmId string, vmCloneDefinitionId string) error

func (*VmcdService) Read

func (v *VmcdService) Read(vmcdId string) (*Vmcd, error)

type Vmcnm

type Vmcnm struct {
	NetworkId           *Id    `json:"networkId,omitempty"`
	VmCloneDefinitionId *Id    `json:"vmCloneDefinitionId,omitempty"`
	VirtualNicId        *Id    `json:"virtualNicId,omitempty"`
	Id                  *Id    `json:"id,omitempty"`
	Name                string `json:"name,omitempty"`
	Description         string `json:"description,omitempty"`
	Locked              bool   `json:"locked,imitempty"`
	ReadOnly            bool   `json:"readOnly,omitempty"`
	Generation          int    `json:"generation,omitempty"`
	ResourceGroupIds    *[]Id  `json:"resourceGroupIds,omitempty"`
}

type VmcnmService

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

func (*VmcnmService) Create

func (v *VmcnmService) Create(vmCloneDefinitionId string, vmcnm Vmcnm) (*string, error)

func (*VmcnmService) Delete

func (v *VmcnmService) Delete(vmCloneDefinitionId string, vmcnmId string) error

func (*VmcnmService) Read

func (v *VmcnmService) Read(vmcnmId string) (*Vmcnm, error)

type Vmcsm

type Vmcsm struct {
	VmDiskMappingId     *Id    `json:"vmDiskMappingId,omitempty"`
	VmCloneDefinitionId *Id    `json:"vmCloneDefinitionId,omitempty"`
	RepositoryId        *Id    `json:"repositoryId,omitempty"`
	StorageArrayId      *Id    `json:"storageArrayId,omitempty"`
	StorageElementId    *Id    `json:",omitempty"`
	Id                  *Id    `json:"id,omitempty"`
	CloneType           string `json:"cloneType,omitempty"`
	Name                string `json:"name,omitempty"`
	Description         string `json:"description,omitempty"`
	Locked              bool   `json:"locked,imitempty"`
	ReadOnly            bool   `json:"readOnly,omitempty"`
	Generation          int    `json:"generation,omitempty"`
	ResourceGroupIds    *[]Id  `json:"resourceGroupIds,omitempty"`
}

type VmcsmService

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

func (*VmcsmService) Create

func (v *VmcsmService) Create(vmCloneDefinitionId string, vmcsm Vmcsm) (*string, error)

func (*VmcsmService) Delete

func (v *VmcsmService) Delete(vmCloneDefinitionId string, vmcsmId string) error

func (*VmcsmService) Read

func (v *VmcsmService) Read(vmcsmId string) (*Vmcsm, error)

type Vn

type Vn struct {
	MacAddress string `json:"macAddress,omitempty"`
	//IpAddresses   *[]Id  `json:"ipAddresses,omitempty"`
	//InterfaceName string `json:"interfaceName,omitempty"`
	VmId      *Id    `json:"vmId,omitempty"`
	NetworkId *Id    `json:"networkId,omitempty"`
	Id        *Id    `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	//Description      string `json:description,omitempty"`
	//Locked           bool   `json:locked,omitempty"`
	//ReadOnly         bool   `json:readOnly,omitempty"`
	Generation int `json:"generation,omitempty"`
}

type VnService

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

func (*VnService) Create

func (v *VnService) Create(vmId string, vn Vn) (*string, error)

func (*VnService) Delete

func (v *VnService) Delete(vnId string, vn Vn) error

func (*VnService) Read

func (v *VnService) Read(id string) (*Vn, error)

Jump to

Keyboard shortcuts

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