client

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func IsForbiddenError(err error) bool

IsForbiddenError returns true if err is an HTTP 403 error.

func IsNotFoundError

func IsNotFoundError(err error) bool

IsNotFoundError returns true if err is an HTTP 404 error or ErrNoItemFound.

func IsPreconditionFailedError

func IsPreconditionFailedError(err error) bool

IsPreconditionFailedError returns true if err is a PreconditionFailedError.

func TagsWithoutCreatedBy added in v0.1.3

func TagsWithoutCreatedBy(tags []string) []string

TagsWithoutCreatedBy returns tags on a Scaleway resource, without the "created-by=..." tag that is automatically added by the client.

Types

type Block added in v0.1.1

type Block interface {
	UpdateVolumeIOPS(ctx context.Context, zone scw.Zone, volumeID string, iops int64) error
	UpdateVolumeTags(ctx context.Context, zone scw.Zone, volumeID string, tags []string) error
	FindVolume(ctx context.Context, zone scw.Zone, tags []string) (*block.Volume, error)
	DeleteVolume(ctx context.Context, zone scw.Zone, volumeID string) error
}

type BlockAPI added in v0.1.1

type BlockAPI interface {
	UpdateVolume(req *block.UpdateVolumeRequest, opts ...scw.RequestOption) (*block.Volume, error)
	ListVolumes(req *block.ListVolumesRequest, opts ...scw.RequestOption) (*block.ListVolumesResponse, error)
	DeleteVolume(req *block.DeleteVolumeRequest, opts ...scw.RequestOption) error
	// contains filtered or unexported methods
}

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

func New(region scw.Region, projectID string, secretData map[string][]byte) (*Client, error)

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 (c *Client) AddBackendServer(ctx context.Context, zone scw.Zone, backendID, ip string) error

func (*Client) AttachLBPrivateNetwork

func (c *Client) AttachLBPrivateNetwork(ctx context.Context, zone scw.Zone, lbID, privateNetworkID string, ipID *string) error

func (*Client) CleanAvailableIPs added in v0.1.1

func (c *Client) CleanAvailableIPs(ctx context.Context, privateNetworkID string) error

func (*Client) CreateBackend

func (c *Client) CreateBackend(
	ctx context.Context,
	zone scw.Zone,
	lbID,
	name string,
	servers []string,
	port int32,
) (*lb.Backend, error)

func (*Client) CreateCluster added in v0.1.3

func (c *Client) CreateCluster(
	ctx context.Context,
	name, clusterType, version string,
	pnID *string,
	tags, featureGates, admissionPlugins, apiServerCertSANs []string,
	cni k8s.CNI,
	autoscalerConfig *k8s.CreateClusterRequestAutoscalerConfig,
	autoUpgrade *k8s.CreateClusterRequestAutoUpgrade,
	openIDConnectConfig *k8s.CreateClusterRequestOpenIDConnectConfig,
	podCIDR, serviceCIDR scw.IPNet,
) (*k8s.Cluster, error)

func (*Client) CreateFrontend

func (c *Client) CreateFrontend(
	ctx context.Context,
	zone scw.Zone,
	lbID, name, backendID string,
	port int32,
) (*lb.Frontend, error)

func (*Client) CreateGateway

func (c *Client) CreateGateway(
	ctx context.Context,
	zone scw.Zone,
	name, gwType string,
	tags []string,
	ipID *string,
) (*vpcgw.Gateway, error)

func (*Client) CreateGatewayNetwork

func (c *Client) CreateGatewayNetwork(ctx context.Context, zone scw.Zone, gatewayID, privateNetworkID string) error

func (*Client) CreateIP

func (c *Client) CreateIP(ctx context.Context, zone scw.Zone, ipType instance.IPType, tags []string) (*instance.IP, error)

func (*Client) CreateLB

func (c *Client) CreateLB(
	ctx context.Context,
	zone scw.Zone,
	name, lbType string,
	ipID *string,
	private bool,
	tags []string,
) (*lb.LB, error)

func (*Client) CreateLBACL

func (c *Client) CreateLBACL(
	ctx context.Context,
	zone scw.Zone,
	frontendID, name string,
	index int32,
	action lb.ACLActionType,
	matchedSubnets []string,
) error

func (*Client) CreatePool added in v0.1.3

func (c *Client) CreatePool(
	ctx context.Context,
	zone scw.Zone,
	clusterID, name, nodeType string,
	placementGroupID, securityGroupID *string,
	autoscaling, autohealing, publicIPDisabled bool,
	size uint32,
	minSize, maxSize *uint32,
	tags []string,
	kubeletArgs map[string]string,
	rootVolumeType k8s.PoolVolumeType,
	rootVolumeSizeGB *uint64,
	upgradePolicy *k8s.CreatePoolRequestUpgradePolicy,
) (*k8s.Pool, error)

func (*Client) CreatePrivateNIC

func (c *Client) CreatePrivateNIC(ctx context.Context, zone scw.Zone, serverID, privateNetworkID string) (*instance.PrivateNIC, error)

func (*Client) CreatePrivateNetwork

func (c *Client) CreatePrivateNetwork(
	ctx context.Context,
	name string,
	vpcID, subnet *string,
	tags []string,
) (*vpc.PrivateNetwork, error)

func (*Client) CreateServer

func (c *Client) CreateServer(
	ctx context.Context,
	zone scw.Zone,
	name, commercialType, imageID string,
	placementGroupID, securityGroupID *string,
	rootVolumeSize scw.Size,
	rootVolumeType instance.VolumeVolumeType,
	tags []string,
) (*instance.Server, error)

func (*Client) DefaultZone

func (c *Client) DefaultZone() scw.Zone

DefaultZone returns the first zone of the region.

func (*Client) DeleteCluster added in v0.1.3

func (c *Client) DeleteCluster(ctx context.Context, id string, withAdditionalResources bool) error

func (*Client) DeleteDNSZoneRecords

func (c *Client) DeleteDNSZoneRecords(ctx context.Context, zone, name string) error

func (*Client) DeleteGateway

func (c *Client) DeleteGateway(ctx context.Context, zone scw.Zone, id string, deleteIP bool) error

func (*Client) DeleteIP

func (c *Client) DeleteIP(ctx context.Context, zone scw.Zone, ipID string) error

func (*Client) DeleteInstanceVolume

func (c *Client) DeleteInstanceVolume(ctx context.Context, zone scw.Zone, volumeID string) error

func (*Client) DeleteLB

func (c *Client) DeleteLB(ctx context.Context, zone scw.Zone, id string, releaseIP bool) error

func (*Client) DeleteLBACL

func (c *Client) DeleteLBACL(ctx context.Context, zone scw.Zone, aclID string) error

func (*Client) DeletePool added in v0.1.3

func (c *Client) DeletePool(ctx context.Context, id string) error

func (*Client) DeletePrivateNetwork

func (c *Client) DeletePrivateNetwork(ctx context.Context, id string) error

func (*Client) DeleteServer

func (c *Client) DeleteServer(ctx context.Context, zone scw.Zone, serverID string) error

func (*Client) DeleteServerUserData

func (c *Client) DeleteServerUserData(ctx context.Context, zone scw.Zone, serverID, key string) error

func (*Client) DeleteVolume

func (c *Client) DeleteVolume(ctx context.Context, zone scw.Zone, volumeID string) error

func (*Client) DetachVolume

func (c *Client) DetachVolume(ctx context.Context, zone scw.Zone, volumeID string) error

func (*Client) FindAvailableIPs added in v0.1.1

func (c *Client) FindAvailableIPs(ctx context.Context, privateNetworkID string) ([]*ipam.IP, error)

func (*Client) FindBackend

func (c *Client) FindBackend(ctx context.Context, zone scw.Zone, lbID, name string) (*lb.Backend, error)

func (*Client) FindCluster added in v0.1.3

func (c *Client) FindCluster(ctx context.Context, name string) (*k8s.Cluster, error)

func (*Client) FindFrontend

func (c *Client) FindFrontend(ctx context.Context, zone scw.Zone, lbID, name string) (*lb.Frontend, error)

func (*Client) FindGatewayIP

func (c *Client) FindGatewayIP(ctx context.Context, zone scw.Zone, ip string) (*vpcgw.IP, error)

func (*Client) FindGateways

func (c *Client) FindGateways(ctx context.Context, tags []string) ([]*vpcgw.Gateway, error)

func (*Client) FindIPs

func (c *Client) FindIPs(ctx context.Context, zone scw.Zone, tags []string) ([]*instance.IP, error)

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 (c *Client) FindInstanceVolume(ctx context.Context, zone scw.Zone, tags []string) (*instance.Volume, error)

func (*Client) FindLB

func (c *Client) FindLB(ctx context.Context, zone scw.Zone, tags []string) (*lb.LB, error)

func (*Client) FindLBACLByName

func (c *Client) FindLBACLByName(ctx context.Context, zone scw.Zone, frontendID, name string) (*lb.ACL, error)

func (*Client) FindLBIP

func (c *Client) FindLBIP(ctx context.Context, zone scw.Zone, ip string) (*lb.IP, error)

func (*Client) FindLBPrivateNetwork

func (c *Client) FindLBPrivateNetwork(
	ctx context.Context,
	zone scw.Zone,
	lbID, privateNetworkID string,
) (*lb.PrivateNetwork, error)

func (*Client) FindLBServersIPs added in v0.1.1

func (c *Client) FindLBServersIPs(ctx context.Context, privateNetworkID string, lbIDs []string) ([]*ipam.IP, error)

func (*Client) FindLBs

func (c *Client) FindLBs(ctx context.Context, tags []string) ([]*lb.LB, error)

func (*Client) FindPlacementGroup added in v0.1.1

func (c *Client) FindPlacementGroup(ctx context.Context, zone scw.Zone, name string) (*instance.PlacementGroup, error)

func (*Client) FindPool added in v0.1.3

func (c *Client) FindPool(ctx context.Context, clusterID, name string) (*k8s.Pool, error)

func (*Client) FindPrivateNICIPs

func (c *Client) FindPrivateNICIPs(ctx context.Context, privateNICID string) ([]*ipam.IP, error)

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) FindSecurityGroup added in v0.1.1

func (c *Client) FindSecurityGroup(ctx context.Context, zone scw.Zone, name string) (*instance.SecurityGroup, error)

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 (c *Client) FindVolume(ctx context.Context, zone scw.Zone, tags []string) (*block.Volume, error)

func (*Client) GetAllServerUserData

func (c *Client) GetAllServerUserData(ctx context.Context, zone scw.Zone, serverID string) (map[string]io.Reader, error)

func (*Client) GetClusterKubeConfig added in v0.1.3

func (c *Client) GetClusterKubeConfig(ctx context.Context, id string) (*k8s.Kubeconfig, error)

func (*Client) GetControlPlaneZones

func (c *Client) GetControlPlaneZones() []scw.Zone

GetControlPlaneZones returns the availables zone for the control plane machines.

func (*Client) GetLocalImageByLabel

func (c *Client) GetLocalImageByLabel(
	ctx context.Context,
	zone scw.Zone,
	commercialType,
	imageLabel string,
	imageType marketplace.LocalImageType,
) (*marketplace.LocalImage, error)

func (*Client) GetPrivateNetwork added in v0.1.1

func (c *Client) GetPrivateNetwork(ctx context.Context, privateNetworkID string) (*vpc.PrivateNetwork, error)

func (*Client) GetSecretKey added in v0.1.3

func (c *Client) GetSecretKey() string

func (*Client) GetZoneOrDefault

func (c *Client) GetZoneOrDefault(zone *string) (scw.Zone, error)

GetZoneOrDefault dereferences and parses the provided zone, or returns the default zone.

func (*Client) ListClusterACLRules added in v0.1.3

func (c *Client) ListClusterACLRules(ctx context.Context, clusterID string) ([]*k8s.ACLRule, error)

func (*Client) ListDNSZoneRecords

func (c *Client) ListDNSZoneRecords(ctx context.Context, zone, name string) ([]*domain.Record, error)

func (*Client) ListGatewayTypes added in v0.1.1

func (c *Client) ListGatewayTypes(ctx context.Context, zone scw.Zone) ([]string, error)

func (*Client) ListLBACLs

func (c *Client) ListLBACLs(ctx context.Context, zone scw.Zone, frontendID string) ([]*lb.ACL, error)

func (*Client) ListNodes added in v0.1.3

func (c *Client) ListNodes(ctx context.Context, clusterID, poolID string) ([]*k8s.Node, error)

func (*Client) MigrateLB

func (c *Client) MigrateLB(ctx context.Context, zone scw.Zone, id string, newType string) (*lb.LB, error)

func (*Client) RemoveBackendServer

func (c *Client) RemoveBackendServer(ctx context.Context, zone scw.Zone, backendID, ip string) error

func (*Client) ServerAction

func (c *Client) ServerAction(ctx context.Context, zone scw.Zone, serverID string, action instance.ServerAction) error

func (*Client) SetBackendServers

func (c *Client) SetBackendServers(
	ctx context.Context,
	zone scw.Zone,
	backendID string,
	servers []string,
) (*lb.Backend, error)

func (*Client) SetClusterACLRules added in v0.1.3

func (c *Client) SetClusterACLRules(ctx context.Context, clusterID string, rules []*k8s.ACLRuleRequest) error

func (*Client) SetClusterType added in v0.1.3

func (c *Client) SetClusterType(ctx context.Context, id, clusterType string) error

func (*Client) SetDNSZoneRecords

func (c *Client) SetDNSZoneRecords(ctx context.Context, zone, name string, ips []string) error

func (*Client) SetLBACLs

func (c *Client) SetLBACLs(ctx context.Context, zone scw.Zone, frontendID string, acls []*lb.ACLSpec) error

func (*Client) SetServerUserData

func (c *Client) SetServerUserData(ctx context.Context, zone scw.Zone, serverID, key, content string) error

func (*Client) UpdateCluster added in v0.1.3

func (c *Client) UpdateCluster(
	ctx context.Context,
	id string,
	tags, featureGates, admissionPlugins, apiServerCertSANs *[]string,
	autoscalerConfig *k8s.UpdateClusterRequestAutoscalerConfig,
	autoUpgrade *k8s.UpdateClusterRequestAutoUpgrade,
	openIDConnectConfig *k8s.UpdateClusterRequestOpenIDConnectConfig,
) error

func (*Client) UpdateInstanceVolumeTags

func (c *Client) UpdateInstanceVolumeTags(ctx context.Context, zone scw.Zone, volumeID string, tags []string) error

func (*Client) UpdateLBACL

func (c *Client) UpdateLBACL(
	ctx context.Context,
	zone scw.Zone,
	aclID, name string,
	index int32,
	action lb.ACLActionType,
	matchedSubnets []string,
) error

func (*Client) UpdatePool added in v0.1.3

func (c *Client) UpdatePool(
	ctx context.Context,
	id string,
	autoscaling, autohealing *bool,
	size, minSize, maxSize *uint32,
	tags *[]string,
	kubeletArgs *map[string]string,
	upgradePolicy *k8s.UpdatePoolRequestUpgradePolicy,
) error

func (*Client) UpdateServerPublicIPs added in v0.1.1

func (c *Client) UpdateServerPublicIPs(ctx context.Context, zone scw.Zone, id string, publicIPIDs []string) (*instance.Server, error)

func (*Client) UpdateVolumeIOPS

func (c *Client) UpdateVolumeIOPS(ctx context.Context, zone scw.Zone, volumeID string, iops int64) error

func (*Client) UpdateVolumeTags

func (c *Client) UpdateVolumeTags(ctx context.Context, zone scw.Zone, volumeID string, tags []string) error

func (*Client) UpgradeCluster added in v0.1.3

func (c *Client) UpgradeCluster(ctx context.Context, id, version string) error

func (*Client) UpgradeGateway added in v0.1.1

func (c *Client) UpgradeGateway(ctx context.Context, zone scw.Zone, gatewayID, newType string) (*vpcgw.Gateway, error)

func (*Client) UpgradePool added in v0.1.3

func (c *Client) UpgradePool(ctx context.Context, id, version string) error

type Config added in v0.1.3

type Config interface {
	GetSecretKey() string
}

type Domain added in v0.1.1

type Domain interface {
	ListDNSZoneRecords(ctx context.Context, zone, name string) ([]*domain.Record, error)
	DeleteDNSZoneRecords(ctx context.Context, zone string, name string) error
	SetDNSZoneRecords(ctx context.Context, zone string, name string, ips []string) error
}

type DomainAPI added in v0.1.1

type DomainAPI interface {
	ListDNSZoneRecords(req *domain.ListDNSZoneRecordsRequest, opts ...scw.RequestOption) (*domain.ListDNSZoneRecordsResponse, error)
	UpdateDNSZoneRecords(req *domain.UpdateDNSZoneRecordsRequest, opts ...scw.RequestOption) (*domain.UpdateDNSZoneRecordsResponse, error)
}

type IPAM added in v0.1.1

type IPAM interface {
	FindPrivateNICIPs(ctx context.Context, privateNICID string) ([]*ipam.IP, error)
	FindLBServersIPs(ctx context.Context, privateNetworkID string, lbIDs []string) ([]*ipam.IP, error)
	FindAvailableIPs(ctx context.Context, privateNetworkID string) ([]*ipam.IP, error)
	CleanAvailableIPs(ctx context.Context, privateNetworkID string) error
}

type IPAMAPI added in v0.1.1

type IPAMAPI interface {
	ListIPs(req *ipam.ListIPsRequest, opts ...scw.RequestOption) (*ipam.ListIPsResponse, error)
	ReleaseIPSet(req *ipam.ReleaseIPSetRequest, opts ...scw.RequestOption) error
}

type Instance added in v0.1.1

type Instance interface {
	FindServer(ctx context.Context, zone scw.Zone, tags []string) (*instance.Server, error)
	CreateServer(
		ctx context.Context,
		zone scw.Zone,
		name, commercialType, imageID string,
		placementGroupID, securityGroupID *string,
		rootVolumeSize scw.Size,
		rootVolumeType instance.VolumeVolumeType,
		tags []string,
	) (*instance.Server, error)
	FindImage(ctx context.Context, zone scw.Zone, name string) (*instance.Image, error)
	FindIPs(ctx context.Context, zone scw.Zone, tags []string) ([]*instance.IP, error)
	CreateIP(ctx context.Context, zone scw.Zone, ipType instance.IPType, tags []string) (*instance.IP, error)
	DeleteIP(ctx context.Context, zone scw.Zone, ipID string) error
	CreatePrivateNIC(ctx context.Context, zone scw.Zone, serverID, privateNetworkID string) (*instance.PrivateNIC, error)
	GetAllServerUserData(ctx context.Context, zone scw.Zone, serverID string) (map[string]io.Reader, error)
	SetServerUserData(ctx context.Context, zone scw.Zone, serverID, key, content string) error
	DeleteServerUserData(ctx context.Context, zone scw.Zone, serverID, key string) error
	ServerAction(ctx context.Context, zone scw.Zone, serverID string, action instance.ServerAction) error
	DetachVolume(ctx context.Context, zone scw.Zone, volumeID string) error
	UpdateInstanceVolumeTags(ctx context.Context, zone scw.Zone, volumeID string, tags []string) error
	FindInstanceVolume(ctx context.Context, zone scw.Zone, tags []string) (*instance.Volume, error)
	DeleteInstanceVolume(ctx context.Context, zone scw.Zone, volumeID string) error
	DeleteServer(ctx context.Context, zone scw.Zone, serverID string) error
	FindPlacementGroup(ctx context.Context, zone scw.Zone, name string) (*instance.PlacementGroup, error)
	FindSecurityGroup(ctx context.Context, zone scw.Zone, name string) (*instance.SecurityGroup, error)
	UpdateServerPublicIPs(ctx context.Context, zone scw.Zone, id string, publicIPIDs []string) (*instance.Server, error)
}

type InstanceAPI added in v0.1.1

type InstanceAPI interface {
	ListServers(req *instance.ListServersRequest, opts ...scw.RequestOption) (*instance.ListServersResponse, error)
	GetServerType(req *instance.GetServerTypeRequest) (*instance.ServerType, error)
	CreateServer(req *instance.CreateServerRequest, opts ...scw.RequestOption) (*instance.CreateServerResponse, error)
	ListImages(req *instance.ListImagesRequest, opts ...scw.RequestOption) (*instance.ListImagesResponse, error)
	ListIPs(req *instance.ListIPsRequest, opts ...scw.RequestOption) (*instance.ListIPsResponse, error)
	CreateIP(req *instance.CreateIPRequest, opts ...scw.RequestOption) (*instance.CreateIPResponse, error)
	DeleteIP(req *instance.DeleteIPRequest, opts ...scw.RequestOption) error
	CreatePrivateNIC(req *instance.CreatePrivateNICRequest, opts ...scw.RequestOption) (*instance.CreatePrivateNICResponse, error)
	GetAllServerUserData(req *instance.GetAllServerUserDataRequest, opts ...scw.RequestOption) (*instance.GetAllServerUserDataResponse, error)
	SetServerUserData(req *instance.SetServerUserDataRequest, opts ...scw.RequestOption) error
	DeleteServerUserData(req *instance.DeleteServerUserDataRequest, opts ...scw.RequestOption) error
	ServerAction(req *instance.ServerActionRequest, opts ...scw.RequestOption) (*instance.ServerActionResponse, error)
	DetachVolume(req *instance.DetachVolumeRequest, opts ...scw.RequestOption) (*instance.DetachVolumeResponse, error)
	UpdateVolume(req *instance.UpdateVolumeRequest, opts ...scw.RequestOption) (*instance.UpdateVolumeResponse, error)
	ListVolumes(req *instance.ListVolumesRequest, opts ...scw.RequestOption) (*instance.ListVolumesResponse, error)
	DeleteVolume(req *instance.DeleteVolumeRequest, opts ...scw.RequestOption) error
	DeleteServer(req *instance.DeleteServerRequest, opts ...scw.RequestOption) error
	ListPlacementGroups(req *instance.ListPlacementGroupsRequest, opts ...scw.RequestOption) (*instance.ListPlacementGroupsResponse, error)
	ListSecurityGroups(req *instance.ListSecurityGroupsRequest, opts ...scw.RequestOption) (*instance.ListSecurityGroupsResponse, error)
	UpdateServer(req *instance.UpdateServerRequest, opts ...scw.RequestOption) (*instance.UpdateServerResponse, error)
	// contains filtered or unexported methods
}

type Interface added in v0.1.1

type Interface interface {
	Block
	Config
	Domain
	Instance
	IPAM
	K8s
	LB
	Marketplace
	VPC
	VPCGW
	Zones
}

Interface of the scaleway-sdk-go wrapper to access Scaleway Product APIs in a specific region and project.

type K8s added in v0.1.3

type K8s interface {
	FindCluster(ctx context.Context, name string) (*k8s.Cluster, error)
	CreateCluster(
		ctx context.Context,
		name, clusterType, version string,
		pnID *string,
		tags, featureGates, admissionPlugins, apiServerCertSANs []string,
		cni k8s.CNI,
		autoscalerConfig *k8s.CreateClusterRequestAutoscalerConfig,
		autoUpgrade *k8s.CreateClusterRequestAutoUpgrade,
		openIDConnectConfig *k8s.CreateClusterRequestOpenIDConnectConfig,
		podCIDR, serviceCIDR scw.IPNet,
	) (*k8s.Cluster, error)
	DeleteCluster(ctx context.Context, id string, withAdditionalResources bool) error
	GetClusterKubeConfig(ctx context.Context, id string) (*k8s.Kubeconfig, error)
	UpdateCluster(
		ctx context.Context,
		id string,
		tags, featureGates, admissionPlugins, apiServerCertSANs *[]string,
		autoscalerConfig *k8s.UpdateClusterRequestAutoscalerConfig,
		autoUpgrade *k8s.UpdateClusterRequestAutoUpgrade,
		openIDConnectConfig *k8s.UpdateClusterRequestOpenIDConnectConfig,
	) error
	UpgradeCluster(ctx context.Context, id, version string) error
	SetClusterType(ctx context.Context, id, clusterType string) error
	FindPool(ctx context.Context, clusterID, name string) (*k8s.Pool, error)
	CreatePool(
		ctx context.Context,
		zone scw.Zone,
		clusterID, name, nodeType string,
		placementGroupID, securityGroupID *string,
		autoscaling, autohealing, publicIPDisabled bool,
		size uint32,
		minSize, maxSize *uint32,
		tags []string,
		kubeletArgs map[string]string,
		rootVolumeType k8s.PoolVolumeType,
		rootVolumeSizeGB *uint64,
		upgradePolicy *k8s.CreatePoolRequestUpgradePolicy,
	) (*k8s.Pool, error)
	UpdatePool(
		ctx context.Context,
		id string,
		autoscaling, autohealing *bool,
		size, minSize, maxSize *uint32,
		tags *[]string,
		kubeletArgs *map[string]string,
		upgradePolicy *k8s.UpdatePoolRequestUpgradePolicy,
	) error
	UpgradePool(ctx context.Context, id, version string) error
	DeletePool(ctx context.Context, id string) error
	ListNodes(ctx context.Context, clusterID, poolID string) ([]*k8s.Node, error)
	ListClusterACLRules(ctx context.Context, clusterID string) ([]*k8s.ACLRule, error)
	SetClusterACLRules(ctx context.Context, clusterID string, rules []*k8s.ACLRuleRequest) error
}

type K8sAPI added in v0.1.3

type K8sAPI interface {
	ListClusters(req *k8s.ListClustersRequest, opts ...scw.RequestOption) (*k8s.ListClustersResponse, error)
	CreateCluster(req *k8s.CreateClusterRequest, opts ...scw.RequestOption) (*k8s.Cluster, error)
	DeleteCluster(req *k8s.DeleteClusterRequest, opts ...scw.RequestOption) (*k8s.Cluster, error)
	GetClusterKubeConfig(req *k8s.GetClusterKubeConfigRequest, opts ...scw.RequestOption) (*k8s.Kubeconfig, error)
	UpdateCluster(req *k8s.UpdateClusterRequest, opts ...scw.RequestOption) (*k8s.Cluster, error)
	UpgradeCluster(req *k8s.UpgradeClusterRequest, opts ...scw.RequestOption) (*k8s.Cluster, error)
	SetClusterType(req *k8s.SetClusterTypeRequest, opts ...scw.RequestOption) (*k8s.Cluster, error)
	ListPools(req *k8s.ListPoolsRequest, opts ...scw.RequestOption) (*k8s.ListPoolsResponse, error)
	CreatePool(req *k8s.CreatePoolRequest, opts ...scw.RequestOption) (*k8s.Pool, error)
	UpdatePool(req *k8s.UpdatePoolRequest, opts ...scw.RequestOption) (*k8s.Pool, error)
	UpgradePool(req *k8s.UpgradePoolRequest, opts ...scw.RequestOption) (*k8s.Pool, error)
	DeletePool(req *k8s.DeletePoolRequest, opts ...scw.RequestOption) (*k8s.Pool, error)
	ListNodes(req *k8s.ListNodesRequest, opts ...scw.RequestOption) (*k8s.ListNodesResponse, error)
	ListClusterACLRules(req *k8s.ListClusterACLRulesRequest, opts ...scw.RequestOption) (*k8s.ListClusterACLRulesResponse, error)
	SetClusterACLRules(req *k8s.SetClusterACLRulesRequest, opts ...scw.RequestOption) (*k8s.SetClusterACLRulesResponse, error)
}

type LB added in v0.1.1

type LB interface {
	FindLB(ctx context.Context, zone scw.Zone, tags []string) (*lb.LB, error)
	MigrateLB(ctx context.Context, zone scw.Zone, id string, newType string) (*lb.LB, error)
	FindLBIP(ctx context.Context, zone scw.Zone, ip string) (*lb.IP, error)
	CreateLB(
		ctx context.Context,
		zone scw.Zone,
		name, lbType string,
		ipID *string,
		private bool,
		tags []string,
	) (*lb.LB, error)
	DeleteLB(ctx context.Context, zone scw.Zone, id string, releaseIP bool) error
	FindLBs(ctx context.Context, tags []string) ([]*lb.LB, error)
	FindBackend(ctx context.Context, zone scw.Zone, lbID, name string) (*lb.Backend, error)
	CreateBackend(
		ctx context.Context,
		zone scw.Zone,
		lbID,
		name string,
		servers []string,
		port int32,
	) (*lb.Backend, error)
	SetBackendServers(
		ctx context.Context,
		zone scw.Zone,
		backendID string,
		servers []string,
	) (*lb.Backend, error)
	FindFrontend(ctx context.Context, zone scw.Zone, lbID, name string) (*lb.Frontend, error)
	CreateFrontend(
		ctx context.Context,
		zone scw.Zone,
		lbID, name, backendID string,
		port int32,
	) (*lb.Frontend, error)
	FindLBPrivateNetwork(
		ctx context.Context,
		zone scw.Zone,
		lbID, privateNetworkID string,
	) (*lb.PrivateNetwork, error)
	AttachLBPrivateNetwork(ctx context.Context, zone scw.Zone, lbID, privateNetworkID string, ipID *string) error
	ListLBACLs(ctx context.Context, zone scw.Zone, frontendID string) ([]*lb.ACL, error)
	SetLBACLs(ctx context.Context, zone scw.Zone, frontendID string, acls []*lb.ACLSpec) error
	FindLBACLByName(ctx context.Context, zone scw.Zone, frontendID string, name string) (*lb.ACL, error)
	DeleteLBACL(ctx context.Context, zone scw.Zone, aclID string) error
	CreateLBACL(
		ctx context.Context,
		zone scw.Zone,
		frontendID, name string,
		index int32,
		action lb.ACLActionType,
		matchedSubnets []string,
	) error
	UpdateLBACL(
		ctx context.Context,
		zone scw.Zone,
		aclID, name string,
		index int32,
		action lb.ACLActionType,
		matchedSubnets []string,
	) error
	RemoveBackendServer(ctx context.Context, zone scw.Zone, backendID, ip string) error
	AddBackendServer(ctx context.Context, zone scw.Zone, backendID, ip string) error
}

type LBAPI added in v0.1.1

type LBAPI interface {
	ListLBs(req *lb.ZonedAPIListLBsRequest, opts ...scw.RequestOption) (*lb.ListLBsResponse, error)
	MigrateLB(req *lb.ZonedAPIMigrateLBRequest, opts ...scw.RequestOption) (*lb.LB, error)
	ListIPs(req *lb.ZonedAPIListIPsRequest, opts ...scw.RequestOption) (*lb.ListIPsResponse, error)
	CreateLB(req *lb.ZonedAPICreateLBRequest, opts ...scw.RequestOption) (*lb.LB, error)
	DeleteLB(req *lb.ZonedAPIDeleteLBRequest, opts ...scw.RequestOption) error
	ListBackends(req *lb.ZonedAPIListBackendsRequest, opts ...scw.RequestOption) (*lb.ListBackendsResponse, error)
	CreateBackend(req *lb.ZonedAPICreateBackendRequest, opts ...scw.RequestOption) (*lb.Backend, error)
	SetBackendServers(req *lb.ZonedAPISetBackendServersRequest, opts ...scw.RequestOption) (*lb.Backend, error)
	ListFrontends(req *lb.ZonedAPIListFrontendsRequest, opts ...scw.RequestOption) (*lb.ListFrontendsResponse, error)
	CreateFrontend(req *lb.ZonedAPICreateFrontendRequest, opts ...scw.RequestOption) (*lb.Frontend, error)
	ListLBPrivateNetworks(req *lb.ZonedAPIListLBPrivateNetworksRequest, opts ...scw.RequestOption) (*lb.ListLBPrivateNetworksResponse, error)
	AttachPrivateNetwork(req *lb.ZonedAPIAttachPrivateNetworkRequest, opts ...scw.RequestOption) (*lb.PrivateNetwork, error)
	ListACLs(req *lb.ZonedAPIListACLsRequest, opts ...scw.RequestOption) (*lb.ListACLResponse, error)
	SetACLs(req *lb.ZonedAPISetACLsRequest, opts ...scw.RequestOption) (*lb.SetACLsResponse, error)
	DeleteACL(req *lb.ZonedAPIDeleteACLRequest, opts ...scw.RequestOption) error
	CreateACL(req *lb.ZonedAPICreateACLRequest, opts ...scw.RequestOption) (*lb.ACL, error)
	UpdateACL(req *lb.ZonedAPIUpdateACLRequest, opts ...scw.RequestOption) (*lb.ACL, error)
	RemoveBackendServers(req *lb.ZonedAPIRemoveBackendServersRequest, opts ...scw.RequestOption) (*lb.Backend, error)
	AddBackendServers(req *lb.ZonedAPIAddBackendServersRequest, opts ...scw.RequestOption) (*lb.Backend, error)
	// contains filtered or unexported methods
}

type Marketplace added in v0.1.1

type Marketplace interface {
	GetLocalImageByLabel(
		ctx context.Context,
		zone scw.Zone,
		commercialType,
		imageLabel string,
		imageType marketplace.LocalImageType,
	) (*marketplace.LocalImage, error)
}

type MarketplaceAPI added in v0.1.1

type MarketplaceAPI interface {
	GetLocalImageByLabel(req *marketplace.GetLocalImageByLabelRequest, opts ...scw.RequestOption) (*marketplace.LocalImage, error)
}

type VPC added in v0.1.1

type VPC interface {
	FindPrivateNetwork(ctx context.Context, tags []string, vpcID *string) (*vpc.PrivateNetwork, error)
	DeletePrivateNetwork(ctx context.Context, id string) error
	CreatePrivateNetwork(
		ctx context.Context,
		name string,
		vpcID, subnet *string,
		tags []string,
	) (*vpc.PrivateNetwork, error)
	GetPrivateNetwork(ctx context.Context, privateNetworkID string) (*vpc.PrivateNetwork, error)
}

type VPCAPI added in v0.1.1

type VPCAPI interface {
	ListPrivateNetworks(req *vpc.ListPrivateNetworksRequest, opts ...scw.RequestOption) (*vpc.ListPrivateNetworksResponse, error)
	DeletePrivateNetwork(req *vpc.DeletePrivateNetworkRequest, opts ...scw.RequestOption) error
	CreatePrivateNetwork(req *vpc.CreatePrivateNetworkRequest, opts ...scw.RequestOption) (*vpc.PrivateNetwork, error)
	GetPrivateNetwork(req *vpc.GetPrivateNetworkRequest, opts ...scw.RequestOption) (*vpc.PrivateNetwork, error)
}

type VPCGW added in v0.1.1

type VPCGW interface {
	FindGateways(ctx context.Context, tags []string) ([]*vpcgw.Gateway, error)
	DeleteGateway(ctx context.Context, zone scw.Zone, id string, deleteIP bool) error
	FindGatewayIP(ctx context.Context, zone scw.Zone, ip string) (*vpcgw.IP, error)
	CreateGateway(
		ctx context.Context,
		zone scw.Zone,
		name, gwType string,
		tags []string,
		ipID *string,
	) (*vpcgw.Gateway, error)
	CreateGatewayNetwork(ctx context.Context, zone scw.Zone, gatewayID, privateNetworkID string) error
	ListGatewayTypes(ctx context.Context, zone scw.Zone) ([]string, error)
	UpgradeGateway(ctx context.Context, zone scw.Zone, gatewayID, newType string) (*vpcgw.Gateway, error)
}

type VPCGWAPI added in v0.1.1

type VPCGWAPI interface {
	ListGateways(req *vpcgw.ListGatewaysRequest, opts ...scw.RequestOption) (*vpcgw.ListGatewaysResponse, error)
	DeleteGateway(req *vpcgw.DeleteGatewayRequest, opts ...scw.RequestOption) (*vpcgw.Gateway, error)
	ListIPs(req *vpcgw.ListIPsRequest, opts ...scw.RequestOption) (*vpcgw.ListIPsResponse, error)
	CreateGateway(req *vpcgw.CreateGatewayRequest, opts ...scw.RequestOption) (*vpcgw.Gateway, error)
	CreateGatewayNetwork(req *vpcgw.CreateGatewayNetworkRequest, opts ...scw.RequestOption) (*vpcgw.GatewayNetwork, error)
	ListGatewayTypes(req *vpcgw.ListGatewayTypesRequest, opts ...scw.RequestOption) (*vpcgw.ListGatewayTypesResponse, error)
	UpgradeGateway(req *vpcgw.UpgradeGatewayRequest, opts ...scw.RequestOption) (*vpcgw.Gateway, error)
	// contains filtered or unexported methods
}

type Zones added in v0.1.1

type Zones interface {
	GetZoneOrDefault(zone *string) (scw.Zone, error)
	DefaultZone() scw.Zone
	GetControlPlaneZones() []scw.Zone
}

Directories

Path Synopsis
Package mock_client is a generated GoMock package.
Package mock_client is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL