Documentation
¶
Index ¶
- Variables
- func IsForbiddenError(err error) bool
- func IsNotFoundError(err error) bool
- func IsPreconditionFailedError(err error) bool
- type Client
- func (c *Client) AddBackendServer(ctx context.Context, zone scw.Zone, backendID, ip string) error
- func (c *Client) AttachLBPrivateNetwork(ctx context.Context, zone scw.Zone, lbID, privateNetworkID string) error
- func (c *Client) CreateBackend(ctx context.Context, zone scw.Zone, lbID, name string, servers []string, ...) (*lb.Backend, error)
- func (c *Client) CreateFrontend(ctx context.Context, zone scw.Zone, lbID, name, backendID string, port int32) (*lb.Frontend, error)
- func (c *Client) CreateGateway(ctx context.Context, zone scw.Zone, name, gwType string, tags []string, ...) (*vpcgw.Gateway, error)
- func (c *Client) CreateGatewayNetwork(ctx context.Context, zone scw.Zone, gatewayID, privateNetworkID string) error
- func (c *Client) CreateIP(ctx context.Context, zone scw.Zone, ipType instance.IPType, tags []string) (*instance.IP, error)
- func (c *Client) CreateLB(ctx context.Context, zone scw.Zone, name, lbType string, ipID *string, ...) (*lb.LB, error)
- func (c *Client) CreateLBACL(ctx context.Context, zone scw.Zone, frontendID, name string, index int32, ...) error
- func (c *Client) CreatePrivateNIC(ctx context.Context, zone scw.Zone, serverID, privateNetworkID string) (*instance.PrivateNIC, error)
- func (c *Client) CreatePrivateNetwork(ctx context.Context, name string, vpcID, subnet *string, tags []string) (*vpc.PrivateNetwork, error)
- func (c *Client) CreateServer(ctx context.Context, zone scw.Zone, name, commercialType, imageID string, ...) (*instance.Server, error)
- func (c *Client) DefaultZone() scw.Zone
- func (c *Client) DeleteDNSZoneRecords(ctx context.Context, zone, name string) error
- func (c *Client) DeleteGateway(ctx context.Context, zone scw.Zone, id string, deleteIP bool) error
- func (c *Client) DeleteIP(ctx context.Context, zone scw.Zone, ipID string) error
- func (c *Client) DeleteInstanceVolume(ctx context.Context, zone scw.Zone, volumeID string) error
- func (c *Client) DeleteLB(ctx context.Context, zone scw.Zone, id string, releaseIP bool) error
- func (c *Client) DeleteLBACL(ctx context.Context, zone scw.Zone, aclID string) error
- func (c *Client) DeletePrivateNetwork(ctx context.Context, id string) error
- func (c *Client) DeleteServer(ctx context.Context, zone scw.Zone, serverID string) error
- func (c *Client) DeleteServerUserData(ctx context.Context, zone scw.Zone, serverID, key string) error
- func (c *Client) DeleteVolume(ctx context.Context, zone scw.Zone, volumeID string) error
- func (c *Client) DetachVolume(ctx context.Context, zone scw.Zone, volumeID string) error
- func (c *Client) FindBackend(ctx context.Context, zone scw.Zone, lbID, name string) (*lb.Backend, error)
- func (c *Client) FindFrontend(ctx context.Context, zone scw.Zone, lbID, name string) (*lb.Frontend, error)
- func (c *Client) FindGatewayIP(ctx context.Context, zone scw.Zone, ip string) (*vpcgw.IP, error)
- func (c *Client) FindGateways(ctx context.Context, tags []string) ([]*vpcgw.Gateway, error)
- func (c *Client) FindIPs(ctx context.Context, zone scw.Zone, tags []string) ([]*instance.IP, error)
- func (c *Client) FindImage(ctx context.Context, zone scw.Zone, name string) (*instance.Image, error)
- func (c *Client) FindInstanceVolume(ctx context.Context, zone scw.Zone, tags []string) (*instance.Volume, error)
- func (c *Client) FindLB(ctx context.Context, zone scw.Zone, tags []string) (*lb.LB, error)
- func (c *Client) FindLBACLByName(ctx context.Context, zone scw.Zone, frontendID, name string) (*lb.ACL, error)
- func (c *Client) FindLBIP(ctx context.Context, zone scw.Zone, ip string) (*lb.IP, error)
- func (c *Client) FindLBPrivateNetwork(ctx context.Context, zone scw.Zone, lbID, privateNetworkID string) (*lb.PrivateNetwork, error)
- func (c *Client) FindLBs(ctx context.Context, tags []string) ([]*lb.LB, error)
- func (c *Client) FindPrivateNICIPs(ctx context.Context, privateNICID string) ([]*ipam.IP, error)
- func (c *Client) FindPrivateNetwork(ctx context.Context, tags []string, vpcID *string) (*vpc.PrivateNetwork, error)
- func (c *Client) FindServer(ctx context.Context, zone scw.Zone, tags []string) (*instance.Server, error)
- func (c *Client) FindVolume(ctx context.Context, zone scw.Zone, tags []string) (*block.Volume, error)
- func (c *Client) GetAllServerUserData(ctx context.Context, zone scw.Zone, serverID string) (map[string]io.Reader, error)
- func (c *Client) GetControlPlaneZones() []scw.Zone
- func (c *Client) GetLocalImageByLabel(ctx context.Context, zone scw.Zone, commercialType, imageLabel string, ...) (*marketplace.LocalImage, error)
- func (c *Client) GetZoneOrDefault(zone *string) (scw.Zone, error)
- func (c *Client) ListDNSZoneRecords(ctx context.Context, zone, name string) ([]*domain.Record, error)
- func (c *Client) ListLBACLs(ctx context.Context, zone scw.Zone, frontendID string) ([]*lb.ACL, error)
- func (c *Client) MigrateLB(ctx context.Context, zone scw.Zone, id string, newType string) (*lb.LB, error)
- func (c *Client) RemoveBackendServer(ctx context.Context, zone scw.Zone, backendID, ip string) error
- func (c *Client) ServerAction(ctx context.Context, zone scw.Zone, serverID string, ...) error
- func (c *Client) SetBackendServers(ctx context.Context, zone scw.Zone, backendID string, servers []string) (*lb.Backend, error)
- func (c *Client) SetDNSZoneRecords(ctx context.Context, zone, name string, ips []string) error
- func (c *Client) SetLBACLs(ctx context.Context, zone scw.Zone, frontendID string, acls []*lb.ACLSpec) error
- func (c *Client) SetServerUserData(ctx context.Context, zone scw.Zone, serverID, key, content string) error
- func (c *Client) UpdateInstanceVolumeTags(ctx context.Context, zone scw.Zone, volumeID string, tags []string) error
- func (c *Client) UpdateLBACL(ctx context.Context, zone scw.Zone, aclID, name string, index int32, ...) error
- func (c *Client) UpdateVolumeIOPS(ctx context.Context, zone scw.Zone, volumeID string, iops int64) error
- func (c *Client) UpdateVolumeTags(ctx context.Context, zone scw.Zone, volumeID string, tags []string) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoItemFound is returned when trying to find a resource that does not exist. ErrNoItemFound = errors.New("no item found") // ErrTooManyItemsFound is returned when trying to find a resource but more than one are found. ErrTooManyItemsFound = errors.New("expected to find only one item") )
Functions ¶
func IsForbiddenError ¶
IsForbiddenError returns true if err is an HTTP 403 error.
func IsNotFoundError ¶
IsNotFoundError returns true if err is an HTTP 404 error or ErrNoItemFound.
func IsPreconditionFailedError ¶
IsPreconditionFailedError returns true if err is a PreconditionFailedError.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper over scaleway-sdk-go to access Scaleway Product APIs in a specific region and project.
func New ¶
New returns a new Scaleway client based on the provided region and secretData. The secret data must contain a default projectID and credentials.
func (*Client) AddBackendServer ¶
func (*Client) AttachLBPrivateNetwork ¶
func (*Client) CreateBackend ¶
func (*Client) CreateFrontend ¶
func (*Client) CreateGateway ¶
func (*Client) CreateGatewayNetwork ¶
func (*Client) CreateLBACL ¶
func (*Client) CreatePrivateNIC ¶
func (*Client) CreatePrivateNetwork ¶
func (*Client) CreateServer ¶
func (*Client) DefaultZone ¶
DefaultZone returns the first zone of the region.
func (*Client) DeleteDNSZoneRecords ¶
func (*Client) DeleteGateway ¶
func (*Client) DeleteInstanceVolume ¶
func (*Client) DeleteLBACL ¶
func (*Client) DeletePrivateNetwork ¶
func (*Client) DeleteServer ¶
func (*Client) DeleteServerUserData ¶
func (*Client) DeleteVolume ¶
func (*Client) DetachVolume ¶
func (*Client) FindBackend ¶
func (*Client) FindFrontend ¶
func (*Client) FindGatewayIP ¶
func (*Client) FindGateways ¶
func (*Client) FindImage ¶
func (c *Client) FindImage(ctx context.Context, zone scw.Zone, name string) (*instance.Image, error)
FindImage finds an existing Instance image by name. It returns ErrNoItemFound if no matching image is found.
func (*Client) FindInstanceVolume ¶
func (*Client) FindLBACLByName ¶
func (*Client) FindLBPrivateNetwork ¶
func (*Client) FindPrivateNICIPs ¶
func (*Client) FindPrivateNetwork ¶
func (c *Client) FindPrivateNetwork(ctx context.Context, tags []string, vpcID *string) (*vpc.PrivateNetwork, error)
FindPrivateNetwork finds an existing Private Network by tags. It returns ErrNoItemFound if no matching Private Network is found.
func (*Client) FindServer ¶
func (c *Client) FindServer(ctx context.Context, zone scw.Zone, tags []string) (*instance.Server, error)
FindServer finds an existing Instance server by tags. It returns ErrNoItemFound if no matching server is found.
func (*Client) FindVolume ¶
func (*Client) GetAllServerUserData ¶
func (*Client) GetControlPlaneZones ¶
GetControlPlaneZones returns the availables zone for the control plane machines.
func (*Client) GetLocalImageByLabel ¶
func (*Client) GetZoneOrDefault ¶
GetZoneOrDefault dereferences and parses the provided zone, or returns the default zone.