diff --git a/additionalDisks.go b/additionalDisks.go new file mode 100644 index 0000000..b3090ca --- /dev/null +++ b/additionalDisks.go @@ -0,0 +1,19 @@ +package solus + +type AdditionalDiskCreateRequest struct { + Name string `json:"name"` + Size int `json:"size"` + OfferID int `json:"offer_id"` +} + +type AdditionalDisk struct { + ID int `json:"id"` + IsPrimary bool `json:"is_primary"` + Name string `json:"name"` + Size int `json:"size"` + ActualSize int `json:"actual_size"` + Path string `json:"path"` + FullPath string `json:"full_path"` + Storage Storage `json:"storage"` + Offer Offer `json:"offer,omitempty"` +} diff --git a/offers.go b/offers.go new file mode 100644 index 0000000..9f9c3a8 --- /dev/null +++ b/offers.go @@ -0,0 +1,18 @@ +package solus + +const ( + // OfferTypeAdditionalDisk is a constant for additional disk offer type. + OfferTypeAdditionalDisk OfferType = "additional_disk" +) + +type OfferType string + +type Offer struct { + ID int `json:"id"` + Name string `json:"name"` + Description string `json:"description,omitempty"` + Type OfferType `json:"type"` + IsVisible bool `json:"is_visible"` + AvailablePlans []Plan `json:"available_plans"` + AvailableLocations []Location `json:"available_locations"` +} diff --git a/virtual_servers.go b/virtual_servers.go index 231dddf..365017f 100644 --- a/virtual_servers.go +++ b/virtual_servers.go @@ -85,19 +85,23 @@ type VirtualServerUsage struct { } type VirtualServerCreateRequest struct { - Name string `json:"name"` - BootMode BootMode `json:"boot_mode"` - Description string `json:"description,omitempty"` - UserData string `json:"user_data,omitempty"` - FQDNs []string `json:"fqdns,omitempty"` - Password string `json:"password,omitempty"` - SSHKeys []int `json:"ssh_keys"` - PlanID int `json:"plan"` - ProjectID int `json:"project"` - LocationID int `json:"location"` - OSImageVersionID int `json:"os,omitempty"` - ApplicationID int `json:"application,omitempty"` - ApplicationData map[string]interface{} `json:"applicationData,omitempty"` + Name string `json:"name"` + BootMode BootMode `json:"boot_mode"` + Description string `json:"description,omitempty"` + UserData string `json:"user_data,omitempty"` + FQDNs []string `json:"fqdns,omitempty"` + Password string `json:"password,omitempty"` + SSHKeys []int `json:"ssh_keys"` + PlanID int `json:"plan"` + ProjectID int `json:"project"` + LocationID int `json:"location"` + ComputeResourceID int `json:"compute_resource,omitempty"` + OSImageVersionID int `json:"os,omitempty"` + ApplicationID int `json:"application,omitempty"` + ApplicationData map[string]interface{} `json:"applicationData,omitempty"` + AdditionalDisks []AdditionalDiskCreateRequest `json:"additional_disks,omitempty"` + AdditionalIPCount int `json:"additional_ip_count,omitempty"` + AdditionalIPv6Count int `json:"additional_ipv6_count,omitempty"` } // VirtualServerUpdateRequest represents available properties for updating an existing