v2

package
v0.77.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package v2 is the new Exoscale client API binding. Reference: https://openapi-v2.exoscale.com/

Index

Constants

This section is empty.

Variables

View Source
var ErrClientConfig = errors.New("client configuration error")

ErrClientConfig represents a client configuration error.

View Source
var UserAgent = fmt.Sprintf("egoscale/%s (%s; %s/%s)",
	version.Version,
	runtime.Version(),
	runtime.GOOS,
	runtime.GOARCH)

UserAgent is the "User-Agent" HTTP request header added to outgoing HTTP requests.

Functions

This section is empty.

Types

type AntiAffinityGroup added in v0.44.0

type AntiAffinityGroup struct {
	Description *string
	ID          *string `req-for:"delete"`
	InstanceIDs *[]string
	Name        *string `req-for:"create"`
}

AntiAffinityGroup represents an Anti-Affinity Group.

type AttachInstanceToPrivateNetworkOpt added in v0.77.0

type AttachInstanceToPrivateNetworkOpt func(*oapi.AttachInstanceToPrivateNetworkJSONRequestBody)

AttachInstanceToPrivateNetworkOpt represents an AttachInstanceToPrivateNetwork operation option.

func AttachInstanceToPrivateNetworkWithIPAddress added in v0.77.0

func AttachInstanceToPrivateNetworkWithIPAddress(v net.IP) AttachInstanceToPrivateNetworkOpt

AttachInstanceToPrivateNetworkWithIPAddress sets the Private Network lease IP address to request for the Compute instance.

type Client

type Client struct {
	*oapi.ClientWithResponses
	// contains filtered or unexported fields
}

Client represents an Exoscale API client.

func NewClient

func NewClient(apiKey, apiSecret string, opts ...ClientOpt) (*Client, error)

NewClient returns a new Exoscale API client, or an error if one couldn't be initialized.

func (*Client) AddExternalSourceToSecurityGroup added in v0.73.0

func (c *Client) AddExternalSourceToSecurityGroup(
	ctx context.Context,
	zone string,
	securityGroup *SecurityGroup,
	cidr string,
) error

AddExternalSourceToSecurityGroup adds a new external source to a Security Group. This operation is idempotent.

func (*Client) AttachInstanceToElasticIP added in v0.69.0

func (c *Client) AttachInstanceToElasticIP(
	ctx context.Context,
	zone string,
	instance *Instance,
	elasticIP *ElasticIP,
) error

AttachInstanceToElasticIP attaches a Compute instance to the specified Elastic IP.

func (*Client) AttachInstanceToPrivateNetwork added in v0.69.0

func (c *Client) AttachInstanceToPrivateNetwork(
	ctx context.Context,
	zone string,
	instance *Instance,
	privateNetwork *PrivateNetwork,
	opts ...AttachInstanceToPrivateNetworkOpt,
) error

AttachInstanceToPrivateNetwork attaches a Compute instance to the specified Private Network.

func (*Client) AttachInstanceToSecurityGroup added in v0.69.0

func (c *Client) AttachInstanceToSecurityGroup(
	ctx context.Context,
	zone string,
	instance *Instance,
	securityGroup *SecurityGroup,
) error

AttachInstanceToSecurityGroup attaches a Compute instance to the specified Security Group.

func (*Client) CreateAntiAffinityGroup added in v0.44.0

func (c *Client) CreateAntiAffinityGroup(
	ctx context.Context,
	zone string,
	antiAffinityGroup *AntiAffinityGroup,
) (*AntiAffinityGroup, error)

CreateAntiAffinityGroup creates an Anti-Affinity Group.

func (*Client) CreateDatabaseService added in v0.57.0

func (c *Client) CreateDatabaseService(
	ctx context.Context,
	zone string,
	databaseService *DatabaseService,
) (*DatabaseService, error)

CreateDatabaseService creates a Database Service.

func (*Client) CreateElasticIP added in v0.45.0

func (c *Client) CreateElasticIP(ctx context.Context, zone string, elasticIP *ElasticIP) (*ElasticIP, error)

CreateElasticIP creates an Elastic IP.

func (*Client) CreateInstance added in v0.48.0

func (c *Client) CreateInstance(ctx context.Context, zone string, instance *Instance) (*Instance, error)

CreateInstance creates a Compute instance.

func (*Client) CreateInstancePool added in v0.44.0

func (c *Client) CreateInstancePool(
	ctx context.Context,
	zone string,
	instancePool *InstancePool,
) (*InstancePool, error)

CreateInstancePool creates an Instance Pool.

func (*Client) CreateInstanceSnapshot added in v0.69.0

func (c *Client) CreateInstanceSnapshot(ctx context.Context, zone string, instance *Instance) (*Snapshot, error)

CreateInstanceSnapshot creates a Snapshot of a Compute instance storage volume.

func (*Client) CreateNetworkLoadBalancer

func (c *Client) CreateNetworkLoadBalancer(
	ctx context.Context,
	zone string,
	nlb *NetworkLoadBalancer,
) (*NetworkLoadBalancer, error)

CreateNetworkLoadBalancer creates a Network Load Balancer.

func (*Client) CreateNetworkLoadBalancerService added in v0.69.0

func (c *Client) CreateNetworkLoadBalancerService(
	ctx context.Context,
	zone string,
	nlb *NetworkLoadBalancer,
	service *NetworkLoadBalancerService,
) (*NetworkLoadBalancerService, error)

CreateNetworkLoadBalancerService creates a Network Load Balancer service.

func (*Client) CreatePrivateNetwork added in v0.44.0

func (c *Client) CreatePrivateNetwork(
	ctx context.Context,
	zone string,
	privateNetwork *PrivateNetwork,
) (*PrivateNetwork, error)

CreatePrivateNetwork creates a Private Network.

func (*Client) CreateSKSCluster

func (c *Client) CreateSKSCluster(ctx context.Context, zone string, cluster *SKSCluster) (*SKSCluster, error)

CreateSKSCluster creates an SKS cluster.

func (*Client) CreateSKSNodepool added in v0.69.0

func (c *Client) CreateSKSNodepool(
	ctx context.Context,
	zone string,
	cluster *SKSCluster,
	nodepool *SKSNodepool,
) (*SKSNodepool, error)

CreateSKSNodepool create an SKS Nodepool.

func (*Client) CreateSecurityGroup added in v0.44.0

func (c *Client) CreateSecurityGroup(
	ctx context.Context,
	zone string,
	securityGroup *SecurityGroup,
) (*SecurityGroup, error)

CreateSecurityGroup creates a Security Group.

func (*Client) CreateSecurityGroupRule added in v0.69.0

func (c *Client) CreateSecurityGroupRule(
	ctx context.Context,
	zone string,
	securityGroup *SecurityGroup,
	rule *SecurityGroupRule,
) (*SecurityGroupRule, error)

CreateSecurityGroupRule creates a Security Group rule.

func (*Client) DeleteAntiAffinityGroup added in v0.44.0

func (c *Client) DeleteAntiAffinityGroup(
	ctx context.Context,
	zone string,
	antiAffinityGroup *AntiAffinityGroup,
) error

DeleteAntiAffinityGroup deletes an Anti-Affinity Group.

func (*Client) DeleteDatabaseService added in v0.57.0

func (c *Client) DeleteDatabaseService(ctx context.Context, zone string, databaseService *DatabaseService) error

DeleteDatabaseService deletes a Database Service.

func (*Client) DeleteElasticIP added in v0.45.0

func (c *Client) DeleteElasticIP(ctx context.Context, zone string, elasticIP *ElasticIP) error

DeleteElasticIP deletes an Elastic IP.

func (*Client) DeleteInstance added in v0.48.0

func (c *Client) DeleteInstance(ctx context.Context, zone string, instance *Instance) error

DeleteInstance deletes a Compute instance.

func (*Client) DeleteInstancePool added in v0.44.0

func (c *Client) DeleteInstancePool(ctx context.Context, zone string, instancePool *InstancePool) error

DeleteInstancePool deletes an Instance Pool.

func (*Client) DeleteNetworkLoadBalancer

func (c *Client) DeleteNetworkLoadBalancer(ctx context.Context, zone string, nlb *NetworkLoadBalancer) error

DeleteNetworkLoadBalancer deletes a Network Load Balancer.

func (*Client) DeleteNetworkLoadBalancerService added in v0.69.0

func (c *Client) DeleteNetworkLoadBalancerService(
	ctx context.Context,
	zone string,
	nlb *NetworkLoadBalancer,
	service *NetworkLoadBalancerService,
) error

DeleteNetworkLoadBalancerService deletes a Network Load Balancer service.

func (*Client) DeletePrivateNetwork added in v0.44.0

func (c *Client) DeletePrivateNetwork(ctx context.Context, zone string, privateNetwork *PrivateNetwork) error

DeletePrivateNetwork deletes a Private Network.

func (*Client) DeleteSKSCluster

func (c *Client) DeleteSKSCluster(ctx context.Context, zone string, cluster *SKSCluster) error

DeleteSKSCluster deletes an SKS cluster.

func (*Client) DeleteSKSNodepool added in v0.69.0

func (c *Client) DeleteSKSNodepool(ctx context.Context, zone string, cluster *SKSCluster, nodepool *SKSNodepool) error

DeleteSKSNodepool deletes an SKS Nodepool.

func (*Client) DeleteSSHKey added in v0.69.0

func (c *Client) DeleteSSHKey(ctx context.Context, zone string, sshKey *SSHKey) error

DeleteSSHKey deletes an SSH key.

func (*Client) DeleteSecurityGroup added in v0.44.0

func (c *Client) DeleteSecurityGroup(ctx context.Context, zone string, securityGroup *SecurityGroup) error

DeleteSecurityGroup deletes a Security Group.

func (*Client) DeleteSecurityGroupRule added in v0.69.0

func (c *Client) DeleteSecurityGroupRule(
	ctx context.Context,
	zone string,
	securityGroup *SecurityGroup,
	rule *SecurityGroupRule,
) error

DeleteSecurityGroupRule deletes a Security Group rule.

func (*Client) DeleteSnapshot added in v0.48.0

func (c *Client) DeleteSnapshot(ctx context.Context, zone string, snapshot *Snapshot) error

DeleteSnapshot deletes a Snapshot.

func (*Client) DeleteTemplate added in v0.48.0

func (c *Client) DeleteTemplate(ctx context.Context, zone string, template *Template) error

DeleteTemplate deletes a Template.

func (*Client) DetachInstanceFromElasticIP added in v0.69.0

func (c *Client) DetachInstanceFromElasticIP(
	ctx context.Context,
	zone string,
	instance *Instance,
	elasticIP *ElasticIP,
) error

DetachInstanceFromElasticIP detaches a Compute instance from the specified Elastic IP.

func (*Client) DetachInstanceFromPrivateNetwork added in v0.69.0

func (c *Client) DetachInstanceFromPrivateNetwork(
	ctx context.Context,
	zone string,
	instance *Instance,
	privateNetwork *PrivateNetwork,
) error

DetachInstanceFromPrivateNetwork detaches a Compute instance from the specified Private Network.

func (*Client) DetachInstanceFromSecurityGroup added in v0.69.0

func (c *Client) DetachInstanceFromSecurityGroup(
	ctx context.Context,
	zone string,
	instance *Instance,
	securityGroup *SecurityGroup,
) error

DetachInstanceFromSecurityGroup detaches a Compute instance from the specified Security Group.

func (*Client) EvictInstancePoolMembers added in v0.69.0

func (c *Client) EvictInstancePoolMembers(
	ctx context.Context,
	zone string,
	instancePool *InstancePool,
	members []string,
) error

EvictInstancePoolMembers evicts the specified members (identified by their Compute instance ID) from the Instance Pool corresponding to the specified ID.

func (*Client) EvictSKSNodepoolMembers added in v0.69.0

func (c *Client) EvictSKSNodepoolMembers(
	ctx context.Context,
	zone string,
	cluster *SKSCluster,
	nodepool *SKSNodepool,
	members []string,
) error

EvictSKSNodepoolMembers evicts the specified members (identified by their Compute instance ID) from the SKS cluster Nodepool.

func (*Client) ExportSnapshot added in v0.69.0

func (c *Client) ExportSnapshot(ctx context.Context, zone string, snapshot *Snapshot) (*SnapshotExport, error)

ExportSnapshot exports a Snapshot and returns the exported Snapshot information.

func (*Client) FindAntiAffinityGroup added in v0.52.0

func (c *Client) FindAntiAffinityGroup(ctx context.Context, zone, x string) (*AntiAffinityGroup, error)

FindAntiAffinityGroup attempts to find an Anti-Affinity Group by name or ID.

func (*Client) FindDeployTarget added in v0.52.0

func (c *Client) FindDeployTarget(ctx context.Context, zone, x string) (*DeployTarget, error)

FindDeployTarget attempts to find a Deploy Target by name or ID.

func (*Client) FindElasticIP added in v0.52.0

func (c *Client) FindElasticIP(ctx context.Context, zone, x string) (*ElasticIP, error)

FindElasticIP attempts to find an Elastic IP by IP address or ID.

func (*Client) FindInstance added in v0.52.0

func (c *Client) FindInstance(ctx context.Context, zone, x string) (*Instance, error)

FindInstance attempts to find a Compute instance by name or ID. In case the identifier is a name and multiple resources match, an ErrTooManyFound error is returned.

func (*Client) FindInstancePool added in v0.52.0

func (c *Client) FindInstancePool(ctx context.Context, zone, x string) (*InstancePool, error)

FindInstancePool attempts to find an Instance Pool by name or ID.

func (*Client) FindInstanceType added in v0.53.0

func (c *Client) FindInstanceType(ctx context.Context, zone, x string) (*InstanceType, error)

FindInstanceType attempts to find an Instance type by family+size or ID. To search by family+size, the expected format for v is "[FAMILY.]SIZE" (e.g. "large", "gpu.medium"), with family defaulting to "standard" if not specified.

func (*Client) FindNetworkLoadBalancer added in v0.52.0

func (c *Client) FindNetworkLoadBalancer(ctx context.Context, zone, x string) (*NetworkLoadBalancer, error)

FindNetworkLoadBalancer attempts to find a Network Load Balancer by name or ID.

func (*Client) FindPrivateNetwork added in v0.52.0

func (c *Client) FindPrivateNetwork(ctx context.Context, zone, x string) (*PrivateNetwork, error)

FindPrivateNetwork attempts to find a Private Network by name or ID. In case the identifier is a name and multiple resources match, an ErrTooManyFound error is returned.

func (*Client) FindSKSCluster added in v0.52.0

func (c *Client) FindSKSCluster(ctx context.Context, zone, x string) (*SKSCluster, error)

FindSKSCluster attempts to find an SKS cluster by name or ID.

func (*Client) FindSecurityGroup added in v0.52.0

func (c *Client) FindSecurityGroup(ctx context.Context, zone, x string) (*SecurityGroup, error)

FindSecurityGroup attempts to find a Security Group by name or ID.

func (*Client) GetAntiAffinityGroup added in v0.44.0

func (c *Client) GetAntiAffinityGroup(ctx context.Context, zone, id string) (*AntiAffinityGroup, error)

GetAntiAffinityGroup returns the Anti-Affinity Group corresponding to the specified ID.

func (*Client) GetDatabaseCACertificate added in v0.69.0

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

GetDatabaseCACertificate returns the CA certificate required to access Database Services using a TLS connection.

func (*Client) GetDatabaseService added in v0.57.0

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

GetDatabaseService returns the Database Service corresponding to the specified name.

func (*Client) GetDatabaseServiceType added in v0.57.0

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

GetDatabaseServiceType returns the Database Service type corresponding to the specified name.

func (*Client) GetDeployTarget added in v0.48.0

func (c *Client) GetDeployTarget(ctx context.Context, zone, id string) (*DeployTarget, error)

GetDeployTarget returns the Deploy Target corresponding to the specified ID.

func (*Client) GetElasticIP added in v0.45.0

func (c *Client) GetElasticIP(ctx context.Context, zone, id string) (*ElasticIP, error)

GetElasticIP returns the Elastic IP corresponding to the specified ID.

func (*Client) GetInstance added in v0.48.0

func (c *Client) GetInstance(ctx context.Context, zone, id string) (*Instance, error)

GetInstance returns the Instance corresponding to the specified ID.

func (*Client) GetInstancePool added in v0.44.0

func (c *Client) GetInstancePool(ctx context.Context, zone, id string) (*InstancePool, error)

GetInstancePool returns the Instance Pool corresponding to the specified ID.

func (*Client) GetInstanceType added in v0.51.0

func (c *Client) GetInstanceType(ctx context.Context, zone, id string) (*InstanceType, error)

GetInstanceType returns the Instance type corresponding to the specified ID.

func (*Client) GetNetworkLoadBalancer

func (c *Client) GetNetworkLoadBalancer(ctx context.Context, zone, id string) (*NetworkLoadBalancer, error)

GetNetworkLoadBalancer returns the Network Load Balancer corresponding to the specified ID.

func (*Client) GetPrivateNetwork added in v0.44.0

func (c *Client) GetPrivateNetwork(ctx context.Context, zone, id string) (*PrivateNetwork, error)

GetPrivateNetwork returns the Private Network corresponding to the specified ID.

func (*Client) GetQuota added in v0.69.0

func (c *Client) GetQuota(ctx context.Context, zone, resource string) (*Quota, error)

GetQuota returns the current Exoscale organization quota for the specified resource.

func (*Client) GetSKSCluster

func (c *Client) GetSKSCluster(ctx context.Context, zone, id string) (*SKSCluster, error)

GetSKSCluster returns the SKS cluster corresponding to the specified ID.

func (*Client) GetSKSClusterAuthorityCert added in v0.69.0

func (c *Client) GetSKSClusterAuthorityCert(
	ctx context.Context,
	zone string,
	cluster *SKSCluster,
	authority string,
) (string, error)

GetSKSClusterAuthorityCert returns the SKS cluster base64-encoded certificate content for the specified authority.

func (*Client) GetSKSClusterKubeconfig added in v0.69.0

func (c *Client) GetSKSClusterKubeconfig(
	ctx context.Context,
	zone string,
	cluster *SKSCluster,
	user string,
	groups []string,
	d time.Duration,
) (string, error)

GetSKSClusterKubeconfig returns a base64-encoded kubeconfig content for the specified user name, optionally associated to specified groups for a duration d (default API-set TTL applies if not specified). Fore more information: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/

func (*Client) GetSSHKey added in v0.69.0

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

GetSSHKey returns the SSH key corresponding to the specified name.

func (*Client) GetSecurityGroup added in v0.44.0

func (c *Client) GetSecurityGroup(ctx context.Context, zone, id string) (*SecurityGroup, error)

GetSecurityGroup returns the Security Group corresponding to the specified ID.

func (*Client) GetSnapshot added in v0.48.0

func (c *Client) GetSnapshot(ctx context.Context, zone, id string) (*Snapshot, error)

GetSnapshot returns the Snapshot corresponding to the specified ID.

func (*Client) GetTemplate added in v0.48.0

func (c *Client) GetTemplate(ctx context.Context, zone, id string) (*Template, error)

GetTemplate returns the Template corresponding to the specified ID.

func (*Client) ListAntiAffinityGroups added in v0.44.0

func (c *Client) ListAntiAffinityGroups(ctx context.Context, zone string) ([]*AntiAffinityGroup, error)

ListAntiAffinityGroups returns the list of existing Anti-Affinity Groups.

func (*Client) ListDatabaseServiceTypes added in v0.57.0

func (c *Client) ListDatabaseServiceTypes(ctx context.Context, zone string) ([]*DatabaseServiceType, error)

ListDatabaseServiceTypes returns the list of existing Database Service types.

func (*Client) ListDatabaseServices added in v0.57.0

func (c *Client) ListDatabaseServices(ctx context.Context, zone string) ([]*DatabaseService, error)

ListDatabaseServices returns the list of Database Services.

func (*Client) ListDeployTargets added in v0.48.0

func (c *Client) ListDeployTargets(ctx context.Context, zone string) ([]*DeployTarget, error)

ListDeployTargets returns the list of existing Deploy Targets.

func (*Client) ListElasticIPs added in v0.45.0

func (c *Client) ListElasticIPs(ctx context.Context, zone string) ([]*ElasticIP, error)

ListElasticIPs returns the list of existing Elastic IPs.

func (*Client) ListInstancePools added in v0.44.0

func (c *Client) ListInstancePools(ctx context.Context, zone string) ([]*InstancePool, error)

ListInstancePools returns the list of existing Instance Pools.

func (*Client) ListInstanceTypes added in v0.51.0

func (c *Client) ListInstanceTypes(ctx context.Context, zone string) ([]*InstanceType, error)

ListInstanceTypes returns the list of existing Instance types.

func (*Client) ListInstances added in v0.48.0

func (c *Client) ListInstances(ctx context.Context, zone string) ([]*Instance, error)

ListInstances returns the list of existing Compute instances.

func (*Client) ListNetworkLoadBalancers

func (c *Client) ListNetworkLoadBalancers(ctx context.Context, zone string) ([]*NetworkLoadBalancer, error)

ListNetworkLoadBalancers returns the list of existing Network Load Balancers in the specified zone.

func (*Client) ListPrivateNetworks added in v0.44.0

func (c *Client) ListPrivateNetworks(ctx context.Context, zone string) ([]*PrivateNetwork, error)

ListPrivateNetworks returns the list of existing Private Networks.

func (*Client) ListQuotas added in v0.69.0

func (c *Client) ListQuotas(ctx context.Context, zone string) ([]*Quota, error)

ListQuotas returns the list of Exoscale organization quotas.

func (*Client) ListSKSClusterVersions

func (c *Client) ListSKSClusterVersions(ctx context.Context) ([]string, error)

ListSKSClusterVersions returns the list of Kubernetes versions supported during SKS cluster creation.

func (*Client) ListSKSClusters

func (c *Client) ListSKSClusters(ctx context.Context, zone string) ([]*SKSCluster, error)

ListSKSClusters returns the list of existing SKS clusters.

func (*Client) ListSSHKeys added in v0.69.0

func (c *Client) ListSSHKeys(ctx context.Context, zone string) ([]*SSHKey, error)

ListSSHKeys returns the list of existing SSH keys.

func (*Client) ListSecurityGroups added in v0.44.0

func (c *Client) ListSecurityGroups(ctx context.Context, zone string) ([]*SecurityGroup, error)

ListSecurityGroups returns the list of existing Security Groups.

func (*Client) ListSnapshots added in v0.48.0

func (c *Client) ListSnapshots(ctx context.Context, zone string) ([]*Snapshot, error)

ListSnapshots returns the list of existing Snapshots.

func (*Client) ListTemplates added in v0.48.0

func (c *Client) ListTemplates(ctx context.Context, zone string, opts ...ListTemplatesOpt) ([]*Template, error)

ListTemplates returns the list of existing Templates.

func (*Client) ListZones

func (c *Client) ListZones(ctx context.Context) ([]string, error)

ListZones returns the list of Exoscale zones.

func (*Client) RebootInstance added in v0.69.0

func (c *Client) RebootInstance(ctx context.Context, zone string, instance *Instance) error

RebootInstance reboots a Compute instance.

func (*Client) RegisterSSHKey added in v0.69.0

func (c *Client) RegisterSSHKey(ctx context.Context, zone, name, publicKey string) (*SSHKey, error)

RegisterSSHKey registers a new SSH key.

func (*Client) RegisterTemplate added in v0.63.0

func (c *Client) RegisterTemplate(ctx context.Context, zone string, template *Template) (*Template, error)

RegisterTemplate registers a new Template.

func (*Client) RemoveExternalSourceFromSecurityGroup added in v0.73.0

func (c *Client) RemoveExternalSourceFromSecurityGroup(
	ctx context.Context,
	zone string,
	securityGroup *SecurityGroup,
	cidr string,
) error

RemoveExternalSourceFromSecurityGroup removes an external source from a Security Group. This operation is idempotent.

func (*Client) ResetInstance added in v0.69.0

func (c *Client) ResetInstance(ctx context.Context, zone string, instance *Instance, opts ...ResetInstanceOpt) error

ResetInstance resets a Compute instance to a base template state (the instance's current template if not specified).

func (*Client) ResizeInstanceDisk added in v0.69.0

func (c *Client) ResizeInstanceDisk(ctx context.Context, zone string, instance *Instance, size int64) error

ResizeInstanceDisk resizes a Compute instance's disk to a larger size.

func (*Client) RevertInstanceToSnapshot added in v0.69.0

func (c *Client) RevertInstanceToSnapshot(
	ctx context.Context,
	zone string,
	instance *Instance,
	snapshot *Snapshot,
) error

RevertInstanceToSnapshot reverts a Compute instance storage volume to the specified Snapshot.

func (*Client) RotateSKSClusterCCMCredentials added in v0.69.0

func (c *Client) RotateSKSClusterCCMCredentials(ctx context.Context, zone string, cluster *SKSCluster) error

RotateSKSClusterCCMCredentials rotates the Exoscale IAM credentials managed by the SKS control plane for the Kubernetes Exoscale Cloud Controller Manager.

func (*Client) ScaleInstance added in v0.69.0

func (c *Client) ScaleInstance(ctx context.Context, zone string, instance *Instance, instanceType *InstanceType) error

ScaleInstance scales a Compute instance type.

func (*Client) ScaleInstancePool added in v0.69.0

func (c *Client) ScaleInstancePool(ctx context.Context, zone string, instancePool *InstancePool, size int64) error

ScaleInstancePool scales an Instance Pool.

func (*Client) ScaleSKSNodepool added in v0.69.0

func (c *Client) ScaleSKSNodepool(
	ctx context.Context,
	zone string,
	cluster *SKSCluster,
	nodepool *SKSNodepool,
	size int64,
) error

ScaleSKSNodepool scales the SKS cluster Nodepool to the specified number of Kubernetes Nodes.

func (*Client) SetHTTPClient added in v0.47.0

func (c *Client) SetHTTPClient(client *http.Client)

SetHTTPClient overrides the current HTTP client.

func (*Client) SetTimeout added in v0.47.0

func (c *Client) SetTimeout(v time.Duration)

SetTimeout overrides the current client timeout value.

func (*Client) SetTrace added in v0.47.0

func (c *Client) SetTrace(enabled bool)

SetTrace enables or disables HTTP request/reponse tracing.

func (*Client) StartInstance added in v0.69.0

func (c *Client) StartInstance(ctx context.Context, zone string, instance *Instance, opts ...StartInstanceOpt) error

StartInstance starts a Compute instance.

func (*Client) StopInstance added in v0.69.0

func (c *Client) StopInstance(ctx context.Context, zone string, instance *Instance) error

StopInstance stops a Compute instance.

func (*Client) UpdateDatabaseService added in v0.57.0

func (c *Client) UpdateDatabaseService(ctx context.Context, zone string, databaseService *DatabaseService) error

UpdateDatabaseService updates a Database Service.

func (*Client) UpdateElasticIP added in v0.45.0

func (c *Client) UpdateElasticIP(ctx context.Context, zone string, elasticIP *ElasticIP) error

UpdateElasticIP updates an Elastic IP.

func (*Client) UpdateInstance added in v0.48.0

func (c *Client) UpdateInstance(ctx context.Context, zone string, instance *Instance) error

UpdateInstance updates a Compute instance.

func (*Client) UpdateInstancePool added in v0.44.0

func (c *Client) UpdateInstancePool(ctx context.Context, zone string, instancePool *InstancePool) error

UpdateInstancePool updates an Instance Pool.

func (*Client) UpdateNetworkLoadBalancer

func (c *Client) UpdateNetworkLoadBalancer(ctx context.Context, zone string, nlb *NetworkLoadBalancer) error

UpdateNetworkLoadBalancer updates a Network Load Balancer.

func (*Client) UpdateNetworkLoadBalancerService added in v0.69.0

func (c *Client) UpdateNetworkLoadBalancerService(
	ctx context.Context,
	zone string,
	nlb *NetworkLoadBalancer,
	service *NetworkLoadBalancerService,
) error

UpdateNetworkLoadBalancerService updates a Network Load Balancer service.

func (*Client) UpdatePrivateNetwork added in v0.44.0

func (c *Client) UpdatePrivateNetwork(ctx context.Context, zone string, privateNetwork *PrivateNetwork) error

UpdatePrivateNetwork updates a Private Network.

func (*Client) UpdatePrivateNetworkInstanceIPAddress added in v0.69.0

func (c *Client) UpdatePrivateNetworkInstanceIPAddress(
	ctx context.Context,
	zone string,
	instance *Instance,
	privateNetwork *PrivateNetwork,
	ip net.IP,
) error

UpdatePrivateNetworkInstanceIPAddress updates the IP address of a Compute instance attached to a managed Private Network.

func (*Client) UpdateSKSCluster

func (c *Client) UpdateSKSCluster(ctx context.Context, zone string, cluster *SKSCluster) error

UpdateSKSCluster updates an SKS cluster.

func (*Client) UpdateSKSNodepool added in v0.69.0

func (c *Client) UpdateSKSNodepool(
	ctx context.Context,
	zone string,
	cluster *SKSCluster,
	nodepool *SKSNodepool,
) error

UpdateSKSNodepool updates an SKS Nodepool.

func (*Client) UpgradeSKSCluster

func (c *Client) UpgradeSKSCluster(ctx context.Context, zone string, cluster *SKSCluster, version string) error

UpgradeSKSCluster upgrades an SKS cluster to the requested Kubernetes version.

func (*Client) UpgradeSKSClusterServiceLevel added in v0.71.0

func (c *Client) UpgradeSKSClusterServiceLevel(ctx context.Context, zone string, cluster *SKSCluster) error

UpgradeSKSClusterServiceLevel upgrades an SKS cluster to service level "pro".

type ClientOpt

type ClientOpt func(*Client) error

ClientOpt represents a function setting Exoscale API client option.

func ClientOptCond added in v0.44.0

func ClientOptCond(fc func() bool, opt ClientOpt) ClientOpt

ClientOptCond returns the specified ClientOpt if the fc function bool result evaluates to true, otherwise returns a no-op ClientOpt.

func ClientOptWithAPIEndpoint

func ClientOptWithAPIEndpoint(v string) ClientOpt

ClientOptWithAPIEndpoint returns a ClientOpt overriding the default Exoscale API endpoint.

func ClientOptWithHTTPClient

func ClientOptWithHTTPClient(v *http.Client) ClientOpt

ClientOptWithHTTPClient returns a ClientOpt overriding the default http.Client. Note: the Exoscale API client will chain additional middleware (http.RoundTripper) on the HTTP client internally, which can alter the HTTP requests and responses. If you don't want any other middleware than the ones currently set to your HTTP client, you should duplicate it and pass a copy instead.

func ClientOptWithPollInterval added in v0.52.0

func ClientOptWithPollInterval(v time.Duration) ClientOpt

ClientOptWithPollInterval returns a ClientOpt overriding the default client async operation polling interval.

func ClientOptWithTimeout

func ClientOptWithTimeout(v time.Duration) ClientOpt

ClientOptWithTimeout returns a ClientOpt overriding the default client timeout.

func ClientOptWithTrace added in v0.44.0

func ClientOptWithTrace() ClientOpt

ClientOptWithTrace returns a ClientOpt enabling HTTP request/reponse tracing.

type DatabaseBackupConfig added in v0.57.0

type DatabaseBackupConfig struct {
	FrequentIntervalMinutes    *int64
	FrequentOldestAgeMinutes   *int64
	InfrequentIntervalMinutes  *int64
	InfrequentOldestAgeMinutes *int64
	Interval                   *int64
	MaxCount                   *int64
	RecoveryMode               *string
}

DatabaseBackupConfig represents a Database Backup configuration.

type DatabasePlan added in v0.57.0

type DatabasePlan struct {
	BackupConfig     *DatabaseBackupConfig
	DiskSpace        *int64
	MaxMemoryPercent *int64
	Name             *string
	Nodes            *int64
	NodeCPUs         *int64
	NodeMemory       *int64
}

DatabasePlan represents a Database Plan.

type DatabaseService added in v0.57.0

type DatabaseService struct {
	Backups               []*DatabaseServiceBackup
	Components            []*DatabaseServiceComponent
	ConnectionInfo        map[string]interface{}
	CreatedAt             *time.Time
	DiskSize              *int64
	Features              map[string]interface{}
	Maintenance           *DatabaseServiceMaintenance
	Metadata              map[string]interface{}
	Name                  *string
	Nodes                 *int64
	NodeCPUs              *int64
	NodeMemory            *int64
	Plan                  *string
	State                 *string
	TerminationProtection *bool
	Type                  *string
	UpdatedAt             *time.Time
	URI                   *url.URL
	UserConfig            *map[string]interface{}
	Users                 []*DatabaseServiceUser
}

DatabaseService represents a Database Service.

type DatabaseServiceBackup added in v0.57.0

type DatabaseServiceBackup struct {
	Name *string
	Size *int64
	Date *time.Time
}

DatabaseServiceBackup represents a Database Service backup.

type DatabaseServiceComponent added in v0.70.0

type DatabaseServiceComponent struct {
	Name *string
	Info map[string]interface{}
}

DatabaseServiceComponent represents a Database Service component.

type DatabaseServiceMaintenance added in v0.57.0

type DatabaseServiceMaintenance struct {
	DOW  string
	Time string
}

DatabaseServiceMaintenance represents a Database Service maintenance.

type DatabaseServiceType added in v0.57.0

type DatabaseServiceType struct {
	DefaultVersion   *string
	Description      *string
	LatestVersion    *string
	Name             *string
	Plans            []*DatabasePlan
	UserConfigSchema map[string]interface{}
}

DatabaseServiceType represents a Database Service type.

type DatabaseServiceUser added in v0.57.0

type DatabaseServiceUser struct {
	Password *string
	Type     *string
	UserName *string
}

DatabaseServiceUser represents a Database Service user.

type DeployTarget added in v0.48.0

type DeployTarget struct {
	Description *string
	ID          *string
	Name        *string
	Type        *string
	Zone        *string
}

DeployTarget represents a Deploy Target.

type ElasticIP added in v0.45.0

type ElasticIP struct {
	Description *string
	Healthcheck *ElasticIPHealthcheck
	ID          *string `req-for:"update,delete"`
	IPAddress   *net.IP
	Zone        *string
}

ElasticIP represents an Elastic IP.

type ElasticIPHealthcheck added in v0.45.0

type ElasticIPHealthcheck struct {
	Interval      *time.Duration
	Mode          *string `req-for:"create,update"`
	Port          *uint16 `req-for:"create,update"`
	StrikesFail   *int64
	StrikesOK     *int64
	TLSSNI        *string
	TLSSkipVerify *bool
	Timeout       *time.Duration
	URI           *string
}

ElasticIPHealthcheck represents an Elastic IP healthcheck.

type Instance added in v0.48.0

type Instance struct {
	AntiAffinityGroupIDs *[]string
	CreatedAt            *time.Time
	DeployTargetID       *string
	DiskSize             *int64 `req-for:"create"`
	ElasticIPIDs         *[]string
	ID                   *string `req-for:"update,delete"`
	IPv6Address          *net.IP
	IPv6Enabled          *bool
	InstanceTypeID       *string `req-for:"create"`
	Labels               *map[string]string
	Manager              *InstanceManager
	Name                 *string `req-for:"create"`
	PrivateNetworkIDs    *[]string
	PublicIPAddress      *net.IP
	SSHKey               *string
	SecurityGroupIDs     *[]string
	SnapshotIDs          *[]string
	State                *string
	TemplateID           *string `req-for:"create"`
	UserData             *string
	Zone                 *string
}

Instance represents a Compute instance.

type InstanceManager added in v0.50.0

type InstanceManager struct {
	ID   string
	Type string
}

InstanceManager represents a Compute instance manager.

type InstancePool added in v0.44.0

type InstancePool struct {
	AntiAffinityGroupIDs *[]string
	DeployTargetID       *string
	Description          *string
	DiskSize             *int64 `req-for:"create"`
	ElasticIPIDs         *[]string
	ID                   *string `req-for:"update,delete"`
	IPv6Enabled          *bool
	InstanceIDs          *[]string
	InstancePrefix       *string
	InstanceTypeID       *string `req-for:"create"`
	Labels               *map[string]string
	Manager              *InstancePoolManager
	Name                 *string `req-for:"create"`
	PrivateNetworkIDs    *[]string
	SSHKey               *string
	SecurityGroupIDs     *[]string
	Size                 *int64 `req-for:"create"`
	State                *string
	TemplateID           *string `req-for:"create"`
	UserData             *string
	Zone                 *string
}

InstancePool represents an Instance Pool.

type InstancePoolManager added in v0.64.0

type InstancePoolManager struct {
	ID   string
	Type string
}

InstancePoolManager represents an Instance Pool manager.

type InstanceType added in v0.51.0

type InstanceType struct {
	Authorized *bool
	CPUs       *int64
	Family     *string
	GPUs       *int64
	ID         *string
	Memory     *int64
	Size       *string
}

InstanceType represents a Compute instance type.

type ListTemplatesOpt added in v0.77.0

type ListTemplatesOpt func(params *oapi.ListTemplatesParams)

ListTemplatesOpt represents an ListTemplates operation option.

func ListTemplatesWithFamily added in v0.77.0

func ListTemplatesWithFamily(v string) ListTemplatesOpt

ListTemplatesWithFamily sets a family filter to list Templates with.

func ListTemplatesWithVisibility added in v0.77.0

func ListTemplatesWithVisibility(v string) ListTemplatesOpt

ListTemplatesWithVisibility sets a visibility filter to list Templates with (default: "public").

type NetworkLoadBalancer

type NetworkLoadBalancer struct {
	CreatedAt   *time.Time
	Description *string
	ID          *string `req-for:"update,delete"`
	IPAddress   *net.IP
	Labels      *map[string]string
	Name        *string `req-for:"create"`
	Services    []*NetworkLoadBalancerService
	State       *string
	Zone        *string
}

NetworkLoadBalancer represents a Network Load Balancer.

type NetworkLoadBalancerServerStatus

type NetworkLoadBalancerServerStatus struct {
	InstanceIP *net.IP
	Status     *string
}

NetworkLoadBalancerServerStatus represents a Network Load Balancer service target server status.

type NetworkLoadBalancerService

type NetworkLoadBalancerService struct {
	Description       *string
	Healthcheck       *NetworkLoadBalancerServiceHealthcheck `req-for:"create"`
	HealthcheckStatus []*NetworkLoadBalancerServerStatus
	ID                *string `req-for:"update,delete"`
	InstancePoolID    *string `req-for:"create"`
	Name              *string `req-for:"create"`
	Port              *uint16 `req-for:"create"`
	Protocol          *string `req-for:"create"`
	State             *string
	Strategy          *string `req-for:"create"`
	TargetPort        *uint16 `req-for:"create"`
}

NetworkLoadBalancerService represents a Network Load Balancer service.

type NetworkLoadBalancerServiceHealthcheck

type NetworkLoadBalancerServiceHealthcheck struct {
	Interval *time.Duration `req-for:"create,update"`
	Mode     *string        `req-for:"create,update"`
	Port     *uint16        `req-for:"create,update"`
	Retries  *int64
	TLSSNI   *string
	Timeout  *time.Duration
	URI      *string
}

NetworkLoadBalancerServiceHealthcheck represents a Network Load Balancer service healthcheck.

type PrivateNetwork added in v0.44.0

type PrivateNetwork struct {
	Description *string
	EndIP       *net.IP
	ID          *string `req-for:"update,delete"`
	Name        *string `req-for:"create"`
	Netmask     *net.IP
	StartIP     *net.IP
	Leases      []*PrivateNetworkLease
	Zone        *string
}

PrivateNetwork represents a Private Network.

type PrivateNetworkLease added in v0.62.0

type PrivateNetworkLease struct {
	InstanceID *string
	IPAddress  *net.IP
}

PrivateNetworkLease represents a managed Private Network lease.

type Quota added in v0.69.0

type Quota struct {
	Resource *string
	Usage    *int64
	Limit    *int64
}

Quota represents an Exoscale organization quota.

type ResetInstanceOpt added in v0.77.0

type ResetInstanceOpt func(*oapi.ResetInstanceJSONRequestBody)

ResetInstanceOpt represents a ResetInstance operation option.

func ResetInstanceWithDiskSize added in v0.77.0

func ResetInstanceWithDiskSize(v int64) ResetInstanceOpt

ResetInstanceWithDiskSize sets a new disk size to set the Compute instance.

func ResetInstanceWithTemplate added in v0.77.0

func ResetInstanceWithTemplate(v *Template) ResetInstanceOpt

ResetInstanceWithTemplate sets a template to reset the Compute instance to.

type SKSCluster

type SKSCluster struct {
	AddOns       *[]string
	AutoUpgrade  *bool
	CNI          *string
	CreatedAt    *time.Time
	Description  *string
	Endpoint     *string
	ID           *string `req-for:"update,delete"`
	Labels       *map[string]string
	Name         *string `req-for:"create"`
	Nodepools    []*SKSNodepool
	ServiceLevel *string `req-for:"create"`
	State        *string
	Version      *string `req-for:"create"`
	Zone         *string
}

SKSCluster represents an SKS cluster.

type SKSNodepool

type SKSNodepool struct {
	AddOns               *[]string
	AntiAffinityGroupIDs *[]string
	CreatedAt            *time.Time
	DeployTargetID       *string
	Description          *string
	DiskSize             *int64  `req-for:"create"`
	ID                   *string `req-for:"update,delete"`
	InstancePoolID       *string
	InstancePrefix       *string
	InstanceTypeID       *string `req-for:"create"`
	Labels               *map[string]string
	Name                 *string `req-for:"create"`
	PrivateNetworkIDs    *[]string
	SecurityGroupIDs     *[]string
	Size                 *int64 `req-for:"create"`
	State                *string
	Taints               *map[string]*SKSNodepoolTaint
	TemplateID           *string
	Version              *string
}

SKSNodepool represents an SKS Nodepool.

type SKSNodepoolTaint added in v0.76.0

type SKSNodepoolTaint struct {
	Effect string
	Value  string
}

SKSNodepoolTaint represents an SKS Nodepool Kubernetes Node taint.

type SSHKey added in v0.69.0

type SSHKey struct {
	Fingerprint *string
	Name        *string `req-for:"delete"`
}

SSHKey represents an SSH key.

type SecurityGroup added in v0.44.0

type SecurityGroup struct {
	Description     *string
	ID              *string `req-for:"update,delete"`
	Name            *string `req-for:"create"`
	ExternalSources *[]string
	Rules           []*SecurityGroupRule
}

SecurityGroup represents a Security Group.

type SecurityGroupRule added in v0.44.0

type SecurityGroupRule struct {
	Description     *string
	EndPort         *uint16
	FlowDirection   *string `req-for:"create"`
	ICMPCode        *int64
	ICMPType        *int64
	ID              *string `req-for:"delete"`
	Network         *net.IPNet
	Protocol        *string `req-for:"create"`
	SecurityGroupID *string
	StartPort       *uint16
}

SecurityGroupRule represents a Security Group rule.

type Snapshot added in v0.48.0

type Snapshot struct {
	CreatedAt  *time.Time
	ID         *string `req-for:"update,delete"`
	InstanceID *string
	Name       *string
	Size       *int64
	State      *string
	Zone       *string
}

Snapshot represents a Snapshot.

type SnapshotExport added in v0.48.0

type SnapshotExport struct {
	MD5sum       *string
	PresignedURL *string
}

SnapshotExport represents exported Snapshot information.

type StartInstanceOpt added in v0.75.0

type StartInstanceOpt func(*oapi.StartInstanceJSONRequestBody)

StartInstanceOpt represents a StartInstance operation option.

func StartInstanceWithRescueProfile added in v0.75.0

func StartInstanceWithRescueProfile(v string) StartInstanceOpt

StartInstanceWithRescueProfile sets the rescue profile to start a Compute instance with.

type Template added in v0.48.0

type Template struct {
	BootMode        *string
	Build           *string
	Checksum        *string `req-for:"create"`
	CreatedAt       *time.Time
	DefaultUser     *string
	Description     *string
	Family          *string
	ID              *string `req-for:"delete"`
	Name            *string `req-for:"create"`
	PasswordEnabled *bool   `req-for:"create"`
	SSHKeyEnabled   *bool   `req-for:"create"`
	Size            *int64
	URL             *string `req-for:"create"`
	Version         *string
	Visibility      *string
	Zone            *string
}

Template represents a Compute instance template.

Directories

Path Synopsis
Package api implements low-level primitives for interacting with the Exoscale API.
Package api implements low-level primitives for interacting with the Exoscale API.
Package oapi provides primitives to interact with the openapi HTTP API.
Package oapi provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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