forked from Ivasoft/traefik
Update lego
This commit is contained in:
committed by
Traefiker Bot
parent
0a89cccdc0
commit
73e0561610
64
vendor/github.com/linode/linodego/instance_ips.go
generated
vendored
64
vendor/github.com/linode/linodego/instance_ips.go
generated
vendored
@@ -14,22 +14,23 @@ type InstanceIPAddressResponse struct {
|
||||
|
||||
// InstanceIPv4Response contains the details of all IPv4 addresses associated with an Instance
|
||||
type InstanceIPv4Response struct {
|
||||
Public []*InstanceIP `json:"public"`
|
||||
Private []*InstanceIP `json:"private"`
|
||||
Shared []*InstanceIP `json:"shared"`
|
||||
Public []*InstanceIP `json:"public"`
|
||||
Private []*InstanceIP `json:"private"`
|
||||
Shared []*InstanceIP `json:"shared"`
|
||||
Reserved []*InstanceIP `json:"reserved"`
|
||||
}
|
||||
|
||||
// InstanceIP represents an Instance IP with additional DNS and networking details
|
||||
type InstanceIP struct {
|
||||
Address string `json:"address"`
|
||||
Gateway string `json:"gateway"`
|
||||
SubnetMask string `json:"subnet_mask"`
|
||||
Prefix int `json:"prefix"`
|
||||
Type string `json:"type"`
|
||||
Public bool `json:"public"`
|
||||
RDNS string `json:"rdns"`
|
||||
LinodeID int `json:"linode_id"`
|
||||
Region string `json:"region"`
|
||||
Address string `json:"address"`
|
||||
Gateway string `json:"gateway"`
|
||||
SubnetMask string `json:"subnet_mask"`
|
||||
Prefix int `json:"prefix"`
|
||||
Type InstanceIPType `json:"type"`
|
||||
Public bool `json:"public"`
|
||||
RDNS string `json:"rdns"`
|
||||
LinodeID int `json:"linode_id"`
|
||||
Region string `json:"region"`
|
||||
}
|
||||
|
||||
// InstanceIPv6Response contains the IPv6 addresses and ranges for an Instance
|
||||
@@ -43,8 +44,20 @@ type InstanceIPv6Response struct {
|
||||
type IPv6Range struct {
|
||||
Range string `json:"range"`
|
||||
Region string `json:"region"`
|
||||
Prefix int `json:"prefix"`
|
||||
}
|
||||
|
||||
// InstanceIPType constants start with IPType and include Linode Instance IP Types
|
||||
type InstanceIPType string
|
||||
|
||||
// InstanceIPType constants represent the IP types an Instance IP may be
|
||||
const (
|
||||
IPTypeIPv4 InstanceIPType = "ipv4"
|
||||
IPTypeIPv6 InstanceIPType = "ipv6"
|
||||
IPTypeIPv6Pool InstanceIPType = "ipv6/pool"
|
||||
IPTypeIPv6Range InstanceIPType = "ipv6/range"
|
||||
)
|
||||
|
||||
// GetInstanceIPAddresses gets the IPAddresses for a Linode instance
|
||||
func (c *Client) GetInstanceIPAddresses(ctx context.Context, linodeID int) (*InstanceIPAddressResponse, error) {
|
||||
e, err := c.InstanceIPs.endpointWithID(linodeID)
|
||||
@@ -104,3 +117,30 @@ func (c *Client) AddInstanceIPAddress(ctx context.Context, linodeID int, public
|
||||
|
||||
return r.Result().(*InstanceIP), nil
|
||||
}
|
||||
|
||||
// UpdateInstanceIPAddress updates the IPAddress with the specified instance id and IP address
|
||||
func (c *Client) UpdateInstanceIPAddress(ctx context.Context, linodeID int, ipAddress string, updateOpts IPAddressUpdateOptions) (*InstanceIP, error) {
|
||||
var body string
|
||||
e, err := c.InstanceIPs.endpointWithID(linodeID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
e = fmt.Sprintf("%s/%s", e, ipAddress)
|
||||
|
||||
req := c.R(ctx).SetResult(&InstanceIP{})
|
||||
|
||||
if bodyData, err := json.Marshal(updateOpts); err == nil {
|
||||
body = string(bodyData)
|
||||
} else {
|
||||
return nil, NewError(err)
|
||||
}
|
||||
|
||||
r, err := coupleAPIErrors(req.
|
||||
SetBody(body).
|
||||
Put(e))
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return r.Result().(*InstanceIP), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user