Versions in this module Expand all Collapse all v3 v3.0.0 Mar 12, 2020 Changes in this version + const DiskExposeProtocolNBD + var ErrAuthentication = errors.New("OVC authentication error") + var ErrClaimNotPresent = fmt.Errorf("claim was not found in the JWT token") + var ErrExpiredJWT = fmt.Errorf("JWT is expired") + var ErrInvalidJWT = fmt.Errorf("invalid JWT token") + var ErrNotFound = errors.New("Resource not found") + func GetLock(vmID int) + func ReleaseLock(vmID int) + func SetJWTPublicKey(key string) error + type ACL struct + CanBeDeleted bool + Right string + Status string + Type string + UserGroupID string + type Account struct + ID int + Name string + type AccountACL struct + Explicit bool + GUID string + Right string + Status string + Type string + UserGroupID string + type AccountInfo struct + ACL []AccountACL + CreationTime int + ID int + Name string + UpdateTime int + type AccountService interface + GetIDByName func(string) (int, error) + List func() (*[]AccountInfo, error) + type AccountServiceOp struct + func (s *AccountServiceOp) GetIDByName(account string) (int, error) + func (s *AccountServiceOp) List() (*[]AccountInfo, error) + type Client struct + Access string + Accounts AccountService + CloudSpaces CloudSpaceService + Disks DiskService + ExternalNetworks ExternalNetworkService + Images ImageService + Ipsec IpsecService + JWT *JWT + Locations LocationService + Machines MachineService + Portforwards ForwardingService + ServerURL string + Sizes SizesService + Templates TemplateService + func NewClient(c *Config) (*Client, error) + func (c *Client) GetLocation() string + func (c *Client) Post(endpoint string, in interface{}, timeout ResponseTimeout) ([]byte, error) + func (c *Client) PostRaw(endpoint string, raw io.Reader, timeout ResponseTimeout) ([]byte, error) + type CloudSpace struct + ACL []ACL + AccountID int + CreationTime int + Description string + Externalnetworkip string + GridID int + ID int + Location string + Mode string + Name string + PrivateNetwork string + Publicipaddress string + ResourceLimits ResourceLimits + Secret string + Status string + Type string + UpdateTime int + type CloudSpaceConfig struct + Access string + AccountID int + AllowedVMSizes []int + CloudSpaceID int + ExternalnetworkID int + Location string + MaxCPUCapacity int + MaxDiskCapacity int + MaxMemoryCapacity float64 + MaxNetworkPeerTransfer int + MaxNumPublicIP int + Mode string + Name string + PrivateNetwork string + Type string + type CloudSpaceDeleteConfig struct + CloudSpaceID int + Permanently bool + type CloudSpaceInfo struct + ACL []ACL + AccountACL AccountACL + AccountID int + AccountName string + CreationTime int + Descr string + Externalnetworkip string + GridID int + ID int + Location string + Mode string + Name string + Publicipaddress string + Status string + Type string + UpdateTime int + type CloudSpaceService interface + Create func(*CloudSpaceConfig) (int, error) + Delete func(*CloudSpaceDeleteConfig) error + Get func(int) (*CloudSpace, error) + GetByNameAndAccount func(string, string) (*CloudSpace, error) + List func() (*[]CloudSpaceInfo, error) + SetDefaultGateway func(int, string) error + Update func(*CloudSpaceConfig) error + type CloudSpaceServiceOp struct + func (s *CloudSpaceServiceOp) Create(cloudSpaceConfig *CloudSpaceConfig) (int, error) + func (s *CloudSpaceServiceOp) Delete(cloudSpaceConfig *CloudSpaceDeleteConfig) error + func (s *CloudSpaceServiceOp) Get(id int) (*CloudSpace, error) + func (s *CloudSpaceServiceOp) GetByNameAndAccount(cloudSpaceName string, account string) (*CloudSpace, error) + func (s *CloudSpaceServiceOp) List() (*[]CloudSpaceInfo, error) + func (s *CloudSpaceServiceOp) SetDefaultGateway(id int, gateway string) error + func (s *CloudSpaceServiceOp) Update(cloudSpaceConfig *CloudSpaceConfig) error + type Config struct + ClientID string + ClientSecret string + JWT string + Logger Logger + URL string + Verbose bool + type Credentials struct + Password string + Username string + type Disk struct + AccountID int + Description string + ID int + Name string + Size int + Status string + Type string + Username interface{} + type DiskAttachConfig struct + DiskID int + MachineID int + type DiskConfig struct + AccountID int + Description string + Detach bool + DiskID int + DiskName string + GridID int + IOPS int + MachineID int + Name string + Permanently string + SSDSize int + Size int + Type string + type DiskDeleteConfig struct + Detach bool + DiskID int + Permanently bool + type DiskEndPointDescriptor interface + Protocol func() string + type DiskExposeConfig struct + CloudSpaceID int + DiskID int + IOPS int + Protocol string + type DiskExposeInfo struct + EndPoint DiskEndPointDescriptor + Protocol string + func (i *DiskExposeInfo) UnmarshalJSON(b []byte) error + type DiskInfo struct + AccountID int + BootPartition int + Ckey string + Descr string + DiskPath string + GUID int + GridID int + ID int + Images []interface{} + Iotune IOTune + Iqn string + Login string + Meta []interface{} + Name string + Order int + PCIBus int + PCISlot int + Params string + Passwd string + RealityDeviceNumber int + ReferenceID string + Role string + SizeMax int + SizeUsed int + Status string + Type string + type DiskService interface + Attach func(*DiskAttachConfig) error + Create func(*DiskConfig) (int, error) + CreateAndAttach func(*DiskConfig) (int, error) + Delete func(*DiskDeleteConfig) error + Detach func(*DiskAttachConfig) error + Expose func(*DiskExposeConfig) (*DiskExposeInfo, error) + Get func(int) (*DiskInfo, error) + GetByName func(string, int, string) (*DiskInfo, error) + List func(int, string) (*[]Disk, error) + Resize func(*DiskConfig) error + Unexpose func(*DiskUnexposeConfig) error + Update func(*DiskConfig) error + type DiskServiceOp struct + func (s *DiskServiceOp) Attach(diskAttachConfig *DiskAttachConfig) error + func (s *DiskServiceOp) Create(diskConfig *DiskConfig) (int, error) + func (s *DiskServiceOp) CreateAndAttach(diskConfig *DiskConfig) (int, error) + func (s *DiskServiceOp) Delete(diskConfig *DiskDeleteConfig) error + func (s *DiskServiceOp) Detach(diskAttachConfig *DiskAttachConfig) error + func (s *DiskServiceOp) Expose(diskExposeConfig *DiskExposeConfig) (*DiskExposeInfo, error) + func (s *DiskServiceOp) Get(id int) (*DiskInfo, error) + func (s *DiskServiceOp) GetByName(name string, accountID int, diskType string) (*DiskInfo, error) + func (s *DiskServiceOp) List(accountID int, diskType string) (*[]Disk, error) + func (s *DiskServiceOp) Resize(diskConfig *DiskConfig) error + func (s *DiskServiceOp) Unexpose(diskUnexposeConfig *DiskUnexposeConfig) error + func (s *DiskServiceOp) Update(diskConfig *DiskConfig) error + type DiskUnexposeConfig struct + DiskID int + type EmptyMachineConfig struct + CloudspaceID int + DataDisks []int + Description string + Disksize int + Memory int + Name string + Userdata string + Vcpus int + type ExternalNetworkConfig struct + AccountID int + Name string + type ExternalNetworkInfo struct + AccountID int + DHCP bool + Gateway string + ID int + Name string + Network string + Subnetmask string + type ExternalNetworkService interface + Get func(int) (*ExternalNetworkInfo, error) + List func(int) (*[]ExternalNetworkInfo, error) + type ExternalNetworkServiceOp struct + func (s *ExternalNetworkServiceOp) Get(id int) (*ExternalNetworkInfo, error) + func (s *ExternalNetworkServiceOp) GetByName(name string, accountID string) (*ExternalNetworkInfo, error) + func (s *ExternalNetworkServiceOp) List(accountID int) (*[]ExternalNetworkInfo, error) + type ForwardingService interface + Create func(*PortForwardingConfig) (int, error) + Delete func(*PortForwardingConfig) error + DeleteByPort func(int, string, int) error + Get func(*PortForwardingConfig) (*PortForwardingInfo, error) + List func(*PortForwardingConfig) (*[]PortForwardingInfo, error) + Update func(*PortForwardingConfig) error + type ForwardingServiceOp struct + func (s *ForwardingServiceOp) Create(portForwardingConfig *PortForwardingConfig) (int, error) + func (s *ForwardingServiceOp) Delete(portForwardingConfig *PortForwardingConfig) error + func (s *ForwardingServiceOp) DeleteByPort(publicPort int, publicIP string, cloudSpaceID int) error + func (s *ForwardingServiceOp) Get(portForwardingConfig *PortForwardingConfig) (*PortForwardingInfo, error) + func (s *ForwardingServiceOp) List(portForwardingConfig *PortForwardingConfig) (*[]PortForwardingInfo, error) + func (s *ForwardingServiceOp) Update(portForwardingConfig *PortForwardingConfig) error + type IOTune struct + TotalIopsSec int + type ImageConfig struct + AccountID int + BootType string + GridID int + Name string + Password string + Type string + URL string + Username string + type ImageInfo struct + AccountID int + Description string + ID int + Name string + Size int + Status string + Type string + Username string + type ImageService interface + Delete func(int) error + DeleteSystemImage func(int, string) error + List func(int) (*[]ImageInfo, error) + Upload func(*ImageConfig) error + type ImageServiceOp struct + func (s *ImageServiceOp) Delete(id int) error + func (s *ImageServiceOp) DeleteSystemImage(id int, reason string) error + func (s *ImageServiceOp) List(accountID int) (*[]ImageInfo, error) + func (s *ImageServiceOp) Upload(imageConfig *ImageConfig) error + type IpsecConfig struct + CloudspaceID int + PskSecret string + RemotePrivateNetwork string + RemotePublicAddr string + type IpsecInfo struct + PSK string + RemoteAddr string + RemotePrivateNetwork string + type IpsecService interface + Create func(*IpsecConfig) (string, error) + Delete func(*IpsecConfig) error + List func(*IpsecConfig) (*[]IpsecInfo, error) + type IpsecServiceOp struct + func (s *IpsecServiceOp) Create(ipsecConfig *IpsecConfig) (string, error) + func (s *IpsecServiceOp) Delete(ipsecConfig *IpsecConfig) error + func (s *IpsecServiceOp) List(ipsecConfig *IpsecConfig) (*[]IpsecInfo, error) + type JWT struct + func NewJWT(jwtStr string, idProvider string, logger *logrus.Entry) (*JWT, error) + func NewJWTFromIYO(jwtStr string, logger Logger) (*JWT, error) + func (j *JWT) Claim(key string) (interface{}, error) + func (j *JWT) Get() (string, error) + type LocationInfo struct + Code string + Flag string + GUID int + GridID int + ID int + Name string + type LocationList []LocationInfo + type LocationService interface + List func() (*LocationList, error) + type LocationServiceOp struct + func (s *LocationServiceOp) List() (*LocationList, error) + type Logger interface + Debug func(args ...interface{}) + Debugf func(format string, args ...interface{}) + Error func(args ...interface{}) + Errorf func(format string, args ...interface{}) + Fatal func(args ...interface{}) + Fatalf func(format string, args ...interface{}) + Info func(args ...interface{}) + Infof func(format string, args ...interface{}) + Panic func(args ...interface{}) + Panicf func(format string, args ...interface{}) + Warn func(args ...interface{}) + Warnf func(format string, args ...interface{}) + WithError func(err error) Logger + WithField func(key string, value interface{}) Logger + WithFields func(fields map[string]interface{}) Logger + type LogrusAdapter struct + func (l LogrusAdapter) WithError(err error) Logger + func (l LogrusAdapter) WithField(key string, value interface{}) Logger + func (l LogrusAdapter) WithFields(fields map[string]interface{}) Logger + type Machine struct + CreationTime int + Disks []int + ID int + ImageID int + Memory int + Name string + Nics []NIC + ReferenceID string + SizeID int + StackID int + Status string + Storage int + UpdateTime int + Vcpus int + type MachineConfig struct + CloudspaceID int + DataDisks []interface{} + Description string + Disksize int + ImageID int + MachineID string + Memory int + Name string + Permanently bool + SizeID int + Userdata string + Vcpus int + type MachineDisk struct + Descr string + ID int + Name string + SizeMax int + Status string + Type string + type MachineInfo struct + ACL []ACL + Accounts []UserAccount + CloudspaceID int + CreationTime int + Description *string + Disks []MachineDisk + Hostname string + ID int + ImageID int + Interfaces []NIC + Locked bool + Memory int + Name string + OsImage string + SizeID int + Status string + Storage int + UpdateTime int + Vcpus int + type MachineService interface + AddExternalIP func(int, int) error + Create func(*MachineConfig) (int, error) + CreateEmpty func(*EmptyMachineConfig) (int, error) + CreateImage func(int, string) error + Delete func(int, bool) error + DeleteExternalIP func(int, int, string) error + Get func(int) (*MachineInfo, error) + GetByName func(string, int) (*MachineInfo, error) + GetByReferenceID func(string) (*MachineInfo, error) + List func(int) (*[]Machine, error) + Resize func(*MachineConfig) (string, error) + Shutdown func(int) error + Start func(int, int) error + Stop func(int, bool) error + Update func(*MachineConfig) (string, error) + type MachineServiceOp struct + func (s *MachineServiceOp) AddExternalIP(id int, externalNetworkID int) error + func (s *MachineServiceOp) Create(machineConfig *MachineConfig) (int, error) + func (s *MachineServiceOp) CreateEmpty(emptyMachineConfig *EmptyMachineConfig) (int, error) + func (s *MachineServiceOp) CreateImage(id int, imageName string) error + func (s *MachineServiceOp) Delete(id int, permanently bool) error + func (s *MachineServiceOp) DeleteExternalIP(id int, externalNetworkID int, externalNetworkIP string) error + func (s *MachineServiceOp) Get(id int) (*MachineInfo, error) + func (s *MachineServiceOp) GetByName(name string, cloudspaceID int) (*MachineInfo, error) + func (s *MachineServiceOp) GetByReferenceID(referenceID string) (*MachineInfo, error) + func (s *MachineServiceOp) List(cloudSpaceID int) (*[]Machine, error) + func (s *MachineServiceOp) Resize(machineConfig *MachineConfig) (string, error) + func (s *MachineServiceOp) Shutdown(id int) error + func (s *MachineServiceOp) Start(id int, diskID int) error + func (s *MachineServiceOp) Stop(id int, force bool) error + func (s *MachineServiceOp) Update(machineConfig *MachineConfig) (string, error) + type NBDDiskEndPointDescriptor struct + Address string + Name string + Port int + Psk string + User string + func (*NBDDiskEndPointDescriptor) Protocol() string + type NIC struct + DeviceName string + GUID string + IPAddress string + MacAddress string + NetworkID int + Params string + ReferenceID string + Status string + Type string + type PortForwardingConfig struct + CloudspaceID int + ID int + LocalPort int + MachineID int + Protocol string + PublicIP string + PublicPort int + SourceProtocol string + SourcePublicIP string + SourcePublicPort int + type PortForwardingInfo struct + ID int + LocalIP string + LocalPort string + MachineID int + MachineName string + Protocol string + PublicIP string + PublicPort string + type ResourceLimits struct + CUC int + CUD int + CUI int + CUM float64 + CUNP int + type ResponseTimeout time.Duration + const DataActionTimeout + const ModelActionTimeout + const OperationalActionTimeout + type Size struct + Description string + Disks []int + ID int + Memory int + Name string + Vcpus int + type SizesService interface + GetByVcpusAndMemory func(int, int, int) (*Size, error) + List func(int) (*[]Size, error) + type SizesServiceOp struct + func (s *SizesServiceOp) GetByVcpusAndMemory(vcpus int, memory int, cloudspaceID int) (*Size, error) + func (s *SizesServiceOp) List(cloudspaceID int) (*[]Size, error) + type Template struct + AccountID int + Description string + ID int + Name string + Size int + Status string + Type string + Username interface{} + type TemplateService interface + List func(int) (*[]Template, error) + type TemplateServiceOp struct + func (s *TemplateServiceOp) List(accountID int) (*[]Template, error) + type UserAccount struct + GUID string + Login string + Password string Other modules containing this package github.com/gig-tech/ovc-sdk-go github.com/gig-tech/ovc-sdk-go/v2 github.com/gig-tech/ovc-sdk-go/v4