Documentation ¶
Index ¶
- Constants
- Variables
- func HashNetworkSubresource(resource *schema.Resource) schema.SchemaSetFunc
- func Jo2JSON(arg_str string) string
- func Provider() *schema.Provider
- type AccountAclRecord
- type AccountRecord
- type AccountsListResp
- type ComputeBriefRecord
- type ComputeGetResp
- type ComputeListResp
- type ComputeNetMgmtRecord
- type ComputePfwListResp
- type ComputeRecord
- type ControllerCfg
- type DiskRecord
- type DisksListResp
- type ExtNetListResp
- type ExtNetRecord
- type ImageRecord
- type ImagesListResp
- type InterfaceQosRecord
- type InterfaceRecord
- type KvmVmCreateParam
- type LocationRecord
- type LocationsListResp
- type OsUserRecord
- type PfwRecord
- type QuotaRecord
- type ResgroupGetResp
- type ResgroupListResp
- type ResgroupRecord
- type ResgroupUpdateParam
- type ResourceRecord
- type RgListComputesResp
- type SnapSetRecord
- type SnapshotRecord
- type SshKeyConfig
- type UsageRecord
- type UserAclRecord
- type VinsRecord
- type VinsSearchRecord
- type VinsSearchResp
- type VnfGwConfigRecord
- type VnfRecord
Constants ¶
const ( MODE_UNDEF = iota // this is the invalid mode - it should never be seen MODE_LEGACY = iota MODE_OAUTH2 = iota MODE_JWT = iota )
enumerated constants that define authentication modes
const AccountsGetAPI = "/restmachine/cloudapi/account/get" // returns AccountRecord superset
const AccountsListAPI = "/restmachine/cloudapi/account/list" // returns list of abdridged info about accounts
const ComputeDeleteAPI = "/restmachine/cloudapi/compute/delete"
structures related to cloudapi/compute/delete API
const ComputeDiskAttachAPI = "/restmachine/cloudapi/compute/diskAttach"
structures related to /cloudapi/compute/disk Attach/Detach API
const ComputeDiskDetachAPI = "/restmachine/cloudapi/compute/diskDetach"
const ComputeGetAPI = "/restmachine/cloudapi/compute/get"
const ComputeListAPI = "/restmachine/cloudapi/compute/list"
const ComputeNetAttachAPI = "/restmachine/cloudapi/compute/netAttach"
const ComputeNetDetachAPI = "/restmachine/cloudapi/compute/netDetach"
const ComputePfwAddAPI = "/restmachine/cloudapi/compute/pfwAdd"
const ComputePfwDelAPI = "/restmachine/cloudapi/compute/pfwDel"
const ComputePfwListAPI = "/restmachine/cloudapi/compute/pfwList"
const ComputeResizeAPI = "/restmachine/cloudapi/compute/resize"
const ComputeStartAPI = "/restmachine/cloudapi/compute/start"
structures related to cloudapi/compute/start API
const ComputeStopAPI = "/restmachine/cloudapi/compute/stop"
const DisksCreateAPI = "/restmachine/cloudapi/disks/create"
structures related to /cloudapi/disks/create
const DisksDeleteAPI = "/restmachine/cloudapi/disks/delete"
structures related to /cloudapi/disks/delete
const DisksGetAPI = "/restmachine/cloudapi/disks/get" // Returns single DiskRecord on success
structures related to /cloudapi/disks/get
const DisksListAPI = "/restmachine/cloudapi/disks/list" // Returns list of DiskRecord on success
const DisksRenameAPI = "/restmachine/cloudapi/disks/rename"
structures related to /cloudapi/disks/resize
const DisksResizeAPI = "/restmachine/cloudapi/disks/resize2"
structures related to /cloudapi/disks/resize
const ExtNetListAPI = "/restmachine/cloudapi/extnet/list"
const ImagesListAPI = "/restmachine/cloudapi/image/list"
const KvmPPCCreateAPI = "/restmachine/cloudapi/kvmppc/create"
const KvmX86CreateAPI = "/restmachine/cloudapi/kvmx86/create"
structures related to /cloudapi/kvmXXX/create APIs
const LimitMaxVinsPerResgroup = 4
LimitMaxVinsPerResgroup set maximum number of VINs instances per Resource Group
const LocationsListAPI = "/restmachine/cloudapi/locations/list" // Returns list of GridRecord on success
const MaxCpusPerCompute = 128
MaxCpusPerCompute sets maximum number of vCPUs per compute
const MaxExtraDisksPerCompute = 12
MaxExtraDisksPerCompute sets maximum number of extra disks that can be added when creating new compute
const MaxNetworksPerCompute = 8
MaxNetworksPerCompute sets maximum number of vNICs per compute
const MaxSshKeysPerCompute = 12
MaxSshKeysPerCompute sets maximum number of user:ssh_key pairs to authorize when creating new compute
const MinRamPerCompute = 128
MinRamPerCompute sets minimum amount of RAM per compute in MB
const ResgroupCreateAPI = "/restmachine/cloudapi/rg/create"
structures related to /cloudapi/rg/create API call
const ResgroupDeleteAPI = "/restmachine/cloudapi/rg/delete"
structures related to /cloudapi/rg/delete API
const ResgroupGetAPI = "/restmachine/cloudapi/rg/get"
const ResgroupListAPI = "/restmachine/cloudapi/rg/list"
const ResgroupUpdateAPI = "/restmachine/cloudapi/rg/update"
structures related to /cloudapi/rg/update API call
const RgListComputesAPI = "/restmachine/cloudapi/rg/listComputes"
const VinsCreateInAccountAPI = "/restmachine/cloudapi/vins/createInAccount"
const VinsCreateInRgAPI = "/restmachine/cloudapi/vins/createInRG"
const VinsDeleteAPI = "/restmachine/cloudapi/vins/delete"
const VinsExtNetConnectAPI = "/restmachine/cloudapi/vins/extNetConnect"
const VinsExtNetDisconnectAPI = "/restmachine/cloudapi/vins/extNetDisconnect"
const VinsGetAPI = "/restmachine/cloudapi/vins/get"
const VinsSearchAPI = "/restmachine/cloudapi/vins/search"
Variables ¶
var DefaultGridID int
var Timeout180s = time.Second * 180
var Timeout30s = time.Second * 30
timeouts for API calls from CRUD functions of Terraform plugin
var Timeout60s = time.Second * 60
Functions ¶
func HashNetworkSubresource ¶
func HashNetworkSubresource(resource *schema.Resource) schema.SchemaSetFunc
HashNetworkSubresource hashes network subresource of compute resource. It uses specially designed networkSubresourceSerialize (see above) to make sure hashing does not involve attributes that we deem irrelevant to the uniqueness of network subresource definitions. It is this function that should be specified as SchemaSetFunc when creating Set from network subresource (e.g. in flattenCompute)
This function is based on the original Terraform function HashResource from helper/schema/set.go
Types ¶
type AccountAclRecord ¶
type AccountRecord ¶
type AccountRecord struct { // ACLs []UserAclRecord `json:"acl"` // CreatedTime uint64 `json:"creationTime"` // DeletedTime uint64 `json:"deletionTime"` ID int `json:"id"` Name string `json:"name"` Status string `json:"status"` }
structures related to /cloudapi/account/list API
type AccountsListResp ¶
type AccountsListResp []AccountRecord
type ComputeBriefRecord ¶
type ComputeBriefRecord struct { // we do not even include here all fields as returned by this API, but only the most important that // are really necessary to identify and distinguish computes AccountID int `json:"accountId"` AccountName string `json:"accountName"` Name string `json:"name"` ID uint `json:"id"` RgID int `json:"rgId"` RgName string `json:"rgName"` Status string `json:"status"` TechStatus string `json:"techStatus"` }
structures related to /cloudapi/rg/listComputes API
type ComputeGetResp ¶
type ComputeGetResp struct { // ACLs `json:"ACL"` - it is a dictionary, special parsing required AccountID int `json:"accountId"` AccountName string `json:"accountName"` Arch string `json:"arch"` BootDiskSize int `json:"bootdiskSize"` CloneReference int `json:"cloneReference"` Clones []int `json:"clones"` Cpu int `json:"cpus"` Desc string `json:"desc"` Disks []DiskRecord `json:"disks"` Driver string `json:"driver"` GridID int `json:"gid"` ID uint `json:"id"` ImageID int `json:"imageId"` ImageName string `json:"imageName"` Interfaces []InterfaceRecord `json:"interfaces"` LockStatus string `json:"lockStatus"` ManagerID int `json:"managerId"` ManagerType string `json:"manageType"` Name string `json:"name"` NatableVinsID int `json:"natableVinsId"` NatableVinsIP string `json:"natableVinsIp"` NatableVinsName string `json:"natableVinsName"` NatableVinsNet string `json:"natableVinsNetwork"` NatableVinsNetName string `json:"natableVinsNetworkName"` OsUsers []OsUserRecord `json:"osUsers"` Ram int `json:"ram"` RgID int `json:"rgId"` RgName string `json:"rgName"` SnapSets []SnapSetRecord `json:"snapSets"` Status string `json:"status"` // Tags []string `json:"tags"` // Tags were reworked since DECORT 3.7.1 TechStatus string `json:"techStatus"` TotalDiskSize int `json:"totalDiskSize"` UpdatedBy string `json:"updatedBy"` UpdateTime uint64 `json:"updateTime"` UserManaged bool `json:"userManaged"` Vgpus []int `json:"vgpus"` VinsConnected int `json:"vinsConnected"` VirtualImageID int `json:"virtualImageId"` }
type ComputeListResp ¶
type ComputeListResp []ComputeRecord
type ComputeNetMgmtRecord ¶
structures related to /cloudapi/compute/net Attach/Detach API
type ComputePfwListResp ¶
type ComputePfwListResp []PfwRecord
type ComputeRecord ¶
type ComputeRecord struct { AccountID int `json:"accountId"` AccountName string `json:"accountName"` ACLs []UserAclRecord `json:"acl"` Arch string `json:"arch"` BootDiskSize int `json:"bootdiskSize"` CloneReference int `json:"cloneReference"` Clones []int `json:"clones"` Cpus int `json:"cpus"` CreatedBy string `json:"createdBy"` CreatedTime uint64 `json:"createdTime"` DeletedBy string `json:"deletedBy"` DeletedTime uint64 `json:"deletedTime"` Desc string `json:"desc"` Disks []int `json:"disks"` GridID int `json:"gid"` ID uint `json:"id"` ImageID int `json:"imageId"` Interfaces []InterfaceRecord `json:"interfaces"` LockStatus string `json:"lockStatus"` ManagerID int `json:"managerId"` Name string `json:"name"` Ram int `json:"ram"` RgID int `json:"rgId"` RgName string `json:"rgName"` SnapSets []SnapSetRecord `json:"snapSets"` Status string `json:"status"` // Tags []string `json:"tags"` // Tags were reworked since DECORT 3.7.1 TechStatus string `json:"techStatus"` TotalDiskSize int `json:"totalDiskSize"` UpdatedBy string `json:"updatedBy"` UpdateTime uint64 `json:"updateTime"` UserManaged bool `json:"userManaged"` Vgpus []int `json:"vgpus"` VinsConnected int `json:"vinsConnected"` VirtualImageID int `json:"virtualImageId"` }
type ControllerCfg ¶
type ControllerCfg struct {
// contains filtered or unexported fields
}
func ControllerConfigure ¶
func ControllerConfigure(d *schema.ResourceData) (*ControllerCfg, error)
type DiskRecord ¶
type DiskRecord struct { // ACLs `json:"ACL"` - it is a dictionary, special parsing required // was - Acl map[string]string `json:"acl"` AccountID int `json:"accountId"` AccountName string `json:"accountName"` // NOTE: absent from compute/get output BootPartition int `json:"bootPartition"` CreatedTime uint64 `json:"creationTime"` DeletedTime uint64 `json:"deletionTime"` Desc string `json:"desc"` DestructionTime uint64 `json:"destructionTime"` DiskPath string `json:"diskPath"` GridID int `json:"gid"` ID uint `json:"id"` ImageID int `json:"imageId"` Images []int `json:"images"` // IOTune 'json:"iotune" - it is a dictionary Name string `json:"name"` // Order `json:"order"` ParentId int `json:"parentId"` PciSlot int `json:"pciSlot"` // ResID string `json:"resId"` // ResName string `json:"resName"` // Params string `json:"params"` Pool string `json:"pool"` PurgeTime uint64 `json:"purgeTime"` // Role string `json:"role"` SepType string `json:"sepType"` SepID int `json:"sepId"` // NOTE: absent from compute/get output SizeMax int `json:"sizeMax"` SizeUsed int `json:"sizeUsed"` // sum over all snapshots of this disk to report total consumed space Snapshots []SnapshotRecord `json:"snapshots"` Status string `json:"status"` TechStatus string `json:"techStatus"` Type string `json:"type"` ComputeID int `json:"vmid"` }
type DisksListResp ¶
type DisksListResp []DiskRecord
type ExtNetListResp ¶
type ExtNetListResp []ExtNetRecord
type ExtNetRecord ¶
type ExtNetRecord struct { Name string `json:"name"` ID uint `json:"id"` IPCIDR string `json:"ipcidr"` }
structures related to /cloudapi/extnet/list API
type ImageRecord ¶
type ImageRecord struct { AccountID uint `json:"accountId"` Arch string `json:"architecture"` BootType string `json:"bootType"` IsBootable bool `json:"bootable"` IsCdrom bool `json:"cdrom"` Desc string `json:"desc"` IsHotResize bool `json:"hotResize"` ID uint `json:"id"` Name string `json:"name"` Pool string `json:"pool"` SepID int `json:"sepId"` Size int `json:"size"` Status string `json:"status"` Type string `json:"type"` Username string `json:"username"` IsVirtual bool `json:"virtual"` }
structures related to /restmachine/cloudapi/image/list API
type ImagesListResp ¶
type ImagesListResp []ImageRecord
type InterfaceQosRecord ¶
type InterfaceRecord ¶
type InterfaceRecord struct { ConnID int `json:"connId"` // This is VLAN ID or VxLAN ID, depending on ConnType ConnType string `json:"connType"` // Either "VLAN" or "VXLAN" tag DefaultGW string `json:"defGw"` Guid string `json:"guid"` IPAddress string `json:"ipAddress"` // without trailing network mask, i.e. "192.168.1.3" MAC string `json:"mac"` Name string `json:"name"` NetID int `json:"netId"` // This is either ExtNet ID or ViNS ID, depending on NetType NetMask int `json:"netMask"` NetType string `json:"netType"` // Either "EXTNET" or "VINS" tag PciSlot int `json:"pciSlot"` Target string `json:"target"` Type string `json:"type"` VNFs []int `json:"vnfs"` QOS InterfaceQosRecord `json:"qos"` }
type KvmVmCreateParam ¶
type KvmVmCreateParam struct { RgID uint `json:"rgId"` Name string `json:"name"` Cpu int `json:"cpu"` Ram int `json:"ram"` ImageID int `json:"imageId"` BootDisk int `json:"bootDisk"` NetType string `json:"netType"` NetId int `json:"netId"` IPAddr string `json:"ipAddr"` UserData string `json:"userdata"` Desc string `json:"desc"` Start bool `json:"start"` }
type LocationRecord ¶
type LocationRecord struct { GridID int `json:"gid"` Id int `json:"id"` LocationCode string `json:"locationCode"` Name string `json:"name"` Flag string `json:"flag"` }
Grid ID structures
type LocationsListResp ¶
type LocationsListResp []LocationRecord
type OsUserRecord ¶
type PfwRecord ¶
type PfwRecord struct { ID int `json:"id"` LocalIP string `json:"localIp"` LocalPort int `json:"localPort"` Protocol string `json:"protocol"` PublicPortEnd int `json:"publicPortEnd"` PublicPortStart int `json:"publicPortStart"` ComputeID int `json:"vmId"` }
structures related to /cloudapi/portforwarding/list API
type QuotaRecord ¶
type QuotaRecord struct { Cpu int `json:"CU_C"` // CPU count in pcs Ram float64 `json:"CU_M"` // RAM volume in MB, it is STILL reported as FLOAT Disk int `json:"CU_D"` // Disk capacity in GB ExtIPs int `json:"CU_I"` // Ext IPs count ExtTraffic int `json:"CU_NP"` // Ext network traffic GpuUnits int `json:"gpu_units"` // GPU count }
structures related to /cloudapi/rg/get API call
type ResgroupGetResp ¶
type ResgroupGetResp struct { ACLs []UserAclRecord `json:"ACLs"` Usage UsageRecord `json:"Resources"` AccountID int `json:"accountId"` AccountName string `json:"accountName"` GridID int `json:"gid"` CreatedBy string `json:"createdBy"` CreatedTime uint64 `json:"createdTime"` DefaultNetID int `json:"def_net_id"` DefaultNetType string `json:"def_net_type"` DeletedBy string `json:"deletedBy"` DeletedTime uint64 `json:"deletedTime"` Desc string `json:"desc"` ID uint `json:"id"` LockStatus string `json:"lockStatus"` Name string `json:"name"` Quota QuotaRecord `json:"resourceLimits"` Status string `json:"status"` UpdatedBy string `json:"updatedBy"` UpdatedTime uint64 `json:"updatedTime"` Vins []int `json:"vins"` Computes []int `json:"vms"` Ignored map[string]interface{} `json:"-"` }
type ResgroupListResp ¶
type ResgroupListResp []ResgroupRecord
type ResgroupRecord ¶
type ResgroupRecord struct { ACLs []UserAclRecord `json:"acl"` Owner AccountAclRecord `json:"accountAcl"` AccountID int `json:"accountId"` AccountName string `json:"accountName"` CreatedBy string `json:"createdBy"` CreatedTime uint64 `json:"createdTime"` DefaultNetID int `json:"def_net_id"` DefaultNetType string `json:"def_net_type"` Decsription string `json:"desc"` GridID int `json:"gid"` ID uint `json:"id"` LockStatus string `json:"lockStatus"` Name string `json:"name"` Status string `json:"status"` UpdatedBy string `json:"updatedBy"` UpdatedTime uint64 `json:"updatedTime"` Vins []int `json:"vins"` Computes []int `json:"vms"` }
type ResgroupUpdateParam ¶
type ResourceRecord ¶
type RgListComputesResp ¶
type RgListComputesResp []ComputeBriefRecord
type SnapSetRecord ¶
type SnapshotRecord ¶
type SnapshotRecord struct { Guid string `json:"guid"` Label string `json:"label"` SnapSetGuid string `json:"snapSetGuid"` SnapSetTime uint64 `json:"snapSetTime"` TimeStamp uint64 `json:"timestamp"` }
structures related to /cloudapi/compute/get
type SshKeyConfig ¶
Auxiliary structures
type UsageRecord ¶
type UsageRecord struct { Current ResourceRecord `json:"Current"` Reserved ResourceRecord `json:"Reserved"` }
type UserAclRecord ¶
type UserAclRecord struct { IsExplicit bool `json:"explicit"` Rights string `json:"right"` Status string `json:"status"` Type string `json:"type"` UgroupID string `json:"userGroupId"` }
structures related to /cloudapi/rg/list API
type VinsRecord ¶
type VinsRecord struct { ID int `json:"id"` Name string `json:"name"` IPCidr string `json:"network"` VxLanID int `json:"vxlanId"` ExternalIP string `json:"externalIP"` AccountID int `json:"accountId"` AccountName string `json:"accountName"` RgID int `json:"rgid"` RgName string `json:"rgName"` VNFs map[string]VnfRecord `json:"vnfs"` Desc string `json:"desc"` }
type VinsSearchRecord ¶
type VinsSearchRecord struct { ID int `json:"id"` Name string `json:"name"` IPCidr string `json:"network"` VxLanID int `json:"vxlanId"` ExternalIP string `json:"externalIP"` AccountID int `json:"accountId"` AccountName string `json:"accountName"` RgID int `json:"rgId"` RgName string `json:"rgName"` }
this is the structure of the element in the list returned by vins/search API
type VinsSearchResp ¶
type VinsSearchResp []VinsSearchRecord
type VnfGwConfigRecord ¶
Source Files ¶
- constants.go
- controller.go
- data_source_account.go
- data_source_compute.go
- data_source_disk.go
- data_source_image.go
- data_source_rg.go
- data_source_vins.go
- disk_subresource.go
- interface_subresource.go
- models_api.go
- network_subresource.go
- osusers_subresource.go
- provider.go
- quota_subresource.go
- resource_compute.go
- resource_disk.go
- resource_pfw.go
- resource_rg.go
- resource_vins.go
- ssh_subresource.go
- utility_account.go
- utility_compute.go
- utility_disk.go
- utility_general.go
- utility_location.go
- utility_pfw.go
- utility_rg.go
- utility_vins.go