Documentation ¶
Index ¶
- Constants
- func GenerateCloudConfig(options *CloudConfigOpts) ([]byte, error)
- type BlockDevice
- type BlockDeviceList
- type BlockDeviceListResponse
- type CloudConfigOpts
- type DataSource
- func (s *DataSource) Create(ctx context.Context, host *config.Host, cloud *config.Cloud) error
- func (s *DataSource) CreateBlockDevice(ctx context.Context, host *config.Host) (string, error)
- func (s *DataSource) CreateVM(ctx context.Context, host *config.Host, cloud *config.Cloud, ...) (string, error)
- func (s *DataSource) Delete(ctx context.Context, name string) error
- func (s *DataSource) DeleteBlockDevice(ctx context.Context, block DeleteBlockDeviceRequest) error
- func (s *DataSource) ExecutePostcript(ctx context.Context, host *config.Host, instance VM, userData []byte) error
- func (s *DataSource) FindVM(ctx context.Context, name string) (VM, error)
- func (s *DataSource) InterrogateAPI(ctx context.Context, endpoint string, jsonBody []byte) (*http.Response, error)
- type DatacenterLabel
- type DeleteBlockDeviceRequest
- type StatusStr
- type VM
- type VMListResponse
- type VMPublicIPv4
- type VMSku
Constants ¶
View Source
const (
BlockDeviceAllocated = 2
)
Variables ¶
This section is empty.
Functions ¶
func GenerateCloudConfig ¶
func GenerateCloudConfig(options *CloudConfigOpts) ([]byte, error)
Types ¶
type BlockDevice ¶
type BlockDevice struct {
UUID string `json:"uuid"`
}
BlockDevice is the Block Device field in the response from the /vm/list endpoint
type BlockDeviceList ¶
type BlockDeviceList struct { AllocatedOn *time.Time `json:"allocated_on"` Cost int `json:"cost"` DatacenterLabel string `json:"datacenter_label"` ID int `json:"id"` InsertedOn time.Time `json:"inserted_on"` Mount bool `json:"mount"` ReleasedOn *time.Time `json:"released_on"` SizeGiB int `json:"size_gib"` Status int `json:"status"` StatusStr string `json:"status_str"` UUID string `json:"uuid"` }
BlockDeviceList is the Block Device field in the response from the /block_device/list endpoint
type BlockDeviceListResponse ¶
type BlockDeviceListResponse struct { BlockDevices []BlockDeviceList `json:"block_devices"` Filters struct{} `json:"filters"` }
BlockDeviceListResponse is the response from the /block_device/list endpoint
type CloudConfigOpts ¶
type CloudConfigOpts struct { PostScripts config.PostScriptsOpts Hostname string }
type DataSource ¶
func (*DataSource) CreateBlockDevice ¶
CreateBlockDevice creates a storage volume and returns its UUID
func (*DataSource) CreateVM ¶
func (s *DataSource) CreateVM( ctx context.Context, host *config.Host, cloud *config.Cloud, blockDeviceUUID string, ) (string, error)
CreateVM spawns a VM attached to a storage volume and returns its UUID
func (*DataSource) Delete ¶
func (s *DataSource) Delete(ctx context.Context, name string) error
Delete a server
func (*DataSource) DeleteBlockDevice ¶
func (s *DataSource) DeleteBlockDevice(ctx context.Context, block DeleteBlockDeviceRequest) error
func (*DataSource) ExecutePostcript ¶
func (*DataSource) InterrogateAPI ¶
type DatacenterLabel ¶
type DatacenterLabel string
type DeleteBlockDeviceRequest ¶
type DeleteBlockDeviceRequest struct {
UUID string `json:"uuid"`
}
type VM ¶
type VM struct { Image string `json:"image"` UUID string `json:"uuid"` Uptime int64 `json:"uptime"` VMRAM int64 `json:"vm_ram"` VMCore int64 `json:"vm_core"` VMGPU int64 `json:"vm_gpu"` VMCost int64 `json:"vm_cost"` VNC bool `json:"vnc"` Interruptible bool `json:"interruptible"` VNCPassword *string `json:"vnc_password"` Status int64 `json:"status"` StatusStr StatusStr `json:"status_str"` InsertedOn string `json:"inserted_on"` AffectedOn *string `json:"affected_on"` MaxUptime int64 `json:"max_uptime"` RequestTimeout int64 `json:"request_timeout"` StartedOn *string `json:"started_on"` KillRequestedOn *string `json:"kill_requested_on"` LaunchBashScript string `json:"launch_bash_script"` VMSku VMSku `json:"vm_sku"` VMPublicIPv4 *VMPublicIPv4 `json:"vm_public_ipv4"` VMPublicSSHPort *int64 `json:"vm_public_sshport"` DatacenterLabel *DatacenterLabel `json:"datacenter_label"` BlockDevices []BlockDevice `json:"block_devices"` }
VM is the VM field from the /vm/list endpoint
type VMListResponse ¶
type VMListResponse struct { Filters struct{} `json:"filters"` VMs []VM `json:"vms"` }
VMListResponse is the response from the /vm/list endpoint
type VMPublicIPv4 ¶
type VMPublicIPv4 string
Click to show internal directories.
Click to hide internal directories.