Skip to content

Commit 24ed150

Browse files
authored
docs(flexIP): revamp api documentation (#1647)
1 parent dc4f803 commit 24ed150

File tree

1 file changed

+82
-74
lines changed

1 file changed

+82
-74
lines changed

api/flexibleip/v1alpha1/flexibleip_sdk.go

Lines changed: 82 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -184,82 +184,82 @@ func (enum *MACAddressType) UnmarshalJSON(data []byte) error {
184184

185185
// AttachFlexibleIPsResponse: attach flexible i ps response.
186186
type AttachFlexibleIPsResponse struct {
187-
// TotalCount: total count of Flexible IPs being updated.
187+
// TotalCount: total count of flexible IPs that are being updated.
188188
TotalCount uint32 `json:"total_count"`
189-
// FlexibleIPs: listing of Flexible IPs in updating state.
189+
// FlexibleIPs: list of flexible IPs in an updating state.
190190
FlexibleIPs []*FlexibleIP `json:"flexible_ips"`
191191
}
192192

193193
// DetachFlexibleIPsResponse: detach flexible i ps response.
194194
type DetachFlexibleIPsResponse struct {
195-
// TotalCount: total count of Flexible IPs being detached.
195+
// TotalCount: total count of flexible IPs that are being detached.
196196
TotalCount uint32 `json:"total_count"`
197-
// FlexibleIPs: listing of Flexible IPs in detaching state.
197+
// FlexibleIPs: list of flexible IPs in a detaching state.
198198
FlexibleIPs []*FlexibleIP `json:"flexible_ips"`
199199
}
200200

201201
// FlexibleIP: flexible ip.
202202
type FlexibleIP struct {
203-
// ID: ID of the Flexible IP.
203+
// ID: ID of the flexible IP.
204204
ID string `json:"id"`
205-
// OrganizationID: organization ID the Flexible IP is attached to.
205+
// OrganizationID: ID of the Organization the flexible IP is attached to.
206206
OrganizationID string `json:"organization_id"`
207-
// ProjectID: project ID the Flexible IP is attached to.
207+
// ProjectID: ID of the Project the flexible IP is attached to.
208208
ProjectID string `json:"project_id"`
209-
// Description: description of the Flexible IP.
209+
// Description: flexible IP description.
210210
Description string `json:"description"`
211-
// Tags: tags associated with the Flexible IP.
211+
// Tags: flexible IP tags.
212212
Tags []string `json:"tags"`
213-
// UpdatedAt: date of last update of the Flexible IP.
213+
// UpdatedAt: date on which the flexible IP was last updated.
214214
UpdatedAt *time.Time `json:"updated_at"`
215-
// CreatedAt: date of creation of the Flexible IP.
215+
// CreatedAt: date on which the flexible IP was created.
216216
CreatedAt *time.Time `json:"created_at"`
217-
// Status: status of the Flexible IP.
218-
// - ready : Flexible IP is created and ready to be attached to a server or to have a virtual MAC generated.
219-
// - updating: Flexible IP is being attached to a server or a virtual MAC operation is ongoing
220-
// - attached: Flexible IP is attached to a server
221-
// - error: a Flexible IP operation resulted in an error
222-
// - detaching: Flexible IP is being detached from a server
223-
// - locked: Flexible IP resource is locked.
217+
// Status: flexible IP status.
218+
// - ready : flexible IP is created and ready to be attached to a server or to be associated with a virtual MAC.
219+
// - updating: flexible IP is being attached to a server or a virtual MAC operation is ongoing
220+
// - attached: flexible IP is attached to a server
221+
// - error: a flexible IP operation resulted in an error
222+
// - detaching: flexible IP is being detached from a server
223+
// - locked: the resource of the flexible IP is locked.
224224
// Default value: unknown
225225
Status FlexibleIPStatus `json:"status"`
226-
// IPAddress: IP of the Flexible IP.
226+
// IPAddress: IP of the flexible IP.
227227
IPAddress scw.IPNet `json:"ip_address"`
228-
// MacAddress: mAC address of the Flexible IP.
228+
// MacAddress: mAC address of the flexible IP.
229229
MacAddress *MACAddress `json:"mac_address"`
230-
// ServerID: ID of the server linked to the Flexible IP.
230+
// ServerID: ID of the server linked to the flexible IP.
231231
ServerID *string `json:"server_id"`
232232
// Reverse: reverse DNS value.
233233
Reverse string `json:"reverse"`
234-
// Zone: flexible IP Availability Zone.
234+
// Zone: availability Zone of the flexible IP.
235235
Zone scw.Zone `json:"zone"`
236236
}
237237

238238
// ListFlexibleIPsResponse: list flexible i ps response.
239239
type ListFlexibleIPsResponse struct {
240-
// TotalCount: total count of matching Flexible IPs.
240+
// TotalCount: total count of matching flexible IPs.
241241
TotalCount uint32 `json:"total_count"`
242-
// FlexibleIPs: listing of Flexible IPs.
242+
// FlexibleIPs: list of all flexible IPs.
243243
FlexibleIPs []*FlexibleIP `json:"flexible_ips"`
244244
}
245245

246246
// MACAddress: mac address.
247247
type MACAddress struct {
248-
// ID: ID of the Flexible IP.
248+
// ID: ID of the flexible IP.
249249
ID string `json:"id"`
250250
// MacAddress: mAC address of the Virtual MAC.
251251
MacAddress string `json:"mac_address"`
252-
// MacType: virtual MAC type.
252+
// MacType: type of virtual MAC.
253253
// Default value: unknown_type
254254
MacType MACAddressType `json:"mac_type"`
255-
// Status: virtual MAC status.
255+
// Status: status of virtual MAC.
256256
// Default value: unknown
257257
Status MACAddressStatus `json:"status"`
258-
// UpdatedAt: date of last update of the Virtual MAC.
258+
// UpdatedAt: date on which the virtual MAC was last updated.
259259
UpdatedAt *time.Time `json:"updated_at"`
260-
// CreatedAt: date of creation of the Virtual MAC.
260+
// CreatedAt: date on which the virtual MAC was created.
261261
CreatedAt *time.Time `json:"created_at"`
262-
// Zone: mAC Addr IP Availability Zone.
262+
// Zone: mAC address IP Availability Zone.
263263
Zone scw.Zone `json:"zone"`
264264
}
265265

@@ -275,19 +275,20 @@ type CreateFlexibleIPRequest struct {
275275
Zone scw.Zone `json:"-"`
276276
// ProjectID: ID of the project to associate with the Flexible IP.
277277
ProjectID string `json:"project_id"`
278-
// Description: description to associate with the Flexible IP, max 255 characters.
278+
// Description: flexible IP description (max. of 255 characters).
279279
Description string `json:"description"`
280-
// Tags: tags to associate to the Flexible IP.
280+
// Tags: tags to associate to the flexible IP.
281281
Tags []string `json:"tags"`
282-
// ServerID: server ID on which to attach the created Flexible IP.
282+
// ServerID: ID of the server to which the newly created flexible IP will be attached.
283283
ServerID *string `json:"server_id"`
284-
// Reverse: reverse DNS value.
284+
// Reverse: value of the reverse DNS.
285285
Reverse *string `json:"reverse"`
286-
// IsIPv6: if true, creates a Flexible IP with an ipv6 address.
286+
// IsIPv6: defines whether the flexible IP has an IPv6 address.
287287
IsIPv6 bool `json:"is_ipv6"`
288288
}
289289

290-
// CreateFlexibleIP: create a Flexible IP.
290+
// CreateFlexibleIP: create a new flexible IP.
291+
// Generate a new flexible IP within a given zone, specifying its configuration including Project ID and description.
291292
func (s *API) CreateFlexibleIP(req *CreateFlexibleIPRequest, opts ...scw.RequestOption) (*FlexibleIP, error) {
292293
var err error
293294

@@ -328,11 +329,12 @@ func (s *API) CreateFlexibleIP(req *CreateFlexibleIPRequest, opts ...scw.Request
328329
type GetFlexibleIPRequest struct {
329330
// Zone: zone to target. If none is passed will use default zone from the config.
330331
Zone scw.Zone `json:"-"`
331-
// FipID: flexible IP ID.
332+
// FipID: ID of the flexible IP.
332333
FipID string `json:"-"`
333334
}
334335

335-
// GetFlexibleIP: get a Flexible IP.
336+
// GetFlexibleIP: get an existing flexible IP.
337+
// Retrieve information about an existing flexible IP, specified by its ID and zone. Its full details, including Project ID, description and status, are returned in the response object.
336338
func (s *API) GetFlexibleIP(req *GetFlexibleIPRequest, opts ...scw.RequestOption) (*FlexibleIP, error) {
337339
var err error
338340

@@ -367,26 +369,27 @@ func (s *API) GetFlexibleIP(req *GetFlexibleIPRequest, opts ...scw.RequestOption
367369
type ListFlexibleIPsRequest struct {
368370
// Zone: zone to target. If none is passed will use default zone from the config.
369371
Zone scw.Zone `json:"-"`
370-
// OrderBy: the sort order of the returned Flexible IPs.
372+
// OrderBy: sort order of the returned flexible IPs.
371373
// Default value: created_at_asc
372374
OrderBy ListFlexibleIPsRequestOrderBy `json:"-"`
373-
// Page: the page number for the returned Flexible IPs.
375+
// Page: page number.
374376
Page *int32 `json:"-"`
375-
// PageSize: the maximum number of Flexible IPs per page.
377+
// PageSize: maximum number of flexible IPs per page.
376378
PageSize *uint32 `json:"-"`
377-
// Tags: filter Flexible IPs with one or more matching tags.
379+
// Tags: filter by tag, only flexible IPs with one or more matching tags will be returned.
378380
Tags []string `json:"-"`
379-
// Status: filter Flexible IPs by status.
381+
// Status: filter by status, only flexible IPs with this status will be returned.
380382
Status []FlexibleIPStatus `json:"-"`
381-
// ServerIDs: filter Flexible IPs by server IDs.
383+
// ServerIDs: filter by server IDs, only flexible IPs with these server IDs will be returned.
382384
ServerIDs []string `json:"-"`
383-
// OrganizationID: filter Flexible IPs by organization ID.
385+
// OrganizationID: filter by Organization ID, only flexible IPs from this Organization will be returned.
384386
OrganizationID *string `json:"-"`
385-
// ProjectID: filter Flexible IPs by project ID.
387+
// ProjectID: filter by Project ID, only flexible IPs from this Project will be returned.
386388
ProjectID *string `json:"-"`
387389
}
388390

389-
// ListFlexibleIPs: list Flexible IPs.
391+
// ListFlexibleIPs: list flexible IPs.
392+
// List all flexible IPs within a given zone.
390393
func (s *API) ListFlexibleIPs(req *ListFlexibleIPsRequest, opts ...scw.RequestOption) (*ListFlexibleIPsResponse, error) {
391394
var err error
392395

@@ -433,17 +436,18 @@ func (s *API) ListFlexibleIPs(req *ListFlexibleIPsRequest, opts ...scw.RequestOp
433436
type UpdateFlexibleIPRequest struct {
434437
// Zone: zone to target. If none is passed will use default zone from the config.
435438
Zone scw.Zone `json:"-"`
436-
// FipID: ID of the Flexible IP to update.
439+
// FipID: ID of the flexible IP to update.
437440
FipID string `json:"-"`
438-
// Description: description to associate with the Flexible IP, max 255 characters.
441+
// Description: flexible IP description (max. 255 characters).
439442
Description *string `json:"description"`
440-
// Tags: tags to associate with the Flexible IP.
443+
// Tags: tags associated with the flexible IP.
441444
Tags *[]string `json:"tags"`
442-
// Reverse: reverse DNS value.
445+
// Reverse: value of the reverse DNS.
443446
Reverse *string `json:"reverse"`
444447
}
445448

446-
// UpdateFlexibleIP: update a Flexible IP.
449+
// UpdateFlexibleIP: update an existing flexible IP.
450+
// Update the parameters of an existing flexible IP, specified by its ID and zone. These parameters include tags and description.
447451
func (s *API) UpdateFlexibleIP(req *UpdateFlexibleIPRequest, opts ...scw.RequestOption) (*FlexibleIP, error) {
448452
var err error
449453

@@ -483,11 +487,12 @@ func (s *API) UpdateFlexibleIP(req *UpdateFlexibleIPRequest, opts ...scw.Request
483487
type DeleteFlexibleIPRequest struct {
484488
// Zone: zone to target. If none is passed will use default zone from the config.
485489
Zone scw.Zone `json:"-"`
486-
// FipID: ID of the Flexible IP to delete.
490+
// FipID: ID of the flexible IP to delete.
487491
FipID string `json:"-"`
488492
}
489493

490-
// DeleteFlexibleIP: delete a Flexible IP.
494+
// DeleteFlexibleIP: delete an existing flexible IP.
495+
// Delete an existing flexible IP, specified by its ID and zone. Note that deleting a flexible IP is permanent and cannot be undone.
491496
func (s *API) DeleteFlexibleIP(req *DeleteFlexibleIPRequest, opts ...scw.RequestOption) error {
492497
var err error
493498

@@ -520,14 +525,15 @@ func (s *API) DeleteFlexibleIP(req *DeleteFlexibleIPRequest, opts ...scw.Request
520525
type AttachFlexibleIPRequest struct {
521526
// Zone: zone to target. If none is passed will use default zone from the config.
522527
Zone scw.Zone `json:"-"`
523-
// FipsIDs: a list of Flexible IP IDs to attach.
524-
// Multiple IDs can be provided as long as Flexible IPs belong to the same MAC groups (see details about MAC groups).
528+
// FipsIDs: list of flexible IP IDs to attach to a server.
529+
// Multiple IDs can be provided, but note that flexible IPs must belong to the same MAC group (see details about MAC groups).
525530
FipsIDs []string `json:"fips_ids"`
526-
// ServerID: a server ID on which to attach the Flexible IPs.
531+
// ServerID: ID of the server on which to attach the flexible IPs.
527532
ServerID string `json:"server_id"`
528533
}
529534

530-
// AttachFlexibleIP: attach a Flexible IP to a server.
535+
// AttachFlexibleIP: attach an existing flexible IP to a server.
536+
// Attach an existing flexible IP to a specified Elastic Metal server.
531537
func (s *API) AttachFlexibleIP(req *AttachFlexibleIPRequest, opts ...scw.RequestOption) (*AttachFlexibleIPsResponse, error) {
532538
var err error
533539

@@ -563,12 +569,12 @@ func (s *API) AttachFlexibleIP(req *AttachFlexibleIPRequest, opts ...scw.Request
563569
type DetachFlexibleIPRequest struct {
564570
// Zone: zone to target. If none is passed will use default zone from the config.
565571
Zone scw.Zone `json:"-"`
566-
// FipsIDs: a list of Flexible IP IDs to detach.
567-
// Multiple IDs can be provided as long as Flexible IPs belong to the same MAC groups (see details about MAC groups).
572+
// FipsIDs: list of flexible IP IDs to detach from a server. Multiple IDs can be provided. Note that flexible IPs must belong to the same MAC group.
568573
FipsIDs []string `json:"fips_ids"`
569574
}
570575

571-
// DetachFlexibleIP: detach a Flexible IP from a server.
576+
// DetachFlexibleIP: detach an existing flexible IP from a server.
577+
// Detach an existing flexible IP from a specified Elastic Metal server.
572578
func (s *API) DetachFlexibleIP(req *DetachFlexibleIPRequest, opts ...scw.RequestOption) (*DetachFlexibleIPsResponse, error) {
573579
var err error
574580

@@ -604,14 +610,15 @@ func (s *API) DetachFlexibleIP(req *DetachFlexibleIPRequest, opts ...scw.Request
604610
type GenerateMACAddrRequest struct {
605611
// Zone: zone to target. If none is passed will use default zone from the config.
606612
Zone scw.Zone `json:"-"`
607-
// FipID: flexible IP ID on which to generate a Virtual MAC.
613+
// FipID: ID of the flexible IP for which to generate a virtual MAC.
608614
FipID string `json:"-"`
609615
// MacType: tODO.
610616
// Default value: unknown_type
611617
MacType MACAddressType `json:"mac_type"`
612618
}
613619

614-
// GenerateMACAddr: generate a virtual MAC on a given Flexible IP.
620+
// GenerateMACAddr: generate a virtual MAC address on an existing flexible IP.
621+
// Generate a virtual MAC (Media Access Control) address on an existing flexible IP.
615622
func (s *API) GenerateMACAddr(req *GenerateMACAddrRequest, opts ...scw.RequestOption) (*FlexibleIP, error) {
616623
var err error
617624

@@ -651,16 +658,16 @@ func (s *API) GenerateMACAddr(req *GenerateMACAddrRequest, opts ...scw.RequestOp
651658
type DuplicateMACAddrRequest struct {
652659
// Zone: zone to target. If none is passed will use default zone from the config.
653660
Zone scw.Zone `json:"-"`
654-
// FipID: flexible IP ID on which to duplicate the Virtual MAC.
655-
// Flexible IPs need to be attached to the same server.
661+
// FipID: ID of the flexible IP on which to duplicate the virtual MAC.
662+
// Note that the flexible IPs need to be attached to the same server.
656663
FipID string `json:"-"`
657-
// DuplicateFromFipID: flexible IP ID to duplicate the Virtual MAC from.
658-
// Flexible IPs need to be attached to the same server.
664+
// DuplicateFromFipID: ID of the flexible IP to duplicate the Virtual MAC from.
665+
// Note that flexible IPs need to be attached to the same server.
659666
DuplicateFromFipID string `json:"duplicate_from_fip_id"`
660667
}
661668

662-
// DuplicateMACAddr: duplicate a Virtual MAC.
663-
// Duplicate a Virtual MAC from a given Flexible IP onto another attached on the same server.
669+
// DuplicateMACAddr: duplicate a virtual MAC address to another flexible IP.
670+
// Duplicate a virtual MAC address from a given flexible IP to another flexible IP attached to the same server.
664671
func (s *API) DuplicateMACAddr(req *DuplicateMACAddrRequest, opts ...scw.RequestOption) (*FlexibleIP, error) {
665672
var err error
666673

@@ -706,8 +713,8 @@ type MoveMACAddrRequest struct {
706713
DstFipID string `json:"dst_fip_id"`
707714
}
708715

709-
// MoveMACAddr: move a virtual MAC.
710-
// Move a Virtual MAC from a given Flexible IP onto another Flexible IP.
716+
// MoveMACAddr: relocate an existing virtual MAC address to a different flexible IP.
717+
// Relocate a virtual MAC (Media Access Control) address from an existing flexible IP to a different flexible IP.
711718
func (s *API) MoveMACAddr(req *MoveMACAddrRequest, opts ...scw.RequestOption) (*FlexibleIP, error) {
712719
var err error
713720

@@ -747,12 +754,13 @@ func (s *API) MoveMACAddr(req *MoveMACAddrRequest, opts ...scw.RequestOption) (*
747754
type DeleteMACAddrRequest struct {
748755
// Zone: zone to target. If none is passed will use default zone from the config.
749756
Zone scw.Zone `json:"-"`
750-
// FipID: flexible IP ID from which to delete the Virtual MAC.
751-
// If the Flexible IP belongs to a MAC group, the MAC will be removed from the MAC group and from the Flexible IP.
757+
// FipID: ID of the flexible IP from which to delete the virtual MAC.
758+
// If the flexible IP belongs to a MAC group, the MAC will be removed from both the MAC group and flexible IP.
752759
FipID string `json:"-"`
753760
}
754761

755-
// DeleteMACAddr: remove a virtual MAC from a Flexible IP.
762+
// DeleteMACAddr: detach a given virtual MAC address from an existing flexible IP.
763+
// Detach a given MAC (Media Access Control) address from an existing flexible IP.
756764
func (s *API) DeleteMACAddr(req *DeleteMACAddrRequest, opts ...scw.RequestOption) error {
757765
var err error
758766

0 commit comments

Comments
 (0)