Skip to content

Commit

Permalink
fix(ipam): make public detach & move ips idempotency (#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
scaleway-bot authored Sep 9, 2024
1 parent f0b2e3a commit 00d3fbf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions api/ipam/v1/ipam_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ type BookIPRequest struct {
// Tags: tags for the IP.
Tags []string `json:"tags"`

// Resource: custom resource to attach to the IP being booked. An example of a custom resource is a virtual machine hosted on an Elastic Metal server, or an additional user network interface on an Instance. Do not use this for attaching IP addresses to standard Scaleway resources, as it will fail - instead, see the relevant product API for an equivalent method.
// Resource: custom resource to attach to the IP being booked. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this for attaching IP addresses to standard Scaleway resources, as it will fail - instead, see the relevant product API for an equivalent method.
Resource *CustomResource `json:"resource,omitempty"`
}

Expand All @@ -280,6 +280,9 @@ type DetachIPRequest struct {

// IPID: IP ID.
IPID string `json:"-"`

// Resource: custom resource currently attached to the IP.
Resource *CustomResource `json:"resource"`
}

// GetIPRequest: get ip request.
Expand Down Expand Up @@ -387,8 +390,11 @@ type MoveIPRequest struct {
// IPID: IP ID.
IPID string `json:"-"`

// Resource: custom resource to be attached to the IP.
Resource *CustomResource `json:"resource,omitempty"`
// FromResource: custom resource currently attached to the IP.
FromResource *CustomResource `json:"from_resource"`

// ToResource: custom resource to be attached to the IP.
ToResource *CustomResource `json:"to_resource,omitempty"`
}

// ReleaseIPRequest: release ip request.
Expand Down Expand Up @@ -658,7 +664,7 @@ func (s *API) ListIPs(req *ListIPsRequest, opts ...scw.RequestOption) (*ListIPsR
return &resp, nil
}

// AttachIP: Attach an existing IP from a Private Network subnet to a custom, named resource via its MAC address. An example of a custom resource is a virtual machine hosted on an Elastic Metal server, or an additional user network interface on an Instance. Do not use this method for attaching IP addresses to standard Scaleway resources as it will fail - see the relevant product API for an equivalent method.
// AttachIP: Attach an existing IP from a Private Network subnet to a custom, named resource via its MAC address. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for attaching IP addresses to standard Scaleway resources as it will fail - see the relevant product API for an equivalent method.
func (s *API) AttachIP(req *AttachIPRequest, opts ...scw.RequestOption) (*IP, error) {
var err error

Expand Down

0 comments on commit 00d3fbf

Please sign in to comment.