decs

package
v0.0.0-...-deb6a53 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
const AccountExtNetworksListAPI = "/restmachine/cloudapi/externalnetwork/list"
View Source
const AttachExternalNetworkAPI = "/restmachine/cloudapi/machines/attachExternalNetwork"

structures related to /cloudapi/machines/attachExternalNetwork API

View Source
const CloudspacesDeleteAPI = "/restmachine/cloudapi/cloudspaces/delete"

structures related to /cloudapi/cloudspaces/delete API

View Source
const CloudspacesGetAPI = "/restmachine/cloudapi/cloudspaces/get"
View Source
const CloudspacesListAPI = "/restmachine/cloudapi/cloudspaces/list"
View Source
const CloudspacesUpdateAPI = "/restmachine/cloudapi/cloudspaces/update"

structures related to /cloudapi/cloudspaces/update API

View Source
const DiskAttachAPI = "/restmachine/cloudapi/machines/attachDisk"
View Source
const DiskCreateAPI = "/restmachine/cloudapi/disks/create"
View Source
const ImagesListAPI = "/restmachine/cloudapi/images/list"
View Source
const MachineCreateAPI = "/restmachine/cloudapi/machines/create"

structures related to /cloudapi/machines/create API

View Source
const MachineDeleteAPI = "/restmachine/cloudapi/machines/delete"

strucures related to cloudapi/machines/delete API

View Source
const MachinesGetAPI = "/restmachine/cloudapi/machines/get"
View Source
const MachinesListAPI = "/restmachine/cloudapi/machines/list"
View Source
const PortforwardingCreateAPI = "/restmachine/cloudapi/portforwarding/create"
View Source
const PortforwardsListAPI = "/restmachine/cloudapi/portforwarding/list"
View Source
const ResgroupCreateAPI = "/restmachine/cloudapi/cloudspaces/create"

structures related to /cloudapi/cloudspaces/create API call

View Source
const ResgroupUpdateAPI = "/restmachine/cloudapi/cloudspaces/update"

structures related to /cloudapi/cloudspaces/update API call

View Source
const TenantsListAPI = "/restmachine/cloudapi/accounts/list"
View Source
const VmExtNetworksListAPI = "/restmachine/cloudapi/machines/listExternalNetworks"

Response of this call in current API version is just a list of attached network IDs

Variables

View Source
var Timeout180s = time.Second * 180
View Source
var Timeout30s = time.Second * 30

timeouts for API calls from CRUD functions of Terraform plugin

View Source
var Timeout60s = time.Second * 60

Functions

func Jo2JSON

func Jo2JSON(arg_str string) string

func Provider

func Provider() *schema.Provider

Types

type AccountAclRecord

type AccountAclRecord struct {
	Status     string `json:"status"`
	AccRights  string `json:"right"`
	IsExplicit bool   `json:"explicit"`
	EntityID   string `json:"userGroupId"`
	Guid       string `json:"guid"`
	AccType    string `json:"type"`
}

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 CloudspacesUpdateParam struct {
	ID         uint   `json:"cloudspaceId"`
	Name       string `json:"name"`
	Cpu        int    `json:"maxCPUCapacity"`
	Ram        int    `json:"maxMemoryCapacity"`
	Disk       int    `json:"maxVDiskCapacity"`
	NetTraffic int    `json:"maxNetworkPeerTransfer"`
	ExtIPs     int    `json:"maxNumPublicIP"`
}

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 DiskConfig struct {
	Label    string
	Size     int
	Pool     string
	Provider string
	ID       int
}

type ExtNetworkRecord

type ExtNetworkRecord struct {
	IPRange string `json:"name"`
	ID      uint   `json:"id"`
}

structures related to /cloudapi/externalnetwork/list API

type GuestLoginRecord

type GuestLoginRecord struct {
	Guid     string `json:"guid"`
	Login    string `json:"login"`
	Password string `json:"password"`
}

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 NetworkConfig struct {
	Label     string
	NetworkID int
}

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 PortforwardConfig struct {
	Label   string
	ExtPort int
	IntPort int
	Proto   string
}

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 ResgroupQuotaConfig struct {
	Cpu        int
	Ram        float32 // NOTE: it is float32! However, int would be enough here
	Disk       int
	NetTraffic int
	ExtIPs     int
}

type SshKeyConfig

type SshKeyConfig struct {
	User      string
	SshKey    string
	UserShell string
}

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

type UserAclRecord

type UserAclRecord struct {
	Status       string `json:"status"`
	CanBeDeleted bool   `json:"canBeDeleted"`
	AccRights    string `json:"right"`
	AccType      string `json:"type"`
	UgroupID     string `json:"userGroupId"`
}

structures related to /cloudapi/cloudspaces/list API

Jump to

Keyboard shortcuts

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