From 11786760b2f7c3e8c7f189e1b3ad2cb07dcac834 Mon Sep 17 00:00:00 2001 From: Lena Garber Date: Tue, 18 Jun 2024 11:10:02 -0400 Subject: [PATCH] Add documentation snippets for PG LA --- instances.go | 46 ++++++++++++++++++++++++--------------------- placement_groups.go | 8 ++++++++ 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/instances.go b/instances.go index 9122478cd..402981050 100644 --- a/instances.go +++ b/instances.go @@ -43,26 +43,28 @@ const ( // Instance represents a linode object type Instance struct { - ID int `json:"id"` - Created *time.Time `json:"-"` - Updated *time.Time `json:"-"` - Region string `json:"region"` - Alerts *InstanceAlert `json:"alerts"` - Backups *InstanceBackup `json:"backups"` - Image string `json:"image"` - Group string `json:"group"` - IPv4 []*net.IP `json:"ipv4"` - IPv6 string `json:"ipv6"` - Label string `json:"label"` - Type string `json:"type"` - Status InstanceStatus `json:"status"` - HasUserData bool `json:"has_user_data"` - Hypervisor string `json:"hypervisor"` - HostUUID string `json:"host_uuid"` - Specs *InstanceSpec `json:"specs"` - WatchdogEnabled bool `json:"watchdog_enabled"` - Tags []string `json:"tags"` - PlacementGroup *InstancePlacementGroup `json:"placement_group"` + ID int `json:"id"` + Created *time.Time `json:"-"` + Updated *time.Time `json:"-"` + Region string `json:"region"` + Alerts *InstanceAlert `json:"alerts"` + Backups *InstanceBackup `json:"backups"` + Image string `json:"image"` + Group string `json:"group"` + IPv4 []*net.IP `json:"ipv4"` + IPv6 string `json:"ipv6"` + Label string `json:"label"` + Type string `json:"type"` + Status InstanceStatus `json:"status"` + HasUserData bool `json:"has_user_data"` + Hypervisor string `json:"hypervisor"` + HostUUID string `json:"host_uuid"` + Specs *InstanceSpec `json:"specs"` + WatchdogEnabled bool `json:"watchdog_enabled"` + Tags []string `json:"tags"` + + // NOTE: Placement Groups may not currently be available to all users. + PlacementGroup *InstancePlacementGroup `json:"placement_group"` } // InstanceSpec represents a linode spec @@ -139,7 +141,9 @@ type InstanceCreateOptions struct { Tags []string `json:"tags,omitempty"` Metadata *InstanceMetadataOptions `json:"metadata,omitempty"` FirewallID int `json:"firewall_id,omitempty"` - PlacementGroup *InstanceCreatePlacementGroupOptions `json:"placement_group,omitempty"` + + // NOTE: Placement Groups may not currently be available to all users. + PlacementGroup *InstanceCreatePlacementGroupOptions `json:"placement_group,omitempty"` // Creation fields that need to be set explicitly false, "", or 0 use pointers SwapSize *int `json:"swap_size,omitempty"` diff --git a/placement_groups.go b/placement_groups.go index eaa5e4b22..3987adca9 100644 --- a/placement_groups.go +++ b/placement_groups.go @@ -18,6 +18,7 @@ type PlacementGroupMember struct { } // PlacementGroup represents a Linode placement group. +// NOTE: Placement Groups may not currently be available to all users. type PlacementGroup struct { ID int `json:"id"` Label string `json:"label"` @@ -58,6 +59,7 @@ type PlacementGroupUnAssignOptions struct { // ListPlacementGroups lists placement groups under the current account // matching the given list options. +// NOTE: Placement Groups may not currently be available to all users. func (c *Client) ListPlacementGroups( ctx context.Context, options *ListOptions, @@ -71,6 +73,7 @@ func (c *Client) ListPlacementGroups( } // GetPlacementGroup gets a placement group with the specified ID. +// NOTE: Placement Groups may not currently be available to all users. func (c *Client) GetPlacementGroup( ctx context.Context, id int, @@ -83,6 +86,7 @@ func (c *Client) GetPlacementGroup( } // CreatePlacementGroup creates a placement group with the specified options. +// NOTE: Placement Groups may not currently be available to all users. func (c *Client) CreatePlacementGroup( ctx context.Context, options PlacementGroupCreateOptions, @@ -96,6 +100,7 @@ func (c *Client) CreatePlacementGroup( } // UpdatePlacementGroup updates a placement group with the specified ID using the provided options. +// NOTE: Placement Groups may not currently be available to all users. func (c *Client) UpdatePlacementGroup( ctx context.Context, id int, @@ -111,6 +116,7 @@ func (c *Client) UpdatePlacementGroup( // AssignPlacementGroupLinodes assigns the specified Linodes to the given // placement group. +// NOTE: Placement Groups may not currently be available to all users. func (c *Client) AssignPlacementGroupLinodes( ctx context.Context, id int, @@ -126,6 +132,7 @@ func (c *Client) AssignPlacementGroupLinodes( // UnassignPlacementGroupLinodes un-assigns the specified Linodes from the given // placement group. +// NOTE: Placement Groups may not currently be available to all users. func (c *Client) UnassignPlacementGroupLinodes( ctx context.Context, id int, @@ -140,6 +147,7 @@ func (c *Client) UnassignPlacementGroupLinodes( } // DeletePlacementGroup deletes a placement group with the specified ID. +// NOTE: Placement Groups may not currently be available to all users. func (c *Client) DeletePlacementGroup( ctx context.Context, id int,