Skip to content

Commit 9bb3d96

Browse files
Add documentation snippets for PG LA (#530)
1 parent e55147a commit 9bb3d96

File tree

2 files changed

+33
-21
lines changed

2 files changed

+33
-21
lines changed

instances.go

+25-21
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,28 @@ const (
4343

4444
// Instance represents a linode object
4545
type Instance struct {
46-
ID int `json:"id"`
47-
Created *time.Time `json:"-"`
48-
Updated *time.Time `json:"-"`
49-
Region string `json:"region"`
50-
Alerts *InstanceAlert `json:"alerts"`
51-
Backups *InstanceBackup `json:"backups"`
52-
Image string `json:"image"`
53-
Group string `json:"group"`
54-
IPv4 []*net.IP `json:"ipv4"`
55-
IPv6 string `json:"ipv6"`
56-
Label string `json:"label"`
57-
Type string `json:"type"`
58-
Status InstanceStatus `json:"status"`
59-
HasUserData bool `json:"has_user_data"`
60-
Hypervisor string `json:"hypervisor"`
61-
HostUUID string `json:"host_uuid"`
62-
Specs *InstanceSpec `json:"specs"`
63-
WatchdogEnabled bool `json:"watchdog_enabled"`
64-
Tags []string `json:"tags"`
65-
PlacementGroup *InstancePlacementGroup `json:"placement_group"`
46+
ID int `json:"id"`
47+
Created *time.Time `json:"-"`
48+
Updated *time.Time `json:"-"`
49+
Region string `json:"region"`
50+
Alerts *InstanceAlert `json:"alerts"`
51+
Backups *InstanceBackup `json:"backups"`
52+
Image string `json:"image"`
53+
Group string `json:"group"`
54+
IPv4 []*net.IP `json:"ipv4"`
55+
IPv6 string `json:"ipv6"`
56+
Label string `json:"label"`
57+
Type string `json:"type"`
58+
Status InstanceStatus `json:"status"`
59+
HasUserData bool `json:"has_user_data"`
60+
Hypervisor string `json:"hypervisor"`
61+
HostUUID string `json:"host_uuid"`
62+
Specs *InstanceSpec `json:"specs"`
63+
WatchdogEnabled bool `json:"watchdog_enabled"`
64+
Tags []string `json:"tags"`
65+
66+
// NOTE: Placement Groups may not currently be available to all users.
67+
PlacementGroup *InstancePlacementGroup `json:"placement_group"`
6668
}
6769

6870
// InstanceSpec represents a linode spec
@@ -139,7 +141,9 @@ type InstanceCreateOptions struct {
139141
Tags []string `json:"tags,omitempty"`
140142
Metadata *InstanceMetadataOptions `json:"metadata,omitempty"`
141143
FirewallID int `json:"firewall_id,omitempty"`
142-
PlacementGroup *InstanceCreatePlacementGroupOptions `json:"placement_group,omitempty"`
144+
145+
// NOTE: Placement Groups may not currently be available to all users.
146+
PlacementGroup *InstanceCreatePlacementGroupOptions `json:"placement_group,omitempty"`
143147

144148
// Creation fields that need to be set explicitly false, "", or 0 use pointers
145149
SwapSize *int `json:"swap_size,omitempty"`

placement_groups.go

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type PlacementGroupMember struct {
1818
}
1919

2020
// PlacementGroup represents a Linode placement group.
21+
// NOTE: Placement Groups may not currently be available to all users.
2122
type PlacementGroup struct {
2223
ID int `json:"id"`
2324
Label string `json:"label"`
@@ -58,6 +59,7 @@ type PlacementGroupUnAssignOptions struct {
5859

5960
// ListPlacementGroups lists placement groups under the current account
6061
// matching the given list options.
62+
// NOTE: Placement Groups may not currently be available to all users.
6163
func (c *Client) ListPlacementGroups(
6264
ctx context.Context,
6365
options *ListOptions,
@@ -71,6 +73,7 @@ func (c *Client) ListPlacementGroups(
7173
}
7274

7375
// GetPlacementGroup gets a placement group with the specified ID.
76+
// NOTE: Placement Groups may not currently be available to all users.
7477
func (c *Client) GetPlacementGroup(
7578
ctx context.Context,
7679
id int,
@@ -83,6 +86,7 @@ func (c *Client) GetPlacementGroup(
8386
}
8487

8588
// CreatePlacementGroup creates a placement group with the specified options.
89+
// NOTE: Placement Groups may not currently be available to all users.
8690
func (c *Client) CreatePlacementGroup(
8791
ctx context.Context,
8892
options PlacementGroupCreateOptions,
@@ -96,6 +100,7 @@ func (c *Client) CreatePlacementGroup(
96100
}
97101

98102
// UpdatePlacementGroup updates a placement group with the specified ID using the provided options.
103+
// NOTE: Placement Groups may not currently be available to all users.
99104
func (c *Client) UpdatePlacementGroup(
100105
ctx context.Context,
101106
id int,
@@ -111,6 +116,7 @@ func (c *Client) UpdatePlacementGroup(
111116

112117
// AssignPlacementGroupLinodes assigns the specified Linodes to the given
113118
// placement group.
119+
// NOTE: Placement Groups may not currently be available to all users.
114120
func (c *Client) AssignPlacementGroupLinodes(
115121
ctx context.Context,
116122
id int,
@@ -126,6 +132,7 @@ func (c *Client) AssignPlacementGroupLinodes(
126132

127133
// UnassignPlacementGroupLinodes un-assigns the specified Linodes from the given
128134
// placement group.
135+
// NOTE: Placement Groups may not currently be available to all users.
129136
func (c *Client) UnassignPlacementGroupLinodes(
130137
ctx context.Context,
131138
id int,
@@ -140,6 +147,7 @@ func (c *Client) UnassignPlacementGroupLinodes(
140147
}
141148

142149
// DeletePlacementGroup deletes a placement group with the specified ID.
150+
// NOTE: Placement Groups may not currently be available to all users.
143151
func (c *Client) DeletePlacementGroup(
144152
ctx context.Context,
145153
id int,

0 commit comments

Comments
 (0)