Skip to content

Commit

Permalink
feat(server): add primary_disk_size attribute in resource and datas…
Browse files Browse the repository at this point in the history
…ource (#801)

Resolve enhancement request in issue #683.

---------

Co-authored-by: Ettore Foti <[email protected]>
Co-authored-by: Julian Tölle <[email protected]>
  • Loading branch information
3 people authored Dec 4, 2023
1 parent 9df3599 commit 98c2f2d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/server/data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ func getCommonDataSchema() map[string]*schema.Schema {
Type: schema.TypeBool,
Computed: true,
},
"primary_disk_size": {
Type: schema.TypeInt,
Computed: true,
},
}
}

Expand Down
1 change: 1 addition & 0 deletions internal/server/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,7 @@ func getServerAttributes(d *schema.ResourceData, s *hcloud.Server) map[string]in
"delete_protection": s.Protection.Delete,
"rebuild_protection": s.Protection.Rebuild,
"firewall_ids": firewallIDs,
"primary_disk_size": s.PrimaryDiskSize,
}
if s.PublicNet.IPv4.IsUnspecified() {
res["ipv4_address"] = nil
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/server.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ data "hcloud_server" "s_3" {
- `placement_group_id` - (Optional, string) Placement Group ID the server is assigned to.
- `delete_protection` - (bool) Whether delete protection is enabled.
- `rebuild_protection` - (bool) Whether rebuild protection is enabled.
- `primary_disk_size` - (int) The size of the primary disk in GB.
1 change: 1 addition & 0 deletions website/docs/r/server.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ The following attributes are exported:
- `delete_protection` - (bool) Whether delete protection is enabled.
- `rebuild_protection` - (bool) Whether rebuild protection is enabled.
- `shutdown_before_deletion` - (bool) Whether the server will try to shut down gracefully before being deleted.
- `primary_disk_size` - (int) The size of the primary disk in GB.

a single entry in `network` support the following fields:
- `network_id` - (Required, int) ID of the network
Expand Down

0 comments on commit 98c2f2d

Please sign in to comment.