Skip to content

Commit

Permalink
Merge pull request #100 from solusio/task-oneumyvakin-additional-disk…
Browse files Browse the repository at this point in the history
…s-SIO-5985

TASK SIO-5985 Add additional disks to create virtual server request.
  • Loading branch information
oneumyvakin authored Apr 22, 2024
2 parents d284a92 + c2278a0 commit 10243ac
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 13 deletions.
19 changes: 19 additions & 0 deletions additionalDisks.go
Original file line number Diff line number Diff line change
@@ -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"`
}
18 changes: 18 additions & 0 deletions offers.go
Original file line number Diff line number Diff line change
@@ -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"`
}
30 changes: 17 additions & 13 deletions virtual_servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 10243ac

Please sign in to comment.