Documentation ¶
Index ¶
- Constants
- Variables
- func Jo2JSON(arg_str string) string
- func Provider() *schema.Provider
- type AccountAclRecord
- type AcountExtNetworksResp
- type CloudspaceRecord
- type CloudspacesGetResp
- type CloudspacesListResp
- type CloudspacesUpdateParam
- type ControllerCfg
- type DataDiskRecord
- type DiskConfig
- type ExtNetworkRecord
- type GuestLoginRecord
- type ImageRecord
- type ImagesListResp
- type MachineConfig
- type MachineCreateParam
- type MachineRecord
- type MachinesGetResp
- type MachinesListResp
- type NetworkConfig
- type NicRecord
- type PortforwardConfig
- type PortforwardRecord
- type PortforwardsResp
- type QuotaRecord
- type ResgroupConfig
- type ResgroupCreateParam
- type ResgroupQuotaConfig
- type SshKeyConfig
- type TenantRecord
- type TenantsListResp
- type UserAclRecord
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 AccountExtNetworksListAPI = "/restmachine/cloudapi/externalnetwork/list"
const AttachExternalNetworkAPI = "/restmachine/cloudapi/machines/attachExternalNetwork"
structures related to /cloudapi/machines/attachExternalNetwork API
const CloudspacesDeleteAPI = "/restmachine/cloudapi/cloudspaces/delete"
structures related to /cloudapi/cloudspaces/delete API
const CloudspacesGetAPI = "/restmachine/cloudapi/cloudspaces/get"
const CloudspacesListAPI = "/restmachine/cloudapi/cloudspaces/list"
const CloudspacesUpdateAPI = "/restmachine/cloudapi/cloudspaces/update"
structures related to /cloudapi/cloudspaces/update API
const DiskAttachAPI = "/restmachine/cloudapi/machines/attachDisk"
const DiskCreateAPI = "/restmachine/cloudapi/disks/create"
const ImagesListAPI = "/restmachine/cloudapi/images/list"
const MachineCreateAPI = "/restmachine/cloudapi/machines/create"
structures related to /cloudapi/machines/create API
const MachineDeleteAPI = "/restmachine/cloudapi/machines/delete"
strucures related to cloudapi/machines/delete API
const MachinesGetAPI = "/restmachine/cloudapi/machines/get"
const MachinesListAPI = "/restmachine/cloudapi/machines/list"
const PortforwardingCreateAPI = "/restmachine/cloudapi/portforwarding/create"
const PortforwardsListAPI = "/restmachine/cloudapi/portforwarding/list"
const ResgroupCreateAPI = "/restmachine/cloudapi/cloudspaces/create"
structures related to /cloudapi/cloudspaces/create API call
const ResgroupUpdateAPI = "/restmachine/cloudapi/cloudspaces/update"
structures related to /cloudapi/cloudspaces/update API call
const TenantsListAPI = "/restmachine/cloudapi/accounts/list"
const VmExtNetworksListAPI = "/restmachine/cloudapi/machines/listExternalNetworks"
Response of this call in current API version is just a list of attached network IDs
Variables ¶
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 ¶
Types ¶
type AccountAclRecord ¶
type AcountExtNetworksResp ¶
type AcountExtNetworksResp []ExtNetworkRecord
type CloudspaceRecord ¶
type CloudspaceRecord struct { Status string `json:"status"` UpdateTime uint64 `json:"updateTime"` ExtNetIP string `json:"externalnetworkip"` Name string `json:"name"` Decsription string `json:"descr"` CreateTime uint64 `json:"creationTime"` Acl []UserAclRecord `json:"acl"` Owner AccountAclRecord `json:"accountAcl"` GridID int `json:"gid"` Location string `json:"location"` PublicIP string `json:"publicipaddress"` TenantName string `json:"accountName"` ID uint `json:"id"` TenantID int `json:"accountId"` }
type CloudspacesGetResp ¶
type CloudspacesGetResp struct { Status string `json:"status"` UpdateTime uint64 `json:"updateTime"` ExtIP string `json:"externalnetworkip"` Description string `json:"description"` Quotas QuotaRecord `json:"resourceLimits"` ID uint `json:"id"` TenantID int `json:"accountId"` Name string `json:"name"` CreateTime uint64 `json:"creationTime"` Acl []UserAclRecord `json:"acl"` Secret string `json:"secret"` GridID int `json:"gid"` Location string `json:"location"` PublicIP string `json:"publicipaddress"` Ignored map[string]interface{} `json:"-"` }
type CloudspacesListResp ¶
type CloudspacesListResp []CloudspaceRecord
type CloudspacesUpdateParam ¶
type ControllerCfg ¶
type ControllerCfg struct {
// contains filtered or unexported fields
}
func ControllerConfigure ¶
func ControllerConfigure(d *schema.ResourceData) (*ControllerCfg, error)
type DataDiskRecord ¶
type DataDiskRecord struct { Status string `json:"status"` SizeMax int `json:"sizeMax"` Label string `json:"name"` Description string `json:"descr"` Acl map[string]string `json:"acl"` DiskType string `json:"type"` ID uint `json:"id"` }
structures related to /cloudapi/machines/get
type DiskConfig ¶
type ExtNetworkRecord ¶
structures related to /cloudapi/externalnetwork/list API
type GuestLoginRecord ¶
type ImageRecord ¶
type ImageRecord struct { Status string `json:"status"` Username string `json:"username"` Description string `json:"description"` TenantID uint `json:"accountId"` Size int `json:"size"` ImageType string `json:"type"` ID uint `json:"id"` Name string `json:"name"` }
structures related to /restmachine/cloudapi/images/list API
type ImagesListResp ¶
type ImagesListResp []ImageRecord
type MachineConfig ¶
type MachineConfig struct { ResGroupID int Name string ID int Cpu int Ram int ImageID int BootDisk DiskConfig DataDisks []DiskConfig Networks []NetworkConfig PortForwards []PortforwardConfig SshKeys []SshKeyConfig Description string // The following two parameters are required to create data disks by // a separate disks/create API call TenantID int GridID int // The following one paratmeter is required to create port forwards // it will be obsoleted when we implement true Resource Groups ExtIP string }
type MachineCreateParam ¶
type MachineCreateParam struct { ResGroupID uint `json:"cloudspaceId"` Name string `json:"name"` Description string `json:"description"` Cpu int `json:"vcpus"` Ram int `json:"memory"` ImageID int `json:"imageId"` BootDisk int `json:"disksize"` DataDisks []int `json:"datadisks"` UserData string `json:"userdata"` }
type MachineRecord ¶
type MachineRecord struct { Status string `json:"status"` StackID int `json:"stackId"` UpdateTime uint64 `json:"updateTime"` ReferenceID string `json:"referenceId"` Name string `json:"name"` NICs []NicRecord `json:"nics"` SizeID int `json:"sizeId"` DataDisks []uint `json:"disks"` CreateTime uint64 `json:"creationTime"` ImageID int `json:"imageId"` BootDisk int `json:"storage"` Cpu int `json:"vcpus"` Ram int `json:"memory"` ID uint `json:"id"` }
type MachinesGetResp ¶
type MachinesGetResp struct { ResGroupID uint `json:"cloudspaceid"` // note that "id" is not capitalized in "cloudspaceid" Status string `json:"status"` UpdateTime uint64 `json:"updateTime"` Hostname string `json:"hostname"` IsLocked bool `json:"locked"` Name string `json:"name"` CreateTime uint64 `json:"creationTime"` SizeID uint `json:"sizeid"` Cpu int `json:"vcpus"` Ram int `json:"memory"` BootDisk int `json:"storage"` DataDisks []DataDiskRecord `json:"disks"` NICs []NicRecord `json:"interfaces"` GuestLogins []GuestLoginRecord `json:"accounts"` ImageName string `json:"osImage"` ImageID int `json:"imageid"` Description string `json:"description"` ID uint `json:"id"` }
type MachinesListResp ¶
type MachinesListResp []MachineRecord
type NetworkConfig ¶
type NicRecord ¶
type NicRecord struct { Status string `json:"status"` // did not see any other values but "" MacAddress string `json:"macAddress"` // example "52:54:00:00:2d:2a" ReferenceID string `json:"referenceId"` // did not see any other values but "" DeviceName string `json:"deviceName"` // internal: "vm-13578-00a0", external: "vm-13578-6-ext NicType string `json:"type"` // "bridge" for int net, "PUBLIC" for ext net Params string `json:"params"` // for ext net "gateway:176.118.165.1 externalnetworkId:6" NetworkID int `json:"networkId"` // did not see any other values but 0 Guid string `json:"guid"` // did not see any other values but "" IPAddress string `json:"ipAddress"` // example "176.118.165.25/24" }
structures related to /cloudapi/machines/list API
type PortforwardConfig ¶
type PortforwardRecord ¶
type PortforwardRecord struct { Proto string `json:"protocol"` IntPort string `json:"localPort"` ExtPort string `json:"publicPort"` ExtIP string `json:"publicIp"` IntIP string `json:"localIp"` VmID int `json:"machineId"` VmName string `json:"machineName"` }
structures related to /cloudapi/portforwarding/list API
type PortforwardsResp ¶
type PortforwardsResp []PortforwardRecord
type QuotaRecord ¶
type QuotaRecord struct { Cpu int `json:"CU_C"` Ram float32 `json:"CU_M"` // NOTE: it is float32! Casting to int may be required when passing it to ResgroupConfig Disk int `json:"CU_D"` NetTraffic int `json:"CU_NP"` ExtIPs int `json:"CU_I"` }
structures related to /cloudapi/cloudspaces/get API call
type ResgroupConfig ¶
type ResgroupConfig struct { TenantID int TenantName string Location string Name string ID int GridID int ExtIP string // legacy field for VDC - this will eventually become obsoleted by true Resource Groups Quota ResgroupQuotaConfig Network NetworkConfig }
type ResgroupCreateParam ¶
type ResgroupCreateParam struct { TenantID int `json:"accountId"` Location string `json:"location"` Name string `json:"name"` Owner string `json:"access"` Cpu int `json:"maxCPUCapacity"` Ram int `json:"maxMemoryCapacity"` Disk int `json:"maxVDiskCapacity"` NetTraffic int `json:"maxNetworkPeerTransfer"` ExtIPs int `json:"maxNumPublicIP"` ExtNetID int `json:"externalnetworkid"` AllowedSizeIDs []int `json:"allowedVMSizes"` IntNetRange string `json:"privatenetwork"` }
type ResgroupQuotaConfig ¶
type SshKeyConfig ¶
type TenantRecord ¶
type TenantRecord struct { ID int `json:"id"` UpdateTime uint64 `json:"updateTime"` CreateTime uint64 `json:"creationTime"` Name string `json:"name"` Acl []UserAclRecord `json:"acl"` }
structures related to /cloudapi/accounts/list API
type TenantsListResp ¶
type TenantsListResp []TenantRecord
Source Files ¶
- controller.go
- data_source_image.go
- data_source_resgroup.go
- data_source_vm.go
- disk_subresource.go
- logins_subresource.go
- models_api.go
- models_objects.go
- network_subresource.go
- provider.go
- quota_subresource.go
- resource_resgroup.go
- resource_vm.go
- ssh_subresource.go
- utility.go
- utility_resgroup.go
- utility_vm.go