Documentation ¶
Overview ¶
Package incus implements a client for the Incus API
Overview ¶
This package lets you connect to Incus daemons or SimpleStream image servers over a Unix socket or HTTPs. You can then interact with those remote servers, creating instances, images, moving them around, ...
Example - instance creation ¶
This creates a container on a local Incus daemon and then starts it.
// Connect to Incus over the Unix socket c, err := incus.ConnectIncusUnix("", nil) if err != nil { return err } // Instance creation request req := api.InstancesPost{ Name: "my-container", Source: api.InstanceSource{ Type: "image", Alias: "my-image", }, Type: "container" } // Get Incus to create the instance (background operation) op, err := c.CreateInstance(req) if err != nil { return err } // Wait for the operation to complete err = op.Wait() if err != nil { return err } // Get Incus to start the instance (background operation) reqState := api.InstanceStatePut{ Action: "start", Timeout: -1, } op, err = c.UpdateInstanceState(name, reqState, "") if err != nil { return err } // Wait for the operation to complete err = op.Wait() if err != nil { return err }
Example - command execution ¶
This executes an interactive bash terminal
// Connect to Incus over the Unix socket c, err := incus.ConnectIncusUnix("", nil) if err != nil { return err } // Setup the exec request req := api.InstanceExecPost{ Command: []string{"bash"}, WaitForWS: true, Interactive: true, Width: 80, Height: 15, } // Setup the exec arguments (fds) args := incus.InstanceExecArgs{ Stdin: os.Stdin, Stdout: os.Stdout, Stderr: os.Stderr, } // Setup the terminal (set to raw mode) if req.Interactive { cfd := int(syscall.Stdin) oldttystate, err := termios.MakeRaw(cfd) if err != nil { return err } defer termios.Restore(cfd, oldttystate) } // Get the current state op, err := c.ExecInstance("c1", req, &args) if err != nil { return err } // Wait for it to complete err = op.Wait() if err != nil { return err }
Example - image copy ¶
This copies an image from a simplestreams server to a local Incus daemon
// Connect to Incus over the Unix socket c, err := incus.ConnectIncusUnix("", nil) if err != nil { return err } // Connect to the remote SimpleStreams server d, err = incus.ConnectSimpleStreams("https://images.linuxcontainers.org", nil) if err != nil { return err } // Resolve the alias alias, _, err := d.GetImageAlias("centos/7") if err != nil { return err } // Get the image information image, _, err := d.GetImage(alias.Target) if err != nil { return err } // Ask Incus to copy the image from the remote server op, err := d.CopyImage(*image, c, nil) if err != nil { return err } // And wait for it to finish err = op.Wait() if err != nil { return err }
Index ¶
- type BackupFileRequest
- type BackupFileResponse
- type ConnectionArgs
- type ConnectionInfo
- type EventListener
- type EventTarget
- type HTTPTransporter
- type ImageCopyArgs
- type ImageCreateArgs
- type ImageFileRequest
- type ImageFileResponse
- type ImageServer
- type InstanceBackupArgs
- type InstanceConsoleArgs
- type InstanceConsoleLogArgs
- type InstanceCopyArgs
- type InstanceExecArgs
- type InstanceFileArgs
- type InstanceFileResponse
- type InstanceServer
- func ConnectIncus(url string, args *ConnectionArgs) (InstanceServer, error)
- func ConnectIncusHTTP(args *ConnectionArgs, client *http.Client) (InstanceServer, error)
- func ConnectIncusHTTPWithContext(ctx context.Context, args *ConnectionArgs, client *http.Client) (InstanceServer, error)
- func ConnectIncusUnix(path string, args *ConnectionArgs) (InstanceServer, error)
- func ConnectIncusUnixWithContext(ctx context.Context, path string, args *ConnectionArgs) (InstanceServer, error)
- func ConnectIncusWithContext(ctx context.Context, url string, args *ConnectionArgs) (InstanceServer, error)
- type InstanceSnapshotCopyArgs
- type Operation
- type ProtocolIncus
- func (r *ProtocolIncus) ApplyServerPreseed(config api.InitPreseed) error
- func (r *ProtocolIncus) CheckExtension(extensionName string) error
- func (r *ProtocolIncus) ConsoleInstance(instanceName string, console api.InstanceConsolePost, ...) (Operation, error)
- func (r *ProtocolIncus) ConsoleInstanceDynamic(instanceName string, console api.InstanceConsolePost, ...) (Operation, func(io.ReadWriteCloser) error, error)
- func (r *ProtocolIncus) CopyImage(source ImageServer, image api.Image, args *ImageCopyArgs) (RemoteOperation, error)
- func (r *ProtocolIncus) CopyInstance(source InstanceServer, instance api.Instance, args *InstanceCopyArgs) (RemoteOperation, error)
- func (r *ProtocolIncus) CopyInstanceSnapshot(source InstanceServer, instanceName string, snapshot api.InstanceSnapshot, ...) (RemoteOperation, error)
- func (r *ProtocolIncus) CopyStoragePoolVolume(pool string, source InstanceServer, sourcePool string, ...) (RemoteOperation, error)
- func (r *ProtocolIncus) CreateCertificate(certificate api.CertificatesPost) error
- func (r *ProtocolIncus) CreateCertificateToken(certificate api.CertificatesPost) (Operation, error)
- func (r *ProtocolIncus) CreateClusterGroup(group api.ClusterGroupsPost) error
- func (r *ProtocolIncus) CreateClusterMember(member api.ClusterMembersPost) (Operation, error)
- func (r *ProtocolIncus) CreateImage(image api.ImagesPost, args *ImageCreateArgs) (Operation, error)
- func (r *ProtocolIncus) CreateImageAlias(alias api.ImageAliasesPost) error
- func (r *ProtocolIncus) CreateImageSecret(fingerprint string) (Operation, error)
- func (r *ProtocolIncus) CreateInstance(instance api.InstancesPost) (Operation, error)
- func (r *ProtocolIncus) CreateInstanceBackup(instanceName string, backup api.InstanceBackupsPost) (Operation, error)
- func (r *ProtocolIncus) CreateInstanceFile(instanceName string, filePath string, args InstanceFileArgs) error
- func (r *ProtocolIncus) CreateInstanceFromBackup(args InstanceBackupArgs) (Operation, error)
- func (r *ProtocolIncus) CreateInstanceFromImage(source ImageServer, image api.Image, req api.InstancesPost) (RemoteOperation, error)
- func (r *ProtocolIncus) CreateInstanceSnapshot(instanceName string, snapshot api.InstanceSnapshotsPost) (Operation, error)
- func (r *ProtocolIncus) CreateInstanceTemplateFile(instanceName string, templateName string, content io.ReadSeeker) error
- func (r *ProtocolIncus) CreateNetwork(network api.NetworksPost) error
- func (r *ProtocolIncus) CreateNetworkACL(acl api.NetworkACLsPost) error
- func (r *ProtocolIncus) CreateNetworkForward(networkName string, forward api.NetworkForwardsPost) error
- func (r *ProtocolIncus) CreateNetworkIntegration(integration api.NetworkIntegrationsPost) error
- func (r *ProtocolIncus) CreateNetworkLoadBalancer(networkName string, loadBalancer api.NetworkLoadBalancersPost) error
- func (r *ProtocolIncus) CreateNetworkPeer(networkName string, peer api.NetworkPeersPost) error
- func (r *ProtocolIncus) CreateNetworkZone(zone api.NetworkZonesPost) error
- func (r *ProtocolIncus) CreateNetworkZoneRecord(zone string, record api.NetworkZoneRecordsPost) error
- func (r *ProtocolIncus) CreateProfile(profile api.ProfilesPost) error
- func (r *ProtocolIncus) CreateProject(project api.ProjectsPost) error
- func (r *ProtocolIncus) CreateStoragePool(pool api.StoragePoolsPost) error
- func (r *ProtocolIncus) CreateStoragePoolBucket(poolName string, bucket api.StorageBucketsPost) (*api.StorageBucketKey, error)
- func (r *ProtocolIncus) CreateStoragePoolBucketBackup(poolName string, bucketName string, backup api.StorageBucketBackupsPost) (Operation, error)
- func (r *ProtocolIncus) CreateStoragePoolBucketFromBackup(pool string, args StoragePoolBucketBackupArgs) (Operation, error)
- func (r *ProtocolIncus) CreateStoragePoolBucketKey(poolName string, bucketName string, key api.StorageBucketKeysPost) (*api.StorageBucketKey, error)
- func (r *ProtocolIncus) CreateStoragePoolVolume(pool string, volume api.StorageVolumesPost) error
- func (r *ProtocolIncus) CreateStoragePoolVolumeBackup(pool string, volName string, backup api.StoragePoolVolumeBackupsPost) (Operation, error)
- func (r *ProtocolIncus) CreateStoragePoolVolumeFromBackup(pool string, args StoragePoolVolumeBackupArgs) (Operation, error)
- func (r *ProtocolIncus) CreateStoragePoolVolumeFromISO(pool string, args StoragePoolVolumeBackupArgs) (Operation, error)
- func (r *ProtocolIncus) CreateStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, ...) (Operation, error)
- func (r *ProtocolIncus) DeleteCertificate(fingerprint string) error
- func (r *ProtocolIncus) DeleteClusterGroup(name string) error
- func (r *ProtocolIncus) DeleteClusterMember(name string, force bool) error
- func (r *ProtocolIncus) DeleteImage(fingerprint string) (Operation, error)
- func (r *ProtocolIncus) DeleteImageAlias(name string) error
- func (r *ProtocolIncus) DeleteInstance(name string) (Operation, error)
- func (r *ProtocolIncus) DeleteInstanceBackup(instanceName string, name string) (Operation, error)
- func (r *ProtocolIncus) DeleteInstanceConsoleLog(instanceName string, args *InstanceConsoleLogArgs) error
- func (r *ProtocolIncus) DeleteInstanceFile(instanceName string, filePath string) error
- func (r *ProtocolIncus) DeleteInstanceLogfile(name string, filename string) error
- func (r *ProtocolIncus) DeleteInstanceSnapshot(instanceName string, name string) (Operation, error)
- func (r *ProtocolIncus) DeleteInstanceTemplateFile(name string, templateName string) error
- func (r *ProtocolIncus) DeleteNetwork(name string) error
- func (r *ProtocolIncus) DeleteNetworkACL(name string) error
- func (r *ProtocolIncus) DeleteNetworkForward(networkName string, listenAddress string) error
- func (r *ProtocolIncus) DeleteNetworkIntegration(name string) error
- func (r *ProtocolIncus) DeleteNetworkLoadBalancer(networkName string, listenAddress string) error
- func (r *ProtocolIncus) DeleteNetworkPeer(networkName string, peerName string) error
- func (r *ProtocolIncus) DeleteNetworkZone(name string) error
- func (r *ProtocolIncus) DeleteNetworkZoneRecord(zone string, name string) error
- func (r *ProtocolIncus) DeleteOperation(uuid string) error
- func (r *ProtocolIncus) DeleteProfile(name string) error
- func (r *ProtocolIncus) DeleteProject(name string) error
- func (r *ProtocolIncus) DeleteStoragePool(name string) error
- func (r *ProtocolIncus) DeleteStoragePoolBucket(poolName string, bucketName string) error
- func (r *ProtocolIncus) DeleteStoragePoolBucketBackup(pool string, bucketName string, name string) (Operation, error)
- func (r *ProtocolIncus) DeleteStoragePoolBucketKey(poolName string, bucketName string, keyName string) error
- func (r *ProtocolIncus) DeleteStoragePoolVolume(pool string, volType string, name string) error
- func (r *ProtocolIncus) DeleteStoragePoolVolumeBackup(pool string, volName string, name string) (Operation, error)
- func (r *ProtocolIncus) DeleteStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string) (Operation, error)
- func (r *ProtocolIncus) DeleteWarning(UUID string) error
- func (r *ProtocolIncus) Disconnect()
- func (r *ProtocolIncus) DoHTTP(req *http.Request) (*http.Response, error)
- func (r *ProtocolIncus) ExecInstance(instanceName string, exec api.InstanceExecPost, args *InstanceExecArgs) (Operation, error)
- func (r *ProtocolIncus) ExportImage(fingerprint string, image api.ImageExportPost) (Operation, error)
- func (r *ProtocolIncus) GetCertificate(fingerprint string) (*api.Certificate, string, error)
- func (r *ProtocolIncus) GetCertificateFingerprints() ([]string, error)
- func (r *ProtocolIncus) GetCertificates() ([]api.Certificate, error)
- func (r *ProtocolIncus) GetCluster() (*api.Cluster, string, error)
- func (r *ProtocolIncus) GetClusterGroup(name string) (*api.ClusterGroup, string, error)
- func (r *ProtocolIncus) GetClusterGroupNames() ([]string, error)
- func (r *ProtocolIncus) GetClusterGroups() ([]api.ClusterGroup, error)
- func (r *ProtocolIncus) GetClusterMember(name string) (*api.ClusterMember, string, error)
- func (r *ProtocolIncus) GetClusterMemberNames() ([]string, error)
- func (r *ProtocolIncus) GetClusterMemberState(name string) (*api.ClusterMemberState, string, error)
- func (r *ProtocolIncus) GetClusterMembers() ([]api.ClusterMember, error)
- func (r *ProtocolIncus) GetConnectionInfo() (*ConnectionInfo, error)
- func (r *ProtocolIncus) GetEvents() (*EventListener, error)
- func (r *ProtocolIncus) GetEventsAllProjects() (*EventListener, error)
- func (r *ProtocolIncus) GetHTTPClient() (*http.Client, error)
- func (r *ProtocolIncus) GetImage(fingerprint string) (*api.Image, string, error)
- func (r *ProtocolIncus) GetImageAlias(name string) (*api.ImageAliasesEntry, string, error)
- func (r *ProtocolIncus) GetImageAliasArchitectures(imageType string, name string) (map[string]*api.ImageAliasesEntry, error)
- func (r *ProtocolIncus) GetImageAliasNames() ([]string, error)
- func (r *ProtocolIncus) GetImageAliasType(imageType string, name string) (*api.ImageAliasesEntry, string, error)
- func (r *ProtocolIncus) GetImageAliases() ([]api.ImageAliasesEntry, error)
- func (r *ProtocolIncus) GetImageFile(fingerprint string, req ImageFileRequest) (*ImageFileResponse, error)
- func (r *ProtocolIncus) GetImageFingerprints() ([]string, error)
- func (r *ProtocolIncus) GetImageSecret(fingerprint string) (string, error)
- func (r *ProtocolIncus) GetImages() ([]api.Image, error)
- func (r *ProtocolIncus) GetImagesAllProjects() ([]api.Image, error)
- func (r *ProtocolIncus) GetImagesWithFilter(filters []string) ([]api.Image, error)
- func (r *ProtocolIncus) GetInstance(name string) (*api.Instance, string, error)
- func (r *ProtocolIncus) GetInstanceBackup(instanceName string, name string) (*api.InstanceBackup, string, error)
- func (r *ProtocolIncus) GetInstanceBackupFile(instanceName string, name string, req *BackupFileRequest) (*BackupFileResponse, error)
- func (r *ProtocolIncus) GetInstanceBackupNames(instanceName string) ([]string, error)
- func (r *ProtocolIncus) GetInstanceBackups(instanceName string) ([]api.InstanceBackup, error)
- func (r *ProtocolIncus) GetInstanceConsoleLog(instanceName string, args *InstanceConsoleLogArgs) (io.ReadCloser, error)
- func (r *ProtocolIncus) GetInstanceFile(instanceName string, filePath string) (io.ReadCloser, *InstanceFileResponse, error)
- func (r *ProtocolIncus) GetInstanceFileSFTP(instanceName string) (*sftp.Client, error)
- func (r *ProtocolIncus) GetInstanceFileSFTPConn(instanceName string) (net.Conn, error)
- func (r *ProtocolIncus) GetInstanceFull(name string) (*api.InstanceFull, string, error)
- func (r *ProtocolIncus) GetInstanceLogfile(name string, filename string) (io.ReadCloser, error)
- func (r *ProtocolIncus) GetInstanceLogfiles(name string) ([]string, error)
- func (r *ProtocolIncus) GetInstanceMetadata(name string) (*api.ImageMetadata, string, error)
- func (r *ProtocolIncus) GetInstanceNames(instanceType api.InstanceType) ([]string, error)
- func (r *ProtocolIncus) GetInstanceNamesAllProjects(instanceType api.InstanceType) (map[string][]string, error)
- func (r *ProtocolIncus) GetInstanceSnapshot(instanceName string, name string) (*api.InstanceSnapshot, string, error)
- func (r *ProtocolIncus) GetInstanceSnapshotNames(instanceName string) ([]string, error)
- func (r *ProtocolIncus) GetInstanceSnapshots(instanceName string) ([]api.InstanceSnapshot, error)
- func (r *ProtocolIncus) GetInstanceState(name string) (*api.InstanceState, string, error)
- func (r *ProtocolIncus) GetInstanceTemplateFile(instanceName string, templateName string) (io.ReadCloser, error)
- func (r *ProtocolIncus) GetInstanceTemplateFiles(instanceName string) ([]string, error)
- func (r *ProtocolIncus) GetInstances(instanceType api.InstanceType) ([]api.Instance, error)
- func (r *ProtocolIncus) GetInstancesAllProjects(instanceType api.InstanceType) ([]api.Instance, error)
- func (r *ProtocolIncus) GetInstancesAllProjectsWithFilter(instanceType api.InstanceType, filters []string) ([]api.Instance, error)
- func (r *ProtocolIncus) GetInstancesFull(instanceType api.InstanceType) ([]api.InstanceFull, error)
- func (r *ProtocolIncus) GetInstancesFullAllProjects(instanceType api.InstanceType) ([]api.InstanceFull, error)
- func (r *ProtocolIncus) GetInstancesFullAllProjectsWithFilter(instanceType api.InstanceType, filters []string) ([]api.InstanceFull, error)
- func (r *ProtocolIncus) GetInstancesFullWithFilter(instanceType api.InstanceType, filters []string) ([]api.InstanceFull, error)
- func (r *ProtocolIncus) GetInstancesWithFilter(instanceType api.InstanceType, filters []string) ([]api.Instance, error)
- func (r *ProtocolIncus) GetMetadataConfiguration() (*api.MetadataConfiguration, error)
- func (r *ProtocolIncus) GetMetrics() (string, error)
- func (r *ProtocolIncus) GetNetwork(name string) (*api.Network, string, error)
- func (r *ProtocolIncus) GetNetworkACL(name string) (*api.NetworkACL, string, error)
- func (r *ProtocolIncus) GetNetworkACLLogfile(name string) (io.ReadCloser, error)
- func (r *ProtocolIncus) GetNetworkACLNames() ([]string, error)
- func (r *ProtocolIncus) GetNetworkACLs() ([]api.NetworkACL, error)
- func (r *ProtocolIncus) GetNetworkAllocations(allProjects bool) ([]api.NetworkAllocations, error)
- func (r *ProtocolIncus) GetNetworkForward(networkName string, listenAddress string) (*api.NetworkForward, string, error)
- func (r *ProtocolIncus) GetNetworkForwardAddresses(networkName string) ([]string, error)
- func (r *ProtocolIncus) GetNetworkForwards(networkName string) ([]api.NetworkForward, error)
- func (r *ProtocolIncus) GetNetworkIntegration(name string) (*api.NetworkIntegration, string, error)
- func (r *ProtocolIncus) GetNetworkIntegrationNames() ([]string, error)
- func (r *ProtocolIncus) GetNetworkIntegrations() ([]api.NetworkIntegration, error)
- func (r *ProtocolIncus) GetNetworkLeases(name string) ([]api.NetworkLease, error)
- func (r *ProtocolIncus) GetNetworkLoadBalancer(networkName string, listenAddress string) (*api.NetworkLoadBalancer, string, error)
- func (r *ProtocolIncus) GetNetworkLoadBalancerAddresses(networkName string) ([]string, error)
- func (r *ProtocolIncus) GetNetworkLoadBalancers(networkName string) ([]api.NetworkLoadBalancer, error)
- func (r *ProtocolIncus) GetNetworkNames() ([]string, error)
- func (r *ProtocolIncus) GetNetworkPeer(networkName string, peerName string) (*api.NetworkPeer, string, error)
- func (r *ProtocolIncus) GetNetworkPeerNames(networkName string) ([]string, error)
- func (r *ProtocolIncus) GetNetworkPeers(networkName string) ([]api.NetworkPeer, error)
- func (r *ProtocolIncus) GetNetworkState(name string) (*api.NetworkState, error)
- func (r *ProtocolIncus) GetNetworkZone(name string) (*api.NetworkZone, string, error)
- func (r *ProtocolIncus) GetNetworkZoneNames() ([]string, error)
- func (r *ProtocolIncus) GetNetworkZoneRecord(zone string, name string) (*api.NetworkZoneRecord, string, error)
- func (r *ProtocolIncus) GetNetworkZoneRecordNames(zone string) ([]string, error)
- func (r *ProtocolIncus) GetNetworkZoneRecords(zone string) ([]api.NetworkZoneRecord, error)
- func (r *ProtocolIncus) GetNetworkZones() ([]api.NetworkZone, error)
- func (r *ProtocolIncus) GetNetworks() ([]api.Network, error)
- func (r *ProtocolIncus) GetOperation(uuid string) (*api.Operation, string, error)
- func (r *ProtocolIncus) GetOperationUUIDs() ([]string, error)
- func (r *ProtocolIncus) GetOperationWait(uuid string, timeout int) (*api.Operation, string, error)
- func (r *ProtocolIncus) GetOperationWaitSecret(uuid string, secret string, timeout int) (*api.Operation, string, error)
- func (r *ProtocolIncus) GetOperationWebsocket(uuid string, secret string) (*websocket.Conn, error)
- func (r *ProtocolIncus) GetOperations() ([]api.Operation, error)
- func (r *ProtocolIncus) GetOperationsAllProjects() ([]api.Operation, error)
- func (r *ProtocolIncus) GetPrivateImage(fingerprint string, secret string) (*api.Image, string, error)
- func (r *ProtocolIncus) GetPrivateImageFile(fingerprint string, secret string, req ImageFileRequest) (*ImageFileResponse, error)
- func (r *ProtocolIncus) GetProfile(name string) (*api.Profile, string, error)
- func (r *ProtocolIncus) GetProfileNames() ([]string, error)
- func (r *ProtocolIncus) GetProfiles() ([]api.Profile, error)
- func (r *ProtocolIncus) GetProject(name string) (*api.Project, string, error)
- func (r *ProtocolIncus) GetProjectNames() ([]string, error)
- func (r *ProtocolIncus) GetProjectState(name string) (*api.ProjectState, error)
- func (r *ProtocolIncus) GetProjects() ([]api.Project, error)
- func (r *ProtocolIncus) GetServer() (*api.Server, string, error)
- func (r *ProtocolIncus) GetServerResources() (*api.Resources, error)
- func (r *ProtocolIncus) GetStoragePool(name string) (*api.StoragePool, string, error)
- func (r *ProtocolIncus) GetStoragePoolBucket(poolName string, bucketName string) (*api.StorageBucket, string, error)
- func (r *ProtocolIncus) GetStoragePoolBucketBackupFile(pool string, bucketName string, name string, req *BackupFileRequest) (*BackupFileResponse, error)
- func (r *ProtocolIncus) GetStoragePoolBucketKey(poolName string, bucketName string, keyName string) (*api.StorageBucketKey, string, error)
- func (r *ProtocolIncus) GetStoragePoolBucketKeyNames(poolName string, bucketName string) ([]string, error)
- func (r *ProtocolIncus) GetStoragePoolBucketKeys(poolName string, bucketName string) ([]api.StorageBucketKey, error)
- func (r *ProtocolIncus) GetStoragePoolBucketNames(poolName string) ([]string, error)
- func (r *ProtocolIncus) GetStoragePoolBuckets(poolName string) ([]api.StorageBucket, error)
- func (r *ProtocolIncus) GetStoragePoolNames() ([]string, error)
- func (r *ProtocolIncus) GetStoragePoolResources(name string) (*api.ResourcesStoragePool, error)
- func (r *ProtocolIncus) GetStoragePoolVolume(pool string, volType string, name string) (*api.StorageVolume, string, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeBackup(pool string, volName string, name string) (*api.StoragePoolVolumeBackup, string, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeBackupFile(pool string, volName string, name string, req *BackupFileRequest) (*BackupFileResponse, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeBackupNames(pool string, volName string) ([]string, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeBackups(pool string, volName string) ([]api.StoragePoolVolumeBackup, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeNames(pool string) ([]string, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeNamesAllProjects(pool string) (map[string][]string, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string) (*api.StorageVolumeSnapshot, string, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeSnapshotNames(pool string, volumeType string, volumeName string) ([]string, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeSnapshots(pool string, volumeType string, volumeName string) ([]api.StorageVolumeSnapshot, error)
- func (r *ProtocolIncus) GetStoragePoolVolumeState(pool string, volType string, name string) (*api.StorageVolumeState, error)
- func (r *ProtocolIncus) GetStoragePoolVolumes(pool string) ([]api.StorageVolume, error)
- func (r *ProtocolIncus) GetStoragePoolVolumesAllProjects(pool string) ([]api.StorageVolume, error)
- func (r *ProtocolIncus) GetStoragePoolVolumesWithFilter(pool string, filters []string) ([]api.StorageVolume, error)
- func (r *ProtocolIncus) GetStoragePoolVolumesWithFilterAllProjects(pool string, filters []string) ([]api.StorageVolume, error)
- func (r *ProtocolIncus) GetStoragePools() ([]api.StoragePool, error)
- func (r *ProtocolIncus) GetWarning(UUID string) (*api.Warning, string, error)
- func (r *ProtocolIncus) GetWarningUUIDs() ([]string, error)
- func (r *ProtocolIncus) GetWarnings() ([]api.Warning, error)
- func (r *ProtocolIncus) HasExtension(extension string) bool
- func (r *ProtocolIncus) IsAgent() bool
- func (r *ProtocolIncus) IsClustered() bool
- func (r *ProtocolIncus) MigrateInstance(name string, instance api.InstancePost) (Operation, error)
- func (r *ProtocolIncus) MigrateInstanceSnapshot(instanceName string, name string, instance api.InstanceSnapshotPost) (Operation, error)
- func (r *ProtocolIncus) MigrateStoragePoolVolume(pool string, volume api.StorageVolumePost) (Operation, error)
- func (r *ProtocolIncus) MoveStoragePoolVolume(pool string, source InstanceServer, sourcePool string, ...) (RemoteOperation, error)
- func (r *ProtocolIncus) RawOperation(method string, path string, data any, ETag string) (Operation, string, error)
- func (r *ProtocolIncus) RawQuery(method string, path string, data any, ETag string) (*api.Response, string, error)
- func (r *ProtocolIncus) RawWebsocket(path string) (*websocket.Conn, error)
- func (r *ProtocolIncus) RebuildInstance(instanceName string, instance api.InstanceRebuildPost) (op Operation, err error)
- func (r *ProtocolIncus) RebuildInstanceFromImage(source ImageServer, image api.Image, instanceName string, ...) (RemoteOperation, error)
- func (r *ProtocolIncus) RefreshImage(fingerprint string) (Operation, error)
- func (r *ProtocolIncus) RenameClusterGroup(name string, group api.ClusterGroupPost) error
- func (r *ProtocolIncus) RenameClusterMember(name string, member api.ClusterMemberPost) error
- func (r *ProtocolIncus) RenameImageAlias(name string, alias api.ImageAliasesEntryPost) error
- func (r *ProtocolIncus) RenameInstance(name string, instance api.InstancePost) (Operation, error)
- func (r *ProtocolIncus) RenameInstanceBackup(instanceName string, name string, backup api.InstanceBackupPost) (Operation, error)
- func (r *ProtocolIncus) RenameInstanceSnapshot(instanceName string, name string, instance api.InstanceSnapshotPost) (Operation, error)
- func (r *ProtocolIncus) RenameNetwork(name string, network api.NetworkPost) error
- func (r *ProtocolIncus) RenameNetworkACL(name string, acl api.NetworkACLPost) error
- func (r *ProtocolIncus) RenameNetworkIntegration(name string, network api.NetworkIntegrationPost) error
- func (r *ProtocolIncus) RenameProfile(name string, profile api.ProfilePost) error
- func (r *ProtocolIncus) RenameProject(name string, project api.ProjectPost) (Operation, error)
- func (r *ProtocolIncus) RenameStoragePoolVolume(pool string, volType string, name string, volume api.StorageVolumePost) error
- func (r *ProtocolIncus) RenameStoragePoolVolumeBackup(pool string, volName string, name string, ...) (Operation, error)
- func (r *ProtocolIncus) RenameStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string, ...) (Operation, error)
- func (r *ProtocolIncus) RequireAuthenticated(authenticated bool)
- func (r *ProtocolIncus) SendEvent(event api.Event) error
- func (r *ProtocolIncus) UpdateCertificate(fingerprint string, certificate api.CertificatePut, ETag string) error
- func (r *ProtocolIncus) UpdateCluster(cluster api.ClusterPut, ETag string) (Operation, error)
- func (r *ProtocolIncus) UpdateClusterCertificate(certs api.ClusterCertificatePut, ETag string) error
- func (r *ProtocolIncus) UpdateClusterGroup(name string, group api.ClusterGroupPut, ETag string) error
- func (r *ProtocolIncus) UpdateClusterMember(name string, member api.ClusterMemberPut, ETag string) error
- func (r *ProtocolIncus) UpdateClusterMemberState(name string, state api.ClusterMemberStatePost) (Operation, error)
- func (r *ProtocolIncus) UpdateImage(fingerprint string, image api.ImagePut, ETag string) error
- func (r *ProtocolIncus) UpdateImageAlias(name string, alias api.ImageAliasesEntryPut, ETag string) error
- func (r *ProtocolIncus) UpdateInstance(name string, instance api.InstancePut, ETag string) (Operation, error)
- func (r *ProtocolIncus) UpdateInstanceMetadata(name string, metadata api.ImageMetadata, ETag string) error
- func (r *ProtocolIncus) UpdateInstanceSnapshot(instanceName string, name string, instance api.InstanceSnapshotPut, ...) (Operation, error)
- func (r *ProtocolIncus) UpdateInstanceState(name string, state api.InstanceStatePut, ETag string) (Operation, error)
- func (r *ProtocolIncus) UpdateInstances(state api.InstancesPut, ETag string) (Operation, error)
- func (r *ProtocolIncus) UpdateNetwork(name string, network api.NetworkPut, ETag string) error
- func (r *ProtocolIncus) UpdateNetworkACL(name string, acl api.NetworkACLPut, ETag string) error
- func (r *ProtocolIncus) UpdateNetworkForward(networkName string, listenAddress string, forward api.NetworkForwardPut, ...) error
- func (r *ProtocolIncus) UpdateNetworkIntegration(name string, integration api.NetworkIntegrationPut, ETag string) error
- func (r *ProtocolIncus) UpdateNetworkLoadBalancer(networkName string, listenAddress string, ...) error
- func (r *ProtocolIncus) UpdateNetworkPeer(networkName string, peerName string, peer api.NetworkPeerPut, ETag string) error
- func (r *ProtocolIncus) UpdateNetworkZone(name string, zone api.NetworkZonePut, ETag string) error
- func (r *ProtocolIncus) UpdateNetworkZoneRecord(zone string, name string, record api.NetworkZoneRecordPut, ETag string) error
- func (r *ProtocolIncus) UpdateProfile(name string, profile api.ProfilePut, ETag string) error
- func (r *ProtocolIncus) UpdateProject(name string, project api.ProjectPut, ETag string) error
- func (r *ProtocolIncus) UpdateServer(server api.ServerPut, ETag string) error
- func (r *ProtocolIncus) UpdateStoragePool(name string, pool api.StoragePoolPut, ETag string) error
- func (r *ProtocolIncus) UpdateStoragePoolBucket(poolName string, bucketName string, bucket api.StorageBucketPut, ETag string) error
- func (r *ProtocolIncus) UpdateStoragePoolBucketKey(poolName string, bucketName string, keyName string, ...) error
- func (r *ProtocolIncus) UpdateStoragePoolVolume(pool string, volType string, name string, volume api.StorageVolumePut, ...) error
- func (r *ProtocolIncus) UpdateStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string, ...) error
- func (r *ProtocolIncus) UpdateWarning(UUID string, warning api.WarningPut, ETag string) error
- func (r *ProtocolIncus) UseProject(name string) InstanceServer
- func (r *ProtocolIncus) UseTarget(name string) InstanceServer
- func (r *ProtocolIncus) WithContext(ctx context.Context) InstanceServer
- type ProtocolSimpleStreams
- func (r *ProtocolSimpleStreams) Disconnect()
- func (r *ProtocolSimpleStreams) DoHTTP(req *http.Request) (*http.Response, error)
- func (r *ProtocolSimpleStreams) ExportImage(fingerprint string, image api.ImageExportPost) (Operation, error)
- func (r *ProtocolSimpleStreams) GetConnectionInfo() (*ConnectionInfo, error)
- func (r *ProtocolSimpleStreams) GetHTTPClient() (*http.Client, error)
- func (r *ProtocolSimpleStreams) GetImage(fingerprint string) (*api.Image, string, error)
- func (r *ProtocolSimpleStreams) GetImageAlias(name string) (*api.ImageAliasesEntry, string, error)
- func (r *ProtocolSimpleStreams) GetImageAliasArchitectures(imageType string, name string) (map[string]*api.ImageAliasesEntry, error)
- func (r *ProtocolSimpleStreams) GetImageAliasNames() ([]string, error)
- func (r *ProtocolSimpleStreams) GetImageAliasType(imageType string, name string) (*api.ImageAliasesEntry, string, error)
- func (r *ProtocolSimpleStreams) GetImageAliases() ([]api.ImageAliasesEntry, error)
- func (r *ProtocolSimpleStreams) GetImageFile(fingerprint string, req ImageFileRequest) (*ImageFileResponse, error)
- func (r *ProtocolSimpleStreams) GetImageFingerprints() ([]string, error)
- func (r *ProtocolSimpleStreams) GetImageSecret(fingerprint string) (string, error)
- func (r *ProtocolSimpleStreams) GetImages() ([]api.Image, error)
- func (r *ProtocolSimpleStreams) GetImagesAllProjects() ([]api.Image, error)
- func (r *ProtocolSimpleStreams) GetImagesWithFilter(filters []string) ([]api.Image, error)
- func (r *ProtocolSimpleStreams) GetPrivateImage(fingerprint string, secret string) (*api.Image, string, error)
- func (r *ProtocolSimpleStreams) GetPrivateImageFile(fingerprint string, secret string, req ImageFileRequest) (*ImageFileResponse, error)
- type RemoteOperation
- type Server
- type StoragePoolBucketBackupArgs
- type StoragePoolVolumeBackupArgs
- type StoragePoolVolumeCopyArgs
- type StoragePoolVolumeMoveArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupFileRequest ¶
type BackupFileRequest struct { // Writer for the backup file BackupFile io.WriteSeeker // Progress handler (called whenever some progress is made) ProgressHandler func(progress ioprogress.ProgressData) // A canceler that can be used to interrupt some part of the image download request Canceler *cancel.HTTPRequestCanceller }
The BackupFileRequest struct is used for a backup download request.
type BackupFileResponse ¶
type BackupFileResponse struct { // Size of backup file Size int64 }
The BackupFileResponse struct is used as the response for backup downloads.
type ConnectionArgs ¶
type ConnectionArgs struct { // TLS certificate of the remote server. If not specified, the system CA is used. TLSServerCert string // TLS certificate to use for client authentication. TLSClientCert string // TLS key to use for client authentication. TLSClientKey string // TLS CA to validate against when in PKI mode. TLSCA string // User agent string UserAgent string // Authentication type AuthType string // Custom proxy Proxy func(*http.Request) (*url.URL, error) // Custom HTTP Client (used as base for the connection) HTTPClient *http.Client // TransportWrapper wraps the *http.Transport set by Incus TransportWrapper func(*http.Transport) HTTPTransporter // Controls whether a client verifies the server's certificate chain and host name. InsecureSkipVerify bool // Cookie jar CookieJar http.CookieJar // OpenID Connect tokens OIDCTokens *oidc.Tokens[*oidc.IDTokenClaims] // Skip automatic GetServer request upon connection SkipGetServer bool // Caching support for image servers CachePath string CacheExpiry time.Duration }
ConnectionArgs represents a set of common connection properties.
type ConnectionInfo ¶
type ConnectionInfo struct { Addresses []string Certificate string Protocol string URL string SocketPath string Project string Target string }
The ConnectionInfo struct represents general information for a connection.
type EventListener ¶
type EventListener struct {
// contains filtered or unexported fields
}
The EventListener struct is used to interact with an Incus event stream.
func (*EventListener) AddHandler ¶
func (e *EventListener) AddHandler(types []string, function func(api.Event)) (*EventTarget, error)
AddHandler adds a function to be called whenever an event is received.
func (*EventListener) Disconnect ¶
func (e *EventListener) Disconnect()
Disconnect must be used once done listening for events.
func (*EventListener) IsActive ¶
func (e *EventListener) IsActive() bool
IsActive returns true if this listener is still connected, false otherwise.
func (*EventListener) RemoveHandler ¶
func (e *EventListener) RemoveHandler(target *EventTarget) error
RemoveHandler removes a function to be called whenever an event is received.
func (*EventListener) Wait ¶
func (e *EventListener) Wait() error
Wait blocks until the server disconnects the connection or Disconnect() is called.
type EventTarget ¶
type EventTarget struct {
// contains filtered or unexported fields
}
The EventTarget struct is returned to the caller of AddHandler and used in RemoveHandler.
type HTTPTransporter ¶
type HTTPTransporter interface { http.RoundTripper // Transport what this struct wraps Transport() *http.Transport }
HTTPTransporter represents a wrapper around *http.Transport. It is used to add some pre and postprocessing logic to http requests / responses.
type ImageCopyArgs ¶
type ImageCopyArgs struct { // Aliases to add to the copied image. Aliases []api.ImageAlias // Whether to have Incus keep this image up to date AutoUpdate bool // Whether to copy the source image aliases to the target CopyAliases bool // Whether this image is to be made available to unauthenticated users Public bool // The image type to use for resolution Type string // The transfer mode, can be "pull" (default), "push" or "relay" Mode string // List of profiles to apply on the target. Profiles []string }
The ImageCopyArgs struct is used to pass additional options during image copy.
type ImageCreateArgs ¶
type ImageCreateArgs struct { // Reader for the meta file MetaFile io.Reader // Filename for the meta file MetaName string // Reader for the rootfs file RootfsFile io.Reader // Filename for the rootfs file RootfsName string // Progress handler (called with upload progress) ProgressHandler func(progress ioprogress.ProgressData) // Type of the image (container or virtual-machine) Type string }
The ImageCreateArgs struct is used for direct image upload.
type ImageFileRequest ¶
type ImageFileRequest struct { // Writer for the metadata file MetaFile io.WriteSeeker // Writer for the rootfs file RootfsFile io.WriteSeeker // Progress handler (called whenever some progress is made) ProgressHandler func(progress ioprogress.ProgressData) // A canceler that can be used to interrupt some part of the image download request Canceler *cancel.HTTPRequestCanceller // Path retriever for image delta downloads // If set, it must return the path to the image file or an empty string if not available DeltaSourceRetriever func(fingerprint string, file string) string }
The ImageFileRequest struct is used for an image download request.
type ImageFileResponse ¶
type ImageFileResponse struct { // Filename for the metadata file MetaName string // Size of the metadata file MetaSize int64 // Filename for the rootfs file RootfsName string // Size of the rootfs file RootfsSize int64 }
The ImageFileResponse struct is used as the response for image downloads.
type ImageServer ¶
type ImageServer interface { Server // Image handling functions GetImages() (images []api.Image, err error) GetImagesAllProjects() (images []api.Image, err error) GetImageFingerprints() (fingerprints []string, err error) GetImagesWithFilter(filters []string) (images []api.Image, err error) GetImage(fingerprint string) (image *api.Image, ETag string, err error) GetImageFile(fingerprint string, req ImageFileRequest) (resp *ImageFileResponse, err error) GetImageSecret(fingerprint string) (secret string, err error) GetPrivateImage(fingerprint string, secret string) (image *api.Image, ETag string, err error) GetPrivateImageFile(fingerprint string, secret string, req ImageFileRequest) (resp *ImageFileResponse, err error) GetImageAliases() (aliases []api.ImageAliasesEntry, err error) GetImageAliasNames() (names []string, err error) GetImageAlias(name string) (alias *api.ImageAliasesEntry, ETag string, err error) GetImageAliasType(imageType string, name string) (alias *api.ImageAliasesEntry, ETag string, err error) GetImageAliasArchitectures(imageType string, name string) (entries map[string]*api.ImageAliasesEntry, err error) ExportImage(fingerprint string, image api.ImageExportPost) (Operation, error) }
The ImageServer type represents a read-only image server.
func ConnectPublicIncus ¶
func ConnectPublicIncus(url string, args *ConnectionArgs) (ImageServer, error)
ConnectPublicIncus lets you connect to a remote public Incus daemon over HTTPs.
Unless the remote server is trusted by the system CA, the remote certificate must be provided (TLSServerCert).
func ConnectPublicIncusWithContext ¶
func ConnectPublicIncusWithContext(ctx context.Context, url string, args *ConnectionArgs) (ImageServer, error)
ConnectPublicIncusWithContext lets you connect to a remote public Incus daemon over HTTPs with context.Context.
Unless the remote server is trusted by the system CA, the remote certificate must be provided (TLSServerCert).
func ConnectSimpleStreams ¶
func ConnectSimpleStreams(url string, args *ConnectionArgs) (ImageServer, error)
ConnectSimpleStreams lets you connect to a remote SimpleStreams image server over HTTPs.
Unless the remote server is trusted by the system CA, the remote certificate must be provided (TLSServerCert).
type InstanceBackupArgs ¶
type InstanceBackupArgs struct { // The backup file BackupFile io.Reader // Storage pool to use PoolName string // Name to import backup as Name string }
The InstanceBackupArgs struct is used when creating a instance from a backup.
type InstanceConsoleArgs ¶
type InstanceConsoleArgs struct { // Bidirectional fd to pass to the instance Terminal io.ReadWriteCloser // Control message handler (window resize) Control func(conn *websocket.Conn) // Closing this Channel causes a disconnect from the instance's console ConsoleDisconnect chan bool }
The InstanceConsoleArgs struct is used to pass additional options during a instance console session.
type InstanceConsoleLogArgs ¶
type InstanceConsoleLogArgs struct { }
The InstanceConsoleLogArgs struct is used to pass additional options during a instance console log request.
type InstanceCopyArgs ¶
type InstanceCopyArgs struct { // If set, the instance will be renamed on copy Name string // If set, the instance running state will be transferred (live migration) Live bool // If set, only the instance will copied, its snapshots won't InstanceOnly bool // The transfer mode, can be "pull" (default), "push" or "relay" Mode string // API extension: container_incremental_copy // Perform an incremental copy Refresh bool // API extension: instance_allow_inconsistent_copy AllowInconsistent bool }
The InstanceCopyArgs struct is used to pass additional options during instance copy.
type InstanceExecArgs ¶
type InstanceExecArgs struct { // Standard input Stdin io.Reader // Standard output Stdout io.Writer // Standard error Stderr io.Writer // Control message handler (window resize, signals, ...) Control func(conn *websocket.Conn) // Channel that will be closed when all data operations are done DataDone chan bool }
The InstanceExecArgs struct is used to pass additional options during instance exec.
type InstanceFileArgs ¶
type InstanceFileArgs struct { // File content Content io.ReadSeeker // User id that owns the file UID int64 // Group id that owns the file GID int64 // File permissions Mode int // File type (file or directory) Type string // File write mode (overwrite or append) WriteMode string }
The InstanceFileArgs struct is used to pass the various options for a instance file upload.
type InstanceFileResponse ¶
type InstanceFileResponse struct { // User id that owns the file UID int64 // Group id that owns the file GID int64 // File permissions Mode int // File type (file or directory) Type string // If a directory, the list of files inside it Entries []string }
The InstanceFileResponse struct is used as part of the response for a instance file download.
type InstanceServer ¶
type InstanceServer interface { ImageServer // Server functions GetMetrics() (metrics string, err error) GetServer() (server *api.Server, ETag string, err error) GetServerResources() (resources *api.Resources, err error) UpdateServer(server api.ServerPut, ETag string) (err error) ApplyServerPreseed(config api.InitPreseed) error HasExtension(extension string) (exists bool) RequireAuthenticated(authenticated bool) IsClustered() (clustered bool) UseTarget(name string) (client InstanceServer) UseProject(name string) (client InstanceServer) // Certificate functions GetCertificateFingerprints() (fingerprints []string, err error) GetCertificates() (certificates []api.Certificate, err error) GetCertificate(fingerprint string) (certificate *api.Certificate, ETag string, err error) CreateCertificate(certificate api.CertificatesPost) (err error) UpdateCertificate(fingerprint string, certificate api.CertificatePut, ETag string) (err error) DeleteCertificate(fingerprint string) (err error) CreateCertificateToken(certificate api.CertificatesPost) (op Operation, err error) // Instance functions. GetInstanceNames(instanceType api.InstanceType) (names []string, err error) GetInstanceNamesAllProjects(instanceType api.InstanceType) (names map[string][]string, err error) GetInstances(instanceType api.InstanceType) (instances []api.Instance, err error) GetInstancesFull(instanceType api.InstanceType) (instances []api.InstanceFull, err error) GetInstancesAllProjects(instanceType api.InstanceType) (instances []api.Instance, err error) GetInstancesFullAllProjects(instanceType api.InstanceType) (instances []api.InstanceFull, err error) GetInstancesWithFilter(instanceType api.InstanceType, filters []string) (instances []api.Instance, err error) GetInstancesFullWithFilter(instanceType api.InstanceType, filters []string) (instances []api.InstanceFull, err error) GetInstancesAllProjectsWithFilter(instanceType api.InstanceType, filters []string) (instances []api.Instance, err error) GetInstancesFullAllProjectsWithFilter(instanceType api.InstanceType, filters []string) (instances []api.InstanceFull, err error) GetInstance(name string) (instance *api.Instance, ETag string, err error) GetInstanceFull(name string) (instance *api.InstanceFull, ETag string, err error) CreateInstance(instance api.InstancesPost) (op Operation, err error) CreateInstanceFromImage(source ImageServer, image api.Image, req api.InstancesPost) (op RemoteOperation, err error) CopyInstance(source InstanceServer, instance api.Instance, args *InstanceCopyArgs) (op RemoteOperation, err error) UpdateInstance(name string, instance api.InstancePut, ETag string) (op Operation, err error) RenameInstance(name string, instance api.InstancePost) (op Operation, err error) MigrateInstance(name string, instance api.InstancePost) (op Operation, err error) DeleteInstance(name string) (op Operation, err error) UpdateInstances(state api.InstancesPut, ETag string) (op Operation, err error) RebuildInstance(instanceName string, req api.InstanceRebuildPost) (op Operation, err error) RebuildInstanceFromImage(source ImageServer, image api.Image, instanceName string, req api.InstanceRebuildPost) (op RemoteOperation, err error) ExecInstance(instanceName string, exec api.InstanceExecPost, args *InstanceExecArgs) (op Operation, err error) ConsoleInstance(instanceName string, console api.InstanceConsolePost, args *InstanceConsoleArgs) (op Operation, err error) ConsoleInstanceDynamic(instanceName string, console api.InstanceConsolePost, args *InstanceConsoleArgs) (Operation, func(io.ReadWriteCloser) error, error) GetInstanceConsoleLog(instanceName string, args *InstanceConsoleLogArgs) (content io.ReadCloser, err error) DeleteInstanceConsoleLog(instanceName string, args *InstanceConsoleLogArgs) (err error) GetInstanceFile(instanceName string, path string) (content io.ReadCloser, resp *InstanceFileResponse, err error) CreateInstanceFile(instanceName string, path string, args InstanceFileArgs) (err error) DeleteInstanceFile(instanceName string, path string) (err error) GetInstanceFileSFTPConn(instanceName string) (net.Conn, error) GetInstanceFileSFTP(instanceName string) (*sftp.Client, error) GetInstanceSnapshotNames(instanceName string) (names []string, err error) GetInstanceSnapshots(instanceName string) (snapshots []api.InstanceSnapshot, err error) GetInstanceSnapshot(instanceName string, name string) (snapshot *api.InstanceSnapshot, ETag string, err error) CreateInstanceSnapshot(instanceName string, snapshot api.InstanceSnapshotsPost) (op Operation, err error) CopyInstanceSnapshot(source InstanceServer, instanceName string, snapshot api.InstanceSnapshot, args *InstanceSnapshotCopyArgs) (op RemoteOperation, err error) RenameInstanceSnapshot(instanceName string, name string, instance api.InstanceSnapshotPost) (op Operation, err error) MigrateInstanceSnapshot(instanceName string, name string, instance api.InstanceSnapshotPost) (op Operation, err error) DeleteInstanceSnapshot(instanceName string, name string) (op Operation, err error) UpdateInstanceSnapshot(instanceName string, name string, instance api.InstanceSnapshotPut, ETag string) (op Operation, err error) GetInstanceBackupNames(instanceName string) (names []string, err error) GetInstanceBackups(instanceName string) (backups []api.InstanceBackup, err error) GetInstanceBackup(instanceName string, name string) (backup *api.InstanceBackup, ETag string, err error) CreateInstanceBackup(instanceName string, backup api.InstanceBackupsPost) (op Operation, err error) RenameInstanceBackup(instanceName string, name string, backup api.InstanceBackupPost) (op Operation, err error) DeleteInstanceBackup(instanceName string, name string) (op Operation, err error) GetInstanceBackupFile(instanceName string, name string, req *BackupFileRequest) (resp *BackupFileResponse, err error) CreateInstanceFromBackup(args InstanceBackupArgs) (op Operation, err error) GetInstanceState(name string) (state *api.InstanceState, ETag string, err error) UpdateInstanceState(name string, state api.InstanceStatePut, ETag string) (op Operation, err error) GetInstanceLogfiles(name string) (logfiles []string, err error) GetInstanceLogfile(name string, filename string) (content io.ReadCloser, err error) DeleteInstanceLogfile(name string, filename string) (err error) GetInstanceMetadata(name string) (metadata *api.ImageMetadata, ETag string, err error) UpdateInstanceMetadata(name string, metadata api.ImageMetadata, ETag string) (err error) GetInstanceTemplateFiles(instanceName string) (templates []string, err error) GetInstanceTemplateFile(instanceName string, templateName string) (content io.ReadCloser, err error) CreateInstanceTemplateFile(instanceName string, templateName string, content io.ReadSeeker) (err error) DeleteInstanceTemplateFile(name string, templateName string) (err error) // Event handling functions GetEvents() (listener *EventListener, err error) GetEventsAllProjects() (listener *EventListener, err error) SendEvent(event api.Event) error // Image functions CreateImage(image api.ImagesPost, args *ImageCreateArgs) (op Operation, err error) CopyImage(source ImageServer, image api.Image, args *ImageCopyArgs) (op RemoteOperation, err error) UpdateImage(fingerprint string, image api.ImagePut, ETag string) (err error) DeleteImage(fingerprint string) (op Operation, err error) RefreshImage(fingerprint string) (op Operation, err error) CreateImageSecret(fingerprint string) (op Operation, err error) CreateImageAlias(alias api.ImageAliasesPost) (err error) UpdateImageAlias(name string, alias api.ImageAliasesEntryPut, ETag string) (err error) RenameImageAlias(name string, alias api.ImageAliasesEntryPost) (err error) DeleteImageAlias(name string) (err error) // Configuration metadata functions GetMetadataConfiguration() (meta *api.MetadataConfiguration, err error) // Network functions ("network" API extension) GetNetworkNames() (names []string, err error) GetNetworks() (networks []api.Network, err error) GetNetwork(name string) (network *api.Network, ETag string, err error) GetNetworkLeases(name string) (leases []api.NetworkLease, err error) GetNetworkState(name string) (state *api.NetworkState, err error) CreateNetwork(network api.NetworksPost) (err error) UpdateNetwork(name string, network api.NetworkPut, ETag string) (err error) RenameNetwork(name string, network api.NetworkPost) (err error) DeleteNetwork(name string) (err error) // Network forward functions ("network_forward" API extension) GetNetworkForwardAddresses(networkName string) ([]string, error) GetNetworkForwards(networkName string) ([]api.NetworkForward, error) GetNetworkForward(networkName string, listenAddress string) (forward *api.NetworkForward, ETag string, err error) CreateNetworkForward(networkName string, forward api.NetworkForwardsPost) error UpdateNetworkForward(networkName string, listenAddress string, forward api.NetworkForwardPut, ETag string) (err error) DeleteNetworkForward(networkName string, listenAddress string) (err error) // Network load balancer functions ("network_load_balancer" API extension) GetNetworkLoadBalancerAddresses(networkName string) ([]string, error) GetNetworkLoadBalancers(networkName string) ([]api.NetworkLoadBalancer, error) GetNetworkLoadBalancer(networkName string, listenAddress string) (forward *api.NetworkLoadBalancer, ETag string, err error) CreateNetworkLoadBalancer(networkName string, forward api.NetworkLoadBalancersPost) error UpdateNetworkLoadBalancer(networkName string, listenAddress string, forward api.NetworkLoadBalancerPut, ETag string) (err error) DeleteNetworkLoadBalancer(networkName string, listenAddress string) (err error) // Network peer functions ("network_peer" API extension) GetNetworkPeerNames(networkName string) ([]string, error) GetNetworkPeers(networkName string) ([]api.NetworkPeer, error) GetNetworkPeer(networkName string, peerName string) (peer *api.NetworkPeer, ETag string, err error) CreateNetworkPeer(networkName string, peer api.NetworkPeersPost) error UpdateNetworkPeer(networkName string, peerName string, peer api.NetworkPeerPut, ETag string) (err error) DeleteNetworkPeer(networkName string, peerName string) (err error) // Network ACL functions ("network_acl" API extension) GetNetworkACLNames() (names []string, err error) GetNetworkACLs() (acls []api.NetworkACL, err error) GetNetworkACL(name string) (acl *api.NetworkACL, ETag string, err error) GetNetworkACLLogfile(name string) (log io.ReadCloser, err error) CreateNetworkACL(acl api.NetworkACLsPost) (err error) UpdateNetworkACL(name string, acl api.NetworkACLPut, ETag string) (err error) RenameNetworkACL(name string, acl api.NetworkACLPost) (err error) DeleteNetworkACL(name string) (err error) // Network allocations functions ("network_allocations" API extension) GetNetworkAllocations(allProjects bool) (allocations []api.NetworkAllocations, err error) // Network zone functions ("network_dns" API extension) GetNetworkZoneNames() (names []string, err error) GetNetworkZones() (zones []api.NetworkZone, err error) GetNetworkZone(name string) (zone *api.NetworkZone, ETag string, err error) CreateNetworkZone(zone api.NetworkZonesPost) (err error) UpdateNetworkZone(name string, zone api.NetworkZonePut, ETag string) (err error) DeleteNetworkZone(name string) (err error) GetNetworkZoneRecordNames(zone string) (names []string, err error) GetNetworkZoneRecords(zone string) (records []api.NetworkZoneRecord, err error) GetNetworkZoneRecord(zone string, name string) (record *api.NetworkZoneRecord, ETag string, err error) CreateNetworkZoneRecord(zone string, record api.NetworkZoneRecordsPost) (err error) UpdateNetworkZoneRecord(zone string, name string, record api.NetworkZoneRecordPut, ETag string) (err error) DeleteNetworkZoneRecord(zone string, name string) (err error) // Network integrations functions ("network_integrations" API extension) GetNetworkIntegrationNames() (names []string, err error) GetNetworkIntegrations() (integrations []api.NetworkIntegration, err error) GetNetworkIntegration(name string) (integration *api.NetworkIntegration, ETag string, err error) CreateNetworkIntegration(integration api.NetworkIntegrationsPost) (err error) UpdateNetworkIntegration(name string, integration api.NetworkIntegrationPut, ETag string) (err error) RenameNetworkIntegration(name string, integration api.NetworkIntegrationPost) (err error) DeleteNetworkIntegration(name string) (err error) // Operation functions GetOperationUUIDs() (uuids []string, err error) GetOperations() (operations []api.Operation, err error) GetOperationsAllProjects() (operations []api.Operation, err error) GetOperation(uuid string) (op *api.Operation, ETag string, err error) GetOperationWait(uuid string, timeout int) (op *api.Operation, ETag string, err error) GetOperationWaitSecret(uuid string, secret string, timeout int) (op *api.Operation, ETag string, err error) GetOperationWebsocket(uuid string, secret string) (conn *websocket.Conn, err error) DeleteOperation(uuid string) (err error) // Profile functions GetProfileNames() (names []string, err error) GetProfiles() (profiles []api.Profile, err error) GetProfile(name string) (profile *api.Profile, ETag string, err error) CreateProfile(profile api.ProfilesPost) (err error) UpdateProfile(name string, profile api.ProfilePut, ETag string) (err error) RenameProfile(name string, profile api.ProfilePost) (err error) DeleteProfile(name string) (err error) // Project functions GetProjectNames() (names []string, err error) GetProjects() (projects []api.Project, err error) GetProject(name string) (project *api.Project, ETag string, err error) GetProjectState(name string) (project *api.ProjectState, err error) CreateProject(project api.ProjectsPost) (err error) UpdateProject(name string, project api.ProjectPut, ETag string) (err error) RenameProject(name string, project api.ProjectPost) (op Operation, err error) DeleteProject(name string) (err error) // Storage pool functions ("storage" API extension) GetStoragePoolNames() (names []string, err error) GetStoragePools() (pools []api.StoragePool, err error) GetStoragePool(name string) (pool *api.StoragePool, ETag string, err error) GetStoragePoolResources(name string) (resources *api.ResourcesStoragePool, err error) CreateStoragePool(pool api.StoragePoolsPost) (err error) UpdateStoragePool(name string, pool api.StoragePoolPut, ETag string) (err error) DeleteStoragePool(name string) (err error) // Storage bucket functions ("storage_buckets" API extension) GetStoragePoolBucketNames(poolName string) ([]string, error) GetStoragePoolBuckets(poolName string) ([]api.StorageBucket, error) GetStoragePoolBucket(poolName string, bucketName string) (bucket *api.StorageBucket, ETag string, err error) CreateStoragePoolBucket(poolName string, bucket api.StorageBucketsPost) (*api.StorageBucketKey, error) UpdateStoragePoolBucket(poolName string, bucketName string, bucket api.StorageBucketPut, ETag string) (err error) DeleteStoragePoolBucket(poolName string, bucketName string) (err error) GetStoragePoolBucketKeyNames(poolName string, bucketName string) ([]string, error) GetStoragePoolBucketKeys(poolName string, bucketName string) ([]api.StorageBucketKey, error) GetStoragePoolBucketKey(poolName string, bucketName string, keyName string) (key *api.StorageBucketKey, ETag string, err error) CreateStoragePoolBucketKey(poolName string, bucketName string, key api.StorageBucketKeysPost) (newKey *api.StorageBucketKey, err error) UpdateStoragePoolBucketKey(poolName string, bucketName string, keyName string, key api.StorageBucketKeyPut, ETag string) (err error) DeleteStoragePoolBucketKey(poolName string, bucketName string, keyName string) (err error) // Storage bucket backup functions ("storage_bucket_backup" API extension) CreateStoragePoolBucketBackup(poolName string, bucketName string, backup api.StorageBucketBackupsPost) (op Operation, err error) DeleteStoragePoolBucketBackup(pool string, bucketName string, name string) (op Operation, err error) GetStoragePoolBucketBackupFile(pool string, bucketName string, name string, req *BackupFileRequest) (resp *BackupFileResponse, err error) CreateStoragePoolBucketFromBackup(pool string, args StoragePoolBucketBackupArgs) (op Operation, err error) // Storage volume functions ("storage" API extension) GetStoragePoolVolumeNames(pool string) (names []string, err error) GetStoragePoolVolumeNamesAllProjects(pool string) (names map[string][]string, err error) GetStoragePoolVolumes(pool string) (volumes []api.StorageVolume, err error) GetStoragePoolVolumesAllProjects(pool string) (volumes []api.StorageVolume, err error) GetStoragePoolVolumesWithFilter(pool string, filters []string) (volumes []api.StorageVolume, err error) GetStoragePoolVolumesWithFilterAllProjects(pool string, filters []string) (volumes []api.StorageVolume, err error) GetStoragePoolVolume(pool string, volType string, name string) (volume *api.StorageVolume, ETag string, err error) GetStoragePoolVolumeState(pool string, volType string, name string) (state *api.StorageVolumeState, err error) CreateStoragePoolVolume(pool string, volume api.StorageVolumesPost) (err error) UpdateStoragePoolVolume(pool string, volType string, name string, volume api.StorageVolumePut, ETag string) (err error) DeleteStoragePoolVolume(pool string, volType string, name string) (err error) RenameStoragePoolVolume(pool string, volType string, name string, volume api.StorageVolumePost) (err error) CopyStoragePoolVolume(pool string, source InstanceServer, sourcePool string, volume api.StorageVolume, args *StoragePoolVolumeCopyArgs) (op RemoteOperation, err error) MoveStoragePoolVolume(pool string, source InstanceServer, sourcePool string, volume api.StorageVolume, args *StoragePoolVolumeMoveArgs) (op RemoteOperation, err error) MigrateStoragePoolVolume(pool string, volume api.StorageVolumePost) (op Operation, err error) // Storage volume snapshot functions ("storage_api_volume_snapshots" API extension) CreateStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshot api.StorageVolumeSnapshotsPost) (op Operation, err error) DeleteStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string) (op Operation, err error) GetStoragePoolVolumeSnapshotNames(pool string, volumeType string, volumeName string) (names []string, err error) GetStoragePoolVolumeSnapshots(pool string, volumeType string, volumeName string) (snapshots []api.StorageVolumeSnapshot, err error) GetStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string) (snapshot *api.StorageVolumeSnapshot, ETag string, err error) RenameStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string, snapshot api.StorageVolumeSnapshotPost) (op Operation, err error) UpdateStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string, volume api.StorageVolumeSnapshotPut, ETag string) (err error) // Storage volume backup functions ("custom_volume_backup" API extension) GetStoragePoolVolumeBackupNames(pool string, volName string) (names []string, err error) GetStoragePoolVolumeBackups(pool string, volName string) (backups []api.StoragePoolVolumeBackup, err error) GetStoragePoolVolumeBackup(pool string, volName string, name string) (backup *api.StoragePoolVolumeBackup, ETag string, err error) CreateStoragePoolVolumeBackup(pool string, volName string, backup api.StoragePoolVolumeBackupsPost) (op Operation, err error) RenameStoragePoolVolumeBackup(pool string, volName string, name string, backup api.StoragePoolVolumeBackupPost) (op Operation, err error) DeleteStoragePoolVolumeBackup(pool string, volName string, name string) (op Operation, err error) GetStoragePoolVolumeBackupFile(pool string, volName string, name string, req *BackupFileRequest) (resp *BackupFileResponse, err error) CreateStoragePoolVolumeFromBackup(pool string, args StoragePoolVolumeBackupArgs) (op Operation, err error) // Storage volume ISO import function ("custom_volume_iso" API extension) CreateStoragePoolVolumeFromISO(pool string, args StoragePoolVolumeBackupArgs) (op Operation, err error) // Cluster functions ("cluster" API extensions) GetCluster() (cluster *api.Cluster, ETag string, err error) UpdateCluster(cluster api.ClusterPut, ETag string) (op Operation, err error) DeleteClusterMember(name string, force bool) (err error) GetClusterMemberNames() (names []string, err error) GetClusterMembers() (members []api.ClusterMember, err error) GetClusterMember(name string) (member *api.ClusterMember, ETag string, err error) UpdateClusterMember(name string, member api.ClusterMemberPut, ETag string) (err error) RenameClusterMember(name string, member api.ClusterMemberPost) (err error) CreateClusterMember(member api.ClusterMembersPost) (op Operation, err error) UpdateClusterCertificate(certs api.ClusterCertificatePut, ETag string) (err error) GetClusterMemberState(name string) (*api.ClusterMemberState, string, error) UpdateClusterMemberState(name string, state api.ClusterMemberStatePost) (op Operation, err error) GetClusterGroups() ([]api.ClusterGroup, error) GetClusterGroupNames() ([]string, error) RenameClusterGroup(name string, group api.ClusterGroupPost) error CreateClusterGroup(group api.ClusterGroupsPost) error DeleteClusterGroup(name string) error UpdateClusterGroup(name string, group api.ClusterGroupPut, ETag string) error GetClusterGroup(name string) (*api.ClusterGroup, string, error) // Warning functions GetWarningUUIDs() (uuids []string, err error) GetWarnings() (warnings []api.Warning, err error) GetWarning(UUID string) (warning *api.Warning, ETag string, err error) UpdateWarning(UUID string, warning api.WarningPut, ETag string) (err error) DeleteWarning(UUID string) (err error) // Internal functions (for internal use) RawQuery(method string, path string, data any, queryETag string) (resp *api.Response, ETag string, err error) RawWebsocket(path string) (conn *websocket.Conn, err error) RawOperation(method string, path string, data any, queryETag string) (op Operation, ETag string, err error) }
The InstanceServer type represents a full featured Incus server.
func ConnectIncus ¶
func ConnectIncus(url string, args *ConnectionArgs) (InstanceServer, error)
ConnectIncus lets you connect to a remote Incus daemon over HTTPs.
A client certificate (TLSClientCert) and key (TLSClientKey) must be provided.
If connecting to an Incus daemon running in PKI mode, the PKI CA (TLSCA) must also be provided.
Unless the remote server is trusted by the system CA, the remote certificate must be provided (TLSServerCert).
func ConnectIncusHTTP ¶
func ConnectIncusHTTP(args *ConnectionArgs, client *http.Client) (InstanceServer, error)
ConnectIncusHTTP lets you connect to a VM agent over a VM socket.
func ConnectIncusHTTPWithContext ¶
func ConnectIncusHTTPWithContext(ctx context.Context, args *ConnectionArgs, client *http.Client) (InstanceServer, error)
ConnectIncusHTTPWithContext lets you connect to a VM agent over a VM socket with context.Context.
func ConnectIncusUnix ¶
func ConnectIncusUnix(path string, args *ConnectionArgs) (InstanceServer, error)
ConnectIncusUnix lets you connect to a remote Incus daemon over a local unix socket.
If the path argument is empty, then $INCUS_SOCKET will be used, if unset $INCUS_DIR/unix.socket will be used and if that one isn't set either, then the path will default to /var/lib/incus/unix.socket.
func ConnectIncusUnixWithContext ¶
func ConnectIncusUnixWithContext(ctx context.Context, path string, args *ConnectionArgs) (InstanceServer, error)
ConnectIncusUnixWithContext lets you connect to a remote Incus daemon over a local unix socket with context.Context.
If the path argument is empty, then $INCUS_SOCKET will be used, if unset $INCUS_DIR/unix.socket will be used and if that one isn't set either, then the path will default to /var/lib/incus/unix.socket.
func ConnectIncusWithContext ¶
func ConnectIncusWithContext(ctx context.Context, url string, args *ConnectionArgs) (InstanceServer, error)
ConnectIncusWithContext lets you connect to a remote Incus daemon over HTTPs with context.Context.
A client certificate (TLSClientCert) and key (TLSClientKey) must be provided.
If connecting to an Incus daemon running in PKI mode, the PKI CA (TLSCA) must also be provided.
Unless the remote server is trusted by the system CA, the remote certificate must be provided (TLSServerCert).
type InstanceSnapshotCopyArgs ¶
type InstanceSnapshotCopyArgs struct { // If set, the instance will be renamed on copy Name string // The transfer mode, can be "pull" (default), "push" or "relay" Mode string // API extension: container_snapshot_stateful_migration // If set, the instance running state will be transferred (live migration) Live bool }
The InstanceSnapshotCopyArgs struct is used to pass additional options during instance copy.
type Operation ¶
type Operation interface { AddHandler(function func(api.Operation)) (target *EventTarget, err error) Cancel() (err error) Get() (op api.Operation) GetWebsocket(secret string) (conn *websocket.Conn, err error) RemoveHandler(target *EventTarget) (err error) Refresh() (err error) Wait() (err error) WaitContext(ctx context.Context) error }
The Operation type represents a currently running operation.
type ProtocolIncus ¶
type ProtocolIncus struct {
// contains filtered or unexported fields
}
ProtocolIncus represents an Incus API server.
func (*ProtocolIncus) ApplyServerPreseed ¶
func (r *ProtocolIncus) ApplyServerPreseed(config api.InitPreseed) error
ApplyServerPreseed configures a target Incus server with the provided server and cluster configuration.
func (*ProtocolIncus) CheckExtension ¶
func (r *ProtocolIncus) CheckExtension(extensionName string) error
CheckExtension checks if the server has the specified extension.
func (*ProtocolIncus) ConsoleInstance ¶
func (r *ProtocolIncus) ConsoleInstance(instanceName string, console api.InstanceConsolePost, args *InstanceConsoleArgs) (Operation, error)
ConsoleInstance requests that Incus attaches to the console device of a instance.
func (*ProtocolIncus) ConsoleInstanceDynamic ¶
func (r *ProtocolIncus) ConsoleInstanceDynamic(instanceName string, console api.InstanceConsolePost, args *InstanceConsoleArgs) (Operation, func(io.ReadWriteCloser) error, error)
ConsoleInstanceDynamic requests that Incus attaches to the console device of a instance with the possibility of opening multiple connections to it.
Every time the returned 'console' function is called, a new connection will be established and proxied to the given io.ReadWriteCloser.
func (*ProtocolIncus) CopyImage ¶
func (r *ProtocolIncus) CopyImage(source ImageServer, image api.Image, args *ImageCopyArgs) (RemoteOperation, error)
CopyImage copies an image from a remote server. Additional options can be passed using ImageCopyArgs.
func (*ProtocolIncus) CopyInstance ¶
func (r *ProtocolIncus) CopyInstance(source InstanceServer, instance api.Instance, args *InstanceCopyArgs) (RemoteOperation, error)
CopyInstance copies a instance from a remote server. Additional options can be passed using InstanceCopyArgs.
func (*ProtocolIncus) CopyInstanceSnapshot ¶
func (r *ProtocolIncus) CopyInstanceSnapshot(source InstanceServer, instanceName string, snapshot api.InstanceSnapshot, args *InstanceSnapshotCopyArgs) (RemoteOperation, error)
CopyInstanceSnapshot copies a snapshot from a remote server into a new instance. Additional options can be passed using InstanceCopyArgs.
func (*ProtocolIncus) CopyStoragePoolVolume ¶
func (r *ProtocolIncus) CopyStoragePoolVolume(pool string, source InstanceServer, sourcePool string, volume api.StorageVolume, args *StoragePoolVolumeCopyArgs) (RemoteOperation, error)
CopyStoragePoolVolume copies an existing storage volume.
func (*ProtocolIncus) CreateCertificate ¶
func (r *ProtocolIncus) CreateCertificate(certificate api.CertificatesPost) error
CreateCertificate adds a new certificate to the Incus trust store.
func (*ProtocolIncus) CreateCertificateToken ¶
func (r *ProtocolIncus) CreateCertificateToken(certificate api.CertificatesPost) (Operation, error)
CreateCertificateToken requests a certificate add token.
func (*ProtocolIncus) CreateClusterGroup ¶
func (r *ProtocolIncus) CreateClusterGroup(group api.ClusterGroupsPost) error
CreateClusterGroup creates a new cluster group.
func (*ProtocolIncus) CreateClusterMember ¶
func (r *ProtocolIncus) CreateClusterMember(member api.ClusterMembersPost) (Operation, error)
CreateClusterMember generates a join token to add a cluster member.
func (*ProtocolIncus) CreateImage ¶
func (r *ProtocolIncus) CreateImage(image api.ImagesPost, args *ImageCreateArgs) (Operation, error)
CreateImage requests that Incus creates, copies or import a new image.
func (*ProtocolIncus) CreateImageAlias ¶
func (r *ProtocolIncus) CreateImageAlias(alias api.ImageAliasesPost) error
CreateImageAlias sets up a new image alias.
func (*ProtocolIncus) CreateImageSecret ¶
func (r *ProtocolIncus) CreateImageSecret(fingerprint string) (Operation, error)
CreateImageSecret requests that Incus issues a temporary image secret.
func (*ProtocolIncus) CreateInstance ¶
func (r *ProtocolIncus) CreateInstance(instance api.InstancesPost) (Operation, error)
CreateInstance requests that Incus creates a new instance.
func (*ProtocolIncus) CreateInstanceBackup ¶
func (r *ProtocolIncus) CreateInstanceBackup(instanceName string, backup api.InstanceBackupsPost) (Operation, error)
CreateInstanceBackup requests that Incus creates a new backup for the instance.
func (*ProtocolIncus) CreateInstanceFile ¶
func (r *ProtocolIncus) CreateInstanceFile(instanceName string, filePath string, args InstanceFileArgs) error
CreateInstanceFile tells Incus to create a file in the instance.
func (*ProtocolIncus) CreateInstanceFromBackup ¶
func (r *ProtocolIncus) CreateInstanceFromBackup(args InstanceBackupArgs) (Operation, error)
CreateInstanceFromBackup is a convenience function to make it easier to create a instance from a backup.
func (*ProtocolIncus) CreateInstanceFromImage ¶
func (r *ProtocolIncus) CreateInstanceFromImage(source ImageServer, image api.Image, req api.InstancesPost) (RemoteOperation, error)
CreateInstanceFromImage is a convenience function to make it easier to create a instance from an existing image.
func (*ProtocolIncus) CreateInstanceSnapshot ¶
func (r *ProtocolIncus) CreateInstanceSnapshot(instanceName string, snapshot api.InstanceSnapshotsPost) (Operation, error)
CreateInstanceSnapshot requests that Incus creates a new snapshot for the instance.
func (*ProtocolIncus) CreateInstanceTemplateFile ¶
func (r *ProtocolIncus) CreateInstanceTemplateFile(instanceName string, templateName string, content io.ReadSeeker) error
CreateInstanceTemplateFile creates an a template for a instance.
func (*ProtocolIncus) CreateNetwork ¶
func (r *ProtocolIncus) CreateNetwork(network api.NetworksPost) error
CreateNetwork defines a new network using the provided Network struct.
func (*ProtocolIncus) CreateNetworkACL ¶
func (r *ProtocolIncus) CreateNetworkACL(acl api.NetworkACLsPost) error
CreateNetworkACL defines a new network ACL using the provided struct.
func (*ProtocolIncus) CreateNetworkForward ¶
func (r *ProtocolIncus) CreateNetworkForward(networkName string, forward api.NetworkForwardsPost) error
CreateNetworkForward defines a new network forward using the provided struct.
func (*ProtocolIncus) CreateNetworkIntegration ¶ added in v0.7.0
func (r *ProtocolIncus) CreateNetworkIntegration(integration api.NetworkIntegrationsPost) error
CreateNetworkIntegration defines a new network integration using the provided struct. Returns true if the integration connection has been mutually created. Returns false if integrationing has been only initiated.
func (*ProtocolIncus) CreateNetworkLoadBalancer ¶
func (r *ProtocolIncus) CreateNetworkLoadBalancer(networkName string, loadBalancer api.NetworkLoadBalancersPost) error
CreateNetworkLoadBalancer defines a new network load balancer using the provided struct.
func (*ProtocolIncus) CreateNetworkPeer ¶
func (r *ProtocolIncus) CreateNetworkPeer(networkName string, peer api.NetworkPeersPost) error
CreateNetworkPeer defines a new network peer using the provided struct. Returns true if the peer connection has been mutually created. Returns false if peering has been only initiated.
func (*ProtocolIncus) CreateNetworkZone ¶
func (r *ProtocolIncus) CreateNetworkZone(zone api.NetworkZonesPost) error
CreateNetworkZone defines a new Network zone using the provided struct.
func (*ProtocolIncus) CreateNetworkZoneRecord ¶
func (r *ProtocolIncus) CreateNetworkZoneRecord(zone string, record api.NetworkZoneRecordsPost) error
CreateNetworkZoneRecord defines a new Network zone record using the provided struct.
func (*ProtocolIncus) CreateProfile ¶
func (r *ProtocolIncus) CreateProfile(profile api.ProfilesPost) error
CreateProfile defines a new instance profile.
func (*ProtocolIncus) CreateProject ¶
func (r *ProtocolIncus) CreateProject(project api.ProjectsPost) error
CreateProject defines a new project.
func (*ProtocolIncus) CreateStoragePool ¶
func (r *ProtocolIncus) CreateStoragePool(pool api.StoragePoolsPost) error
CreateStoragePool defines a new storage pool using the provided StoragePool struct.
func (*ProtocolIncus) CreateStoragePoolBucket ¶
func (r *ProtocolIncus) CreateStoragePoolBucket(poolName string, bucket api.StorageBucketsPost) (*api.StorageBucketKey, error)
CreateStoragePoolBucket defines a new storage bucket using the provided struct. If the server supports storage_buckets_create_credentials API extension, then this function will return the initial admin credentials. Otherwise it will be nil.
func (*ProtocolIncus) CreateStoragePoolBucketBackup ¶ added in v0.6.0
func (r *ProtocolIncus) CreateStoragePoolBucketBackup(poolName string, bucketName string, backup api.StorageBucketBackupsPost) (Operation, error)
CreateStoragePoolBucketBackup creates a new storage bucket backup.
func (*ProtocolIncus) CreateStoragePoolBucketFromBackup ¶ added in v0.6.0
func (r *ProtocolIncus) CreateStoragePoolBucketFromBackup(pool string, args StoragePoolBucketBackupArgs) (Operation, error)
CreateStoragePoolBucketFromBackup creates a new storage bucket from a backup.
func (*ProtocolIncus) CreateStoragePoolBucketKey ¶
func (r *ProtocolIncus) CreateStoragePoolBucketKey(poolName string, bucketName string, key api.StorageBucketKeysPost) (*api.StorageBucketKey, error)
CreateStoragePoolBucketKey adds a key to a storage bucket.
func (*ProtocolIncus) CreateStoragePoolVolume ¶
func (r *ProtocolIncus) CreateStoragePoolVolume(pool string, volume api.StorageVolumesPost) error
CreateStoragePoolVolume defines a new storage volume.
func (*ProtocolIncus) CreateStoragePoolVolumeBackup ¶
func (r *ProtocolIncus) CreateStoragePoolVolumeBackup(pool string, volName string, backup api.StoragePoolVolumeBackupsPost) (Operation, error)
CreateStoragePoolVolumeBackup creates new custom volume backup.
func (*ProtocolIncus) CreateStoragePoolVolumeFromBackup ¶
func (r *ProtocolIncus) CreateStoragePoolVolumeFromBackup(pool string, args StoragePoolVolumeBackupArgs) (Operation, error)
CreateStoragePoolVolumeFromBackup creates a custom volume from a backup file.
func (*ProtocolIncus) CreateStoragePoolVolumeFromISO ¶
func (r *ProtocolIncus) CreateStoragePoolVolumeFromISO(pool string, args StoragePoolVolumeBackupArgs) (Operation, error)
CreateStoragePoolVolumeFromISO creates a custom volume from an ISO file.
func (*ProtocolIncus) CreateStoragePoolVolumeSnapshot ¶
func (r *ProtocolIncus) CreateStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshot api.StorageVolumeSnapshotsPost) (Operation, error)
CreateStoragePoolVolumeSnapshot defines a new storage volume.
func (*ProtocolIncus) DeleteCertificate ¶
func (r *ProtocolIncus) DeleteCertificate(fingerprint string) error
DeleteCertificate removes a certificate from the Incus trust store.
func (*ProtocolIncus) DeleteClusterGroup ¶
func (r *ProtocolIncus) DeleteClusterGroup(name string) error
DeleteClusterGroup deletes an existing cluster group.
func (*ProtocolIncus) DeleteClusterMember ¶
func (r *ProtocolIncus) DeleteClusterMember(name string, force bool) error
DeleteClusterMember makes the given member leave the cluster (gracefully or not, depending on the force flag).
func (*ProtocolIncus) DeleteImage ¶
func (r *ProtocolIncus) DeleteImage(fingerprint string) (Operation, error)
DeleteImage requests that Incus removes an image from the store.
func (*ProtocolIncus) DeleteImageAlias ¶
func (r *ProtocolIncus) DeleteImageAlias(name string) error
DeleteImageAlias removes an alias from the Incus image store.
func (*ProtocolIncus) DeleteInstance ¶
func (r *ProtocolIncus) DeleteInstance(name string) (Operation, error)
DeleteInstance requests that Incus deletes the instance.
func (*ProtocolIncus) DeleteInstanceBackup ¶
func (r *ProtocolIncus) DeleteInstanceBackup(instanceName string, name string) (Operation, error)
DeleteInstanceBackup requests that Incus deletes the instance backup.
func (*ProtocolIncus) DeleteInstanceConsoleLog ¶
func (r *ProtocolIncus) DeleteInstanceConsoleLog(instanceName string, args *InstanceConsoleLogArgs) error
DeleteInstanceConsoleLog deletes the requested instance's console log.
func (*ProtocolIncus) DeleteInstanceFile ¶
func (r *ProtocolIncus) DeleteInstanceFile(instanceName string, filePath string) error
DeleteInstanceFile deletes a file in the instance.
func (*ProtocolIncus) DeleteInstanceLogfile ¶
func (r *ProtocolIncus) DeleteInstanceLogfile(name string, filename string) error
DeleteInstanceLogfile deletes the requested logfile.
func (*ProtocolIncus) DeleteInstanceSnapshot ¶
func (r *ProtocolIncus) DeleteInstanceSnapshot(instanceName string, name string) (Operation, error)
DeleteInstanceSnapshot requests that Incus deletes the instance snapshot.
func (*ProtocolIncus) DeleteInstanceTemplateFile ¶
func (r *ProtocolIncus) DeleteInstanceTemplateFile(name string, templateName string) error
DeleteInstanceTemplateFile deletes a template file for a instance.
func (*ProtocolIncus) DeleteNetwork ¶
func (r *ProtocolIncus) DeleteNetwork(name string) error
DeleteNetwork deletes an existing network.
func (*ProtocolIncus) DeleteNetworkACL ¶
func (r *ProtocolIncus) DeleteNetworkACL(name string) error
DeleteNetworkACL deletes an existing network ACL.
func (*ProtocolIncus) DeleteNetworkForward ¶
func (r *ProtocolIncus) DeleteNetworkForward(networkName string, listenAddress string) error
DeleteNetworkForward deletes an existing network forward.
func (*ProtocolIncus) DeleteNetworkIntegration ¶ added in v0.7.0
func (r *ProtocolIncus) DeleteNetworkIntegration(name string) error
DeleteNetworkIntegration deletes an existing network integration.
func (*ProtocolIncus) DeleteNetworkLoadBalancer ¶
func (r *ProtocolIncus) DeleteNetworkLoadBalancer(networkName string, listenAddress string) error
DeleteNetworkLoadBalancer deletes an existing network load balancer.
func (*ProtocolIncus) DeleteNetworkPeer ¶
func (r *ProtocolIncus) DeleteNetworkPeer(networkName string, peerName string) error
DeleteNetworkPeer deletes an existing network peer.
func (*ProtocolIncus) DeleteNetworkZone ¶
func (r *ProtocolIncus) DeleteNetworkZone(name string) error
DeleteNetworkZone deletes an existing network zone.
func (*ProtocolIncus) DeleteNetworkZoneRecord ¶
func (r *ProtocolIncus) DeleteNetworkZoneRecord(zone string, name string) error
DeleteNetworkZoneRecord deletes an existing network zone record.
func (*ProtocolIncus) DeleteOperation ¶
func (r *ProtocolIncus) DeleteOperation(uuid string) error
DeleteOperation deletes (cancels) a running operation.
func (*ProtocolIncus) DeleteProfile ¶
func (r *ProtocolIncus) DeleteProfile(name string) error
DeleteProfile deletes a profile.
func (*ProtocolIncus) DeleteProject ¶
func (r *ProtocolIncus) DeleteProject(name string) error
DeleteProject deletes a project.
func (*ProtocolIncus) DeleteStoragePool ¶
func (r *ProtocolIncus) DeleteStoragePool(name string) error
DeleteStoragePool deletes a storage pool.
func (*ProtocolIncus) DeleteStoragePoolBucket ¶
func (r *ProtocolIncus) DeleteStoragePoolBucket(poolName string, bucketName string) error
DeleteStoragePoolBucket deletes an existing storage bucket.
func (*ProtocolIncus) DeleteStoragePoolBucketBackup ¶ added in v0.6.0
func (r *ProtocolIncus) DeleteStoragePoolBucketBackup(pool string, bucketName string, name string) (Operation, error)
DeleteStoragePoolBucketBackup deletes an existing storage bucket backup.
func (*ProtocolIncus) DeleteStoragePoolBucketKey ¶
func (r *ProtocolIncus) DeleteStoragePoolBucketKey(poolName string, bucketName string, keyName string) error
DeleteStoragePoolBucketKey removes a key from a storage bucket.
func (*ProtocolIncus) DeleteStoragePoolVolume ¶
func (r *ProtocolIncus) DeleteStoragePoolVolume(pool string, volType string, name string) error
DeleteStoragePoolVolume deletes a storage pool.
func (*ProtocolIncus) DeleteStoragePoolVolumeBackup ¶
func (r *ProtocolIncus) DeleteStoragePoolVolumeBackup(pool string, volName string, name string) (Operation, error)
DeleteStoragePoolVolumeBackup deletes a custom volume backup.
func (*ProtocolIncus) DeleteStoragePoolVolumeSnapshot ¶
func (r *ProtocolIncus) DeleteStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string) (Operation, error)
DeleteStoragePoolVolumeSnapshot deletes a storage volume snapshot.
func (*ProtocolIncus) DeleteWarning ¶
func (r *ProtocolIncus) DeleteWarning(UUID string) error
DeleteWarning deletes the provided warning.
func (*ProtocolIncus) Disconnect ¶
func (r *ProtocolIncus) Disconnect()
Disconnect gets rid of any background goroutines.
func (*ProtocolIncus) ExecInstance ¶
func (r *ProtocolIncus) ExecInstance(instanceName string, exec api.InstanceExecPost, args *InstanceExecArgs) (Operation, error)
ExecInstance requests that Incus spawns a command inside the instance.
func (*ProtocolIncus) ExportImage ¶
func (r *ProtocolIncus) ExportImage(fingerprint string, image api.ImageExportPost) (Operation, error)
ExportImage exports (copies) an image to a remote server.
func (*ProtocolIncus) GetCertificate ¶
func (r *ProtocolIncus) GetCertificate(fingerprint string) (*api.Certificate, string, error)
GetCertificate returns the certificate entry for the provided fingerprint.
func (*ProtocolIncus) GetCertificateFingerprints ¶
func (r *ProtocolIncus) GetCertificateFingerprints() ([]string, error)
GetCertificateFingerprints returns a list of certificate fingerprints.
func (*ProtocolIncus) GetCertificates ¶
func (r *ProtocolIncus) GetCertificates() ([]api.Certificate, error)
GetCertificates returns a list of certificates.
func (*ProtocolIncus) GetCluster ¶
func (r *ProtocolIncus) GetCluster() (*api.Cluster, string, error)
GetCluster returns information about a cluster.
func (*ProtocolIncus) GetClusterGroup ¶
func (r *ProtocolIncus) GetClusterGroup(name string) (*api.ClusterGroup, string, error)
GetClusterGroup returns information about the given cluster group.
func (*ProtocolIncus) GetClusterGroupNames ¶
func (r *ProtocolIncus) GetClusterGroupNames() ([]string, error)
GetClusterGroupNames returns the cluster group names.
func (*ProtocolIncus) GetClusterGroups ¶
func (r *ProtocolIncus) GetClusterGroups() ([]api.ClusterGroup, error)
GetClusterGroups returns the cluster groups.
func (*ProtocolIncus) GetClusterMember ¶
func (r *ProtocolIncus) GetClusterMember(name string) (*api.ClusterMember, string, error)
GetClusterMember returns information about the given member.
func (*ProtocolIncus) GetClusterMemberNames ¶
func (r *ProtocolIncus) GetClusterMemberNames() ([]string, error)
GetClusterMemberNames returns the URLs of the current members in the cluster.
func (*ProtocolIncus) GetClusterMemberState ¶
func (r *ProtocolIncus) GetClusterMemberState(name string) (*api.ClusterMemberState, string, error)
GetClusterMemberState gets state information about a cluster member.
func (*ProtocolIncus) GetClusterMembers ¶
func (r *ProtocolIncus) GetClusterMembers() ([]api.ClusterMember, error)
GetClusterMembers returns the current members of the cluster.
func (*ProtocolIncus) GetConnectionInfo ¶
func (r *ProtocolIncus) GetConnectionInfo() (*ConnectionInfo, error)
GetConnectionInfo returns the basic connection information used to interact with the server.
func (*ProtocolIncus) GetEvents ¶
func (r *ProtocolIncus) GetEvents() (*EventListener, error)
GetEvents gets the events for the project defined on the client.
func (*ProtocolIncus) GetEventsAllProjects ¶
func (r *ProtocolIncus) GetEventsAllProjects() (*EventListener, error)
GetEventsAllProjects gets events for all projects.
func (*ProtocolIncus) GetHTTPClient ¶
func (r *ProtocolIncus) GetHTTPClient() (*http.Client, error)
GetHTTPClient returns the http client used for the connection. This can be used to set custom http options.
func (*ProtocolIncus) GetImageAlias ¶
func (r *ProtocolIncus) GetImageAlias(name string) (*api.ImageAliasesEntry, string, error)
GetImageAlias returns an existing alias as an ImageAliasesEntry struct.
func (*ProtocolIncus) GetImageAliasArchitectures ¶
func (r *ProtocolIncus) GetImageAliasArchitectures(imageType string, name string) (map[string]*api.ImageAliasesEntry, error)
GetImageAliasArchitectures returns a map of architectures / targets.
func (*ProtocolIncus) GetImageAliasNames ¶
func (r *ProtocolIncus) GetImageAliasNames() ([]string, error)
GetImageAliasNames returns the list of available alias names.
func (*ProtocolIncus) GetImageAliasType ¶
func (r *ProtocolIncus) GetImageAliasType(imageType string, name string) (*api.ImageAliasesEntry, string, error)
GetImageAliasType returns an existing alias as an ImageAliasesEntry struct.
func (*ProtocolIncus) GetImageAliases ¶
func (r *ProtocolIncus) GetImageAliases() ([]api.ImageAliasesEntry, error)
GetImageAliases returns the list of available aliases as ImageAliasesEntry structs.
func (*ProtocolIncus) GetImageFile ¶
func (r *ProtocolIncus) GetImageFile(fingerprint string, req ImageFileRequest) (*ImageFileResponse, error)
GetImageFile downloads an image from the server, returning an ImageFileRequest struct.
func (*ProtocolIncus) GetImageFingerprints ¶
func (r *ProtocolIncus) GetImageFingerprints() ([]string, error)
GetImageFingerprints returns a list of available image fingerprints.
func (*ProtocolIncus) GetImageSecret ¶
func (r *ProtocolIncus) GetImageSecret(fingerprint string) (string, error)
GetImageSecret is a helper around CreateImageSecret that returns a secret for the image.
func (*ProtocolIncus) GetImages ¶
func (r *ProtocolIncus) GetImages() ([]api.Image, error)
GetImages returns a list of available images as Image structs.
func (*ProtocolIncus) GetImagesAllProjects ¶ added in v0.6.0
func (r *ProtocolIncus) GetImagesAllProjects() ([]api.Image, error)
GetImagesAllProjects returns a list of images across all projects as Image structs.
func (*ProtocolIncus) GetImagesWithFilter ¶
func (r *ProtocolIncus) GetImagesWithFilter(filters []string) ([]api.Image, error)
GetImagesWithFilter returns a filtered list of available images as Image structs.
func (*ProtocolIncus) GetInstance ¶
GetInstance returns the instance entry for the provided name.
func (*ProtocolIncus) GetInstanceBackup ¶
func (r *ProtocolIncus) GetInstanceBackup(instanceName string, name string) (*api.InstanceBackup, string, error)
GetInstanceBackup returns a Backup struct for the provided instance and backup names.
func (*ProtocolIncus) GetInstanceBackupFile ¶
func (r *ProtocolIncus) GetInstanceBackupFile(instanceName string, name string, req *BackupFileRequest) (*BackupFileResponse, error)
GetInstanceBackupFile requests the instance backup content.
func (*ProtocolIncus) GetInstanceBackupNames ¶
func (r *ProtocolIncus) GetInstanceBackupNames(instanceName string) ([]string, error)
GetInstanceBackupNames returns a list of backup names for the instance.
func (*ProtocolIncus) GetInstanceBackups ¶
func (r *ProtocolIncus) GetInstanceBackups(instanceName string) ([]api.InstanceBackup, error)
GetInstanceBackups returns a list of backups for the instance.
func (*ProtocolIncus) GetInstanceConsoleLog ¶
func (r *ProtocolIncus) GetInstanceConsoleLog(instanceName string, args *InstanceConsoleLogArgs) (io.ReadCloser, error)
GetInstanceConsoleLog requests that Incus attaches to the console device of a instance.
Note that it's the caller's responsibility to close the returned ReadCloser.
func (*ProtocolIncus) GetInstanceFile ¶
func (r *ProtocolIncus) GetInstanceFile(instanceName string, filePath string) (io.ReadCloser, *InstanceFileResponse, error)
GetInstanceFile retrieves the provided path from the instance.
func (*ProtocolIncus) GetInstanceFileSFTP ¶
func (r *ProtocolIncus) GetInstanceFileSFTP(instanceName string) (*sftp.Client, error)
GetInstanceFileSFTP returns an SFTP connection to the instance.
func (*ProtocolIncus) GetInstanceFileSFTPConn ¶
func (r *ProtocolIncus) GetInstanceFileSFTPConn(instanceName string) (net.Conn, error)
GetInstanceFileSFTPConn returns a connection to the instance's SFTP endpoint.
func (*ProtocolIncus) GetInstanceFull ¶
func (r *ProtocolIncus) GetInstanceFull(name string) (*api.InstanceFull, string, error)
GetInstanceFull returns the instance entry for the provided name along with snapshot information.
func (*ProtocolIncus) GetInstanceLogfile ¶
func (r *ProtocolIncus) GetInstanceLogfile(name string, filename string) (io.ReadCloser, error)
GetInstanceLogfile returns the content of the requested logfile.
Note that it's the caller's responsibility to close the returned ReadCloser.
func (*ProtocolIncus) GetInstanceLogfiles ¶
func (r *ProtocolIncus) GetInstanceLogfiles(name string) ([]string, error)
GetInstanceLogfiles returns a list of logfiles for the instance.
func (*ProtocolIncus) GetInstanceMetadata ¶
func (r *ProtocolIncus) GetInstanceMetadata(name string) (*api.ImageMetadata, string, error)
GetInstanceMetadata returns instance metadata.
func (*ProtocolIncus) GetInstanceNames ¶
func (r *ProtocolIncus) GetInstanceNames(instanceType api.InstanceType) ([]string, error)
GetInstanceNames returns a list of instance names.
func (*ProtocolIncus) GetInstanceNamesAllProjects ¶
func (r *ProtocolIncus) GetInstanceNamesAllProjects(instanceType api.InstanceType) (map[string][]string, error)
GetInstanceNamesAllProjects returns a list of instance names from all projects.
func (*ProtocolIncus) GetInstanceSnapshot ¶
func (r *ProtocolIncus) GetInstanceSnapshot(instanceName string, name string) (*api.InstanceSnapshot, string, error)
GetInstanceSnapshot returns a Snapshot struct for the provided instance and snapshot names.
func (*ProtocolIncus) GetInstanceSnapshotNames ¶
func (r *ProtocolIncus) GetInstanceSnapshotNames(instanceName string) ([]string, error)
GetInstanceSnapshotNames returns a list of snapshot names for the instance.
func (*ProtocolIncus) GetInstanceSnapshots ¶
func (r *ProtocolIncus) GetInstanceSnapshots(instanceName string) ([]api.InstanceSnapshot, error)
GetInstanceSnapshots returns a list of snapshots for the instance.
func (*ProtocolIncus) GetInstanceState ¶
func (r *ProtocolIncus) GetInstanceState(name string) (*api.InstanceState, string, error)
GetInstanceState returns a InstanceState entry for the provided instance name.
func (*ProtocolIncus) GetInstanceTemplateFile ¶
func (r *ProtocolIncus) GetInstanceTemplateFile(instanceName string, templateName string) (io.ReadCloser, error)
GetInstanceTemplateFile returns the content of a template file for a instance.
func (*ProtocolIncus) GetInstanceTemplateFiles ¶
func (r *ProtocolIncus) GetInstanceTemplateFiles(instanceName string) ([]string, error)
GetInstanceTemplateFiles returns the list of names of template files for a instance.
func (*ProtocolIncus) GetInstances ¶
func (r *ProtocolIncus) GetInstances(instanceType api.InstanceType) ([]api.Instance, error)
GetInstances returns a list of instances.
func (*ProtocolIncus) GetInstancesAllProjects ¶
func (r *ProtocolIncus) GetInstancesAllProjects(instanceType api.InstanceType) ([]api.Instance, error)
GetInstancesAllProjects returns a list of instances from all projects.
func (*ProtocolIncus) GetInstancesAllProjectsWithFilter ¶
func (r *ProtocolIncus) GetInstancesAllProjectsWithFilter(instanceType api.InstanceType, filters []string) ([]api.Instance, error)
GetInstancesAllProjectsWithFilter returns a filtered list of instances from all projects.
func (*ProtocolIncus) GetInstancesFull ¶
func (r *ProtocolIncus) GetInstancesFull(instanceType api.InstanceType) ([]api.InstanceFull, error)
GetInstancesFull returns a list of instances including snapshots, backups and state.
func (*ProtocolIncus) GetInstancesFullAllProjects ¶
func (r *ProtocolIncus) GetInstancesFullAllProjects(instanceType api.InstanceType) ([]api.InstanceFull, error)
GetInstancesFullAllProjects returns a list of instances including snapshots, backups and state from all projects.
func (*ProtocolIncus) GetInstancesFullAllProjectsWithFilter ¶
func (r *ProtocolIncus) GetInstancesFullAllProjectsWithFilter(instanceType api.InstanceType, filters []string) ([]api.InstanceFull, error)
GetInstancesFullAllProjectsWithFilter returns a filtered list of instances including snapshots, backups and state from all projects.
func (*ProtocolIncus) GetInstancesFullWithFilter ¶
func (r *ProtocolIncus) GetInstancesFullWithFilter(instanceType api.InstanceType, filters []string) ([]api.InstanceFull, error)
GetInstancesFullWithFilter returns a filtered list of instances including snapshots, backups and state.
func (*ProtocolIncus) GetInstancesWithFilter ¶
func (r *ProtocolIncus) GetInstancesWithFilter(instanceType api.InstanceType, filters []string) ([]api.Instance, error)
GetInstancesWithFilter returns a filtered list of instances.
func (*ProtocolIncus) GetMetadataConfiguration ¶ added in v0.7.0
func (r *ProtocolIncus) GetMetadataConfiguration() (*api.MetadataConfiguration, error)
GetMetadataConfiguration returns a configuration metadata struct.
func (*ProtocolIncus) GetMetrics ¶
func (r *ProtocolIncus) GetMetrics() (string, error)
GetMetrics returns the text OpenMetrics data.
func (*ProtocolIncus) GetNetwork ¶
GetNetwork returns a Network entry for the provided name.
func (*ProtocolIncus) GetNetworkACL ¶
func (r *ProtocolIncus) GetNetworkACL(name string) (*api.NetworkACL, string, error)
GetNetworkACL returns a Network ACL entry for the provided name.
func (*ProtocolIncus) GetNetworkACLLogfile ¶
func (r *ProtocolIncus) GetNetworkACLLogfile(name string) (io.ReadCloser, error)
GetNetworkACLLogfile returns a reader for the ACL log file.
Note that it's the caller's responsibility to close the returned ReadCloser.
func (*ProtocolIncus) GetNetworkACLNames ¶
func (r *ProtocolIncus) GetNetworkACLNames() ([]string, error)
GetNetworkACLNames returns a list of network ACL names.
func (*ProtocolIncus) GetNetworkACLs ¶
func (r *ProtocolIncus) GetNetworkACLs() ([]api.NetworkACL, error)
GetNetworkACLs returns a list of Network ACL structs.
func (*ProtocolIncus) GetNetworkAllocations ¶
func (r *ProtocolIncus) GetNetworkAllocations(allProjects bool) ([]api.NetworkAllocations, error)
GetNetworkAllocations returns a list of Network allocations tied to one or several projects (e.g, for IPAM information for example).
func (*ProtocolIncus) GetNetworkForward ¶
func (r *ProtocolIncus) GetNetworkForward(networkName string, listenAddress string) (*api.NetworkForward, string, error)
GetNetworkForward returns a Network forward entry for the provided network and listen address.
func (*ProtocolIncus) GetNetworkForwardAddresses ¶
func (r *ProtocolIncus) GetNetworkForwardAddresses(networkName string) ([]string, error)
GetNetworkForwardAddresses returns a list of network forward listen addresses.
func (*ProtocolIncus) GetNetworkForwards ¶
func (r *ProtocolIncus) GetNetworkForwards(networkName string) ([]api.NetworkForward, error)
GetNetworkForwards returns a list of Network forward structs.
func (*ProtocolIncus) GetNetworkIntegration ¶ added in v0.7.0
func (r *ProtocolIncus) GetNetworkIntegration(name string) (*api.NetworkIntegration, string, error)
GetNetworkIntegration returns a network integration entry.
func (*ProtocolIncus) GetNetworkIntegrationNames ¶ added in v0.7.0
func (r *ProtocolIncus) GetNetworkIntegrationNames() ([]string, error)
GetNetworkIntegrationNames returns a list of network integration names.
func (*ProtocolIncus) GetNetworkIntegrations ¶ added in v0.7.0
func (r *ProtocolIncus) GetNetworkIntegrations() ([]api.NetworkIntegration, error)
GetNetworkIntegrations returns a list of network integration structs.
func (*ProtocolIncus) GetNetworkLeases ¶
func (r *ProtocolIncus) GetNetworkLeases(name string) ([]api.NetworkLease, error)
GetNetworkLeases returns a list of Network struct.
func (*ProtocolIncus) GetNetworkLoadBalancer ¶
func (r *ProtocolIncus) GetNetworkLoadBalancer(networkName string, listenAddress string) (*api.NetworkLoadBalancer, string, error)
GetNetworkLoadBalancer returns a Network load balancer entry for the provided network and listen address.
func (*ProtocolIncus) GetNetworkLoadBalancerAddresses ¶
func (r *ProtocolIncus) GetNetworkLoadBalancerAddresses(networkName string) ([]string, error)
GetNetworkLoadBalancerAddresses returns a list of network load balancer listen addresses.
func (*ProtocolIncus) GetNetworkLoadBalancers ¶
func (r *ProtocolIncus) GetNetworkLoadBalancers(networkName string) ([]api.NetworkLoadBalancer, error)
GetNetworkLoadBalancers returns a list of Network load balancer structs.
func (*ProtocolIncus) GetNetworkNames ¶
func (r *ProtocolIncus) GetNetworkNames() ([]string, error)
GetNetworkNames returns a list of network names.
func (*ProtocolIncus) GetNetworkPeer ¶
func (r *ProtocolIncus) GetNetworkPeer(networkName string, peerName string) (*api.NetworkPeer, string, error)
GetNetworkPeer returns a network peer entry for the provided network and peer name.
func (*ProtocolIncus) GetNetworkPeerNames ¶
func (r *ProtocolIncus) GetNetworkPeerNames(networkName string) ([]string, error)
GetNetworkPeerNames returns a list of network peer names.
func (*ProtocolIncus) GetNetworkPeers ¶
func (r *ProtocolIncus) GetNetworkPeers(networkName string) ([]api.NetworkPeer, error)
GetNetworkPeers returns a list of network peer structs.
func (*ProtocolIncus) GetNetworkState ¶
func (r *ProtocolIncus) GetNetworkState(name string) (*api.NetworkState, error)
GetNetworkState returns metrics and information on the running network.
func (*ProtocolIncus) GetNetworkZone ¶
func (r *ProtocolIncus) GetNetworkZone(name string) (*api.NetworkZone, string, error)
GetNetworkZone returns a Network zone entry for the provided name.
func (*ProtocolIncus) GetNetworkZoneNames ¶
func (r *ProtocolIncus) GetNetworkZoneNames() ([]string, error)
GetNetworkZoneNames returns a list of network zone names.
func (*ProtocolIncus) GetNetworkZoneRecord ¶
func (r *ProtocolIncus) GetNetworkZoneRecord(zone string, name string) (*api.NetworkZoneRecord, string, error)
GetNetworkZoneRecord returns a Network zone record entry for the provided zone and name.
func (*ProtocolIncus) GetNetworkZoneRecordNames ¶
func (r *ProtocolIncus) GetNetworkZoneRecordNames(zone string) ([]string, error)
GetNetworkZoneRecordNames returns a list of network zone record names.
func (*ProtocolIncus) GetNetworkZoneRecords ¶
func (r *ProtocolIncus) GetNetworkZoneRecords(zone string) ([]api.NetworkZoneRecord, error)
GetNetworkZoneRecords returns a list of Network zone record structs.
func (*ProtocolIncus) GetNetworkZones ¶
func (r *ProtocolIncus) GetNetworkZones() ([]api.NetworkZone, error)
GetNetworkZones returns a list of Network zone structs.
func (*ProtocolIncus) GetNetworks ¶
func (r *ProtocolIncus) GetNetworks() ([]api.Network, error)
GetNetworks returns a list of Network struct.
func (*ProtocolIncus) GetOperation ¶
GetOperation returns an Operation entry for the provided uuid.
func (*ProtocolIncus) GetOperationUUIDs ¶
func (r *ProtocolIncus) GetOperationUUIDs() ([]string, error)
GetOperationUUIDs returns a list of operation uuids.
func (*ProtocolIncus) GetOperationWait ¶
GetOperationWait returns an Operation entry for the provided uuid once it's complete or hits the timeout.
func (*ProtocolIncus) GetOperationWaitSecret ¶
func (r *ProtocolIncus) GetOperationWaitSecret(uuid string, secret string, timeout int) (*api.Operation, string, error)
GetOperationWaitSecret returns an Operation entry for the provided uuid and secret once it's complete or hits the timeout.
func (*ProtocolIncus) GetOperationWebsocket ¶
GetOperationWebsocket returns a websocket connection for the provided operation.
func (*ProtocolIncus) GetOperations ¶
func (r *ProtocolIncus) GetOperations() ([]api.Operation, error)
GetOperations returns a list of Operation struct.
func (*ProtocolIncus) GetOperationsAllProjects ¶
func (r *ProtocolIncus) GetOperationsAllProjects() ([]api.Operation, error)
GetOperationsAllProjects returns a list of operations from all projects.
func (*ProtocolIncus) GetPrivateImage ¶
func (r *ProtocolIncus) GetPrivateImage(fingerprint string, secret string) (*api.Image, string, error)
GetPrivateImage is similar to GetImage but allows passing a secret download token.
func (*ProtocolIncus) GetPrivateImageFile ¶
func (r *ProtocolIncus) GetPrivateImageFile(fingerprint string, secret string, req ImageFileRequest) (*ImageFileResponse, error)
GetPrivateImageFile is similar to GetImageFile but allows passing a secret download token.
func (*ProtocolIncus) GetProfile ¶
GetProfile returns a Profile entry for the provided name.
func (*ProtocolIncus) GetProfileNames ¶
func (r *ProtocolIncus) GetProfileNames() ([]string, error)
GetProfileNames returns a list of available profile names.
func (*ProtocolIncus) GetProfiles ¶
func (r *ProtocolIncus) GetProfiles() ([]api.Profile, error)
GetProfiles returns a list of available Profile structs.
func (*ProtocolIncus) GetProject ¶
GetProject returns a Project entry for the provided name.
func (*ProtocolIncus) GetProjectNames ¶
func (r *ProtocolIncus) GetProjectNames() ([]string, error)
GetProjectNames returns a list of available project names.
func (*ProtocolIncus) GetProjectState ¶
func (r *ProtocolIncus) GetProjectState(name string) (*api.ProjectState, error)
GetProjectState returns a Project state for the provided name.
func (*ProtocolIncus) GetProjects ¶
func (r *ProtocolIncus) GetProjects() ([]api.Project, error)
GetProjects returns a list of available Project structs.
func (*ProtocolIncus) GetServer ¶
func (r *ProtocolIncus) GetServer() (*api.Server, string, error)
GetServer returns the server status as a Server struct.
func (*ProtocolIncus) GetServerResources ¶
func (r *ProtocolIncus) GetServerResources() (*api.Resources, error)
GetServerResources returns the resources available to a given Incus server.
func (*ProtocolIncus) GetStoragePool ¶
func (r *ProtocolIncus) GetStoragePool(name string) (*api.StoragePool, string, error)
GetStoragePool returns a StoragePool entry for the provided pool name.
func (*ProtocolIncus) GetStoragePoolBucket ¶
func (r *ProtocolIncus) GetStoragePoolBucket(poolName string, bucketName string) (*api.StorageBucket, string, error)
GetStoragePoolBucket returns a storage bucket entry for the provided pool and bucket name.
func (*ProtocolIncus) GetStoragePoolBucketBackupFile ¶ added in v0.6.0
func (r *ProtocolIncus) GetStoragePoolBucketBackupFile(pool string, bucketName string, name string, req *BackupFileRequest) (*BackupFileResponse, error)
GetStoragePoolBucketBackupFile returns the storage bucket file.
func (*ProtocolIncus) GetStoragePoolBucketKey ¶
func (r *ProtocolIncus) GetStoragePoolBucketKey(poolName string, bucketName string, keyName string) (*api.StorageBucketKey, string, error)
GetStoragePoolBucketKey returns a storage bucket key entry for the provided pool, bucket and key name.
func (*ProtocolIncus) GetStoragePoolBucketKeyNames ¶
func (r *ProtocolIncus) GetStoragePoolBucketKeyNames(poolName string, bucketName string) ([]string, error)
GetStoragePoolBucketKeyNames returns a list of storage bucket key names.
func (*ProtocolIncus) GetStoragePoolBucketKeys ¶
func (r *ProtocolIncus) GetStoragePoolBucketKeys(poolName string, bucketName string) ([]api.StorageBucketKey, error)
GetStoragePoolBucketKeys returns a list of storage bucket keys for the provided pool and bucket.
func (*ProtocolIncus) GetStoragePoolBucketNames ¶
func (r *ProtocolIncus) GetStoragePoolBucketNames(poolName string) ([]string, error)
GetStoragePoolBucketNames returns a list of storage bucket names.
func (*ProtocolIncus) GetStoragePoolBuckets ¶
func (r *ProtocolIncus) GetStoragePoolBuckets(poolName string) ([]api.StorageBucket, error)
GetStoragePoolBuckets returns a list of storage buckets for the provided pool.
func (*ProtocolIncus) GetStoragePoolNames ¶
func (r *ProtocolIncus) GetStoragePoolNames() ([]string, error)
GetStoragePoolNames returns the names of all storage pools.
func (*ProtocolIncus) GetStoragePoolResources ¶
func (r *ProtocolIncus) GetStoragePoolResources(name string) (*api.ResourcesStoragePool, error)
GetStoragePoolResources gets the resources available to a given storage pool.
func (*ProtocolIncus) GetStoragePoolVolume ¶
func (r *ProtocolIncus) GetStoragePoolVolume(pool string, volType string, name string) (*api.StorageVolume, string, error)
GetStoragePoolVolume returns a StorageVolume entry for the provided pool and volume name.
func (*ProtocolIncus) GetStoragePoolVolumeBackup ¶
func (r *ProtocolIncus) GetStoragePoolVolumeBackup(pool string, volName string, name string) (*api.StoragePoolVolumeBackup, string, error)
GetStoragePoolVolumeBackup returns a custom volume backup.
func (*ProtocolIncus) GetStoragePoolVolumeBackupFile ¶
func (r *ProtocolIncus) GetStoragePoolVolumeBackupFile(pool string, volName string, name string, req *BackupFileRequest) (*BackupFileResponse, error)
GetStoragePoolVolumeBackupFile requests the custom volume backup content.
func (*ProtocolIncus) GetStoragePoolVolumeBackupNames ¶
func (r *ProtocolIncus) GetStoragePoolVolumeBackupNames(pool string, volName string) ([]string, error)
GetStoragePoolVolumeBackupNames returns a list of volume backup names.
func (*ProtocolIncus) GetStoragePoolVolumeBackups ¶
func (r *ProtocolIncus) GetStoragePoolVolumeBackups(pool string, volName string) ([]api.StoragePoolVolumeBackup, error)
GetStoragePoolVolumeBackups returns a list of custom volume backups.
func (*ProtocolIncus) GetStoragePoolVolumeNames ¶
func (r *ProtocolIncus) GetStoragePoolVolumeNames(pool string) ([]string, error)
GetStoragePoolVolumeNames returns the names of all volumes in a pool.
func (*ProtocolIncus) GetStoragePoolVolumeNamesAllProjects ¶
func (r *ProtocolIncus) GetStoragePoolVolumeNamesAllProjects(pool string) (map[string][]string, error)
GetStoragePoolVolumeNamesAllProjects returns the names of all volumes in a pool for all projects.
func (*ProtocolIncus) GetStoragePoolVolumeSnapshot ¶
func (r *ProtocolIncus) GetStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string) (*api.StorageVolumeSnapshot, string, error)
GetStoragePoolVolumeSnapshot returns a snapshots for the storage volume.
func (*ProtocolIncus) GetStoragePoolVolumeSnapshotNames ¶
func (r *ProtocolIncus) GetStoragePoolVolumeSnapshotNames(pool string, volumeType string, volumeName string) ([]string, error)
GetStoragePoolVolumeSnapshotNames returns a list of snapshot names for the storage volume.
func (*ProtocolIncus) GetStoragePoolVolumeSnapshots ¶
func (r *ProtocolIncus) GetStoragePoolVolumeSnapshots(pool string, volumeType string, volumeName string) ([]api.StorageVolumeSnapshot, error)
GetStoragePoolVolumeSnapshots returns a list of snapshots for the storage volume.
func (*ProtocolIncus) GetStoragePoolVolumeState ¶
func (r *ProtocolIncus) GetStoragePoolVolumeState(pool string, volType string, name string) (*api.StorageVolumeState, error)
GetStoragePoolVolumeState returns a StorageVolumeState entry for the provided pool and volume name.
func (*ProtocolIncus) GetStoragePoolVolumes ¶
func (r *ProtocolIncus) GetStoragePoolVolumes(pool string) ([]api.StorageVolume, error)
GetStoragePoolVolumes returns a list of StorageVolume entries for the provided pool.
func (*ProtocolIncus) GetStoragePoolVolumesAllProjects ¶
func (r *ProtocolIncus) GetStoragePoolVolumesAllProjects(pool string) ([]api.StorageVolume, error)
GetStoragePoolVolumesAllProjects returns a list of StorageVolume entries for the provided pool for all projects.
func (*ProtocolIncus) GetStoragePoolVolumesWithFilter ¶
func (r *ProtocolIncus) GetStoragePoolVolumesWithFilter(pool string, filters []string) ([]api.StorageVolume, error)
GetStoragePoolVolumesWithFilter returns a filtered list of StorageVolume entries for the provided pool.
func (*ProtocolIncus) GetStoragePoolVolumesWithFilterAllProjects ¶
func (r *ProtocolIncus) GetStoragePoolVolumesWithFilterAllProjects(pool string, filters []string) ([]api.StorageVolume, error)
GetStoragePoolVolumesWithFilterAllProjects returns a filtered list of StorageVolume entries for the provided pool for all projects.
func (*ProtocolIncus) GetStoragePools ¶
func (r *ProtocolIncus) GetStoragePools() ([]api.StoragePool, error)
GetStoragePools returns a list of StoragePool entries.
func (*ProtocolIncus) GetWarning ¶
GetWarning returns the warning with the given UUID.
func (*ProtocolIncus) GetWarningUUIDs ¶
func (r *ProtocolIncus) GetWarningUUIDs() ([]string, error)
GetWarningUUIDs returns a list of operation uuids.
func (*ProtocolIncus) GetWarnings ¶
func (r *ProtocolIncus) GetWarnings() ([]api.Warning, error)
GetWarnings returns a list of warnings.
func (*ProtocolIncus) HasExtension ¶
func (r *ProtocolIncus) HasExtension(extension string) bool
HasExtension returns true if the server supports a given API extension. Deprecated: Use CheckExtension instead.
func (*ProtocolIncus) IsAgent ¶
func (r *ProtocolIncus) IsAgent() bool
IsAgent returns true if the server is an Incus agent.
func (*ProtocolIncus) IsClustered ¶
func (r *ProtocolIncus) IsClustered() bool
IsClustered returns true if the server is part of an Incus cluster.
func (*ProtocolIncus) MigrateInstance ¶
func (r *ProtocolIncus) MigrateInstance(name string, instance api.InstancePost) (Operation, error)
MigrateInstance requests that Incus prepares for a instance migration.
func (*ProtocolIncus) MigrateInstanceSnapshot ¶
func (r *ProtocolIncus) MigrateInstanceSnapshot(instanceName string, name string, instance api.InstanceSnapshotPost) (Operation, error)
MigrateInstanceSnapshot requests that Incus prepares for a snapshot migration.
func (*ProtocolIncus) MigrateStoragePoolVolume ¶
func (r *ProtocolIncus) MigrateStoragePoolVolume(pool string, volume api.StorageVolumePost) (Operation, error)
MigrateStoragePoolVolume requests that Incus prepares for a storage volume migration.
func (*ProtocolIncus) MoveStoragePoolVolume ¶
func (r *ProtocolIncus) MoveStoragePoolVolume(pool string, source InstanceServer, sourcePool string, volume api.StorageVolume, args *StoragePoolVolumeMoveArgs) (RemoteOperation, error)
MoveStoragePoolVolume renames or moves an existing storage volume.
func (*ProtocolIncus) RawOperation ¶
func (r *ProtocolIncus) RawOperation(method string, path string, data any, ETag string) (Operation, string, error)
RawOperation allows direct querying of an Incus API endpoint returning background operations.
func (*ProtocolIncus) RawQuery ¶
func (r *ProtocolIncus) RawQuery(method string, path string, data any, ETag string) (*api.Response, string, error)
RawQuery allows directly querying the Incus API
This should only be used by internal Incus tools.
func (*ProtocolIncus) RawWebsocket ¶
func (r *ProtocolIncus) RawWebsocket(path string) (*websocket.Conn, error)
RawWebsocket allows directly connection to Incus API websockets
This should only be used by internal Incus tools.
func (*ProtocolIncus) RebuildInstance ¶
func (r *ProtocolIncus) RebuildInstance(instanceName string, instance api.InstanceRebuildPost) (op Operation, err error)
RebuildInstance rebuilds an instance as empty.
func (*ProtocolIncus) RebuildInstanceFromImage ¶
func (r *ProtocolIncus) RebuildInstanceFromImage(source ImageServer, image api.Image, instanceName string, req api.InstanceRebuildPost) (RemoteOperation, error)
RebuildInstanceFromImage rebuilds an instance from an image.
func (*ProtocolIncus) RefreshImage ¶
func (r *ProtocolIncus) RefreshImage(fingerprint string) (Operation, error)
RefreshImage requests that Incus issues an image refresh.
func (*ProtocolIncus) RenameClusterGroup ¶
func (r *ProtocolIncus) RenameClusterGroup(name string, group api.ClusterGroupPost) error
RenameClusterGroup changes the name of an existing cluster group.
func (*ProtocolIncus) RenameClusterMember ¶
func (r *ProtocolIncus) RenameClusterMember(name string, member api.ClusterMemberPost) error
RenameClusterMember changes the name of an existing member.
func (*ProtocolIncus) RenameImageAlias ¶
func (r *ProtocolIncus) RenameImageAlias(name string, alias api.ImageAliasesEntryPost) error
RenameImageAlias renames an existing image alias.
func (*ProtocolIncus) RenameInstance ¶
func (r *ProtocolIncus) RenameInstance(name string, instance api.InstancePost) (Operation, error)
RenameInstance requests that Incus renames the instance.
func (*ProtocolIncus) RenameInstanceBackup ¶
func (r *ProtocolIncus) RenameInstanceBackup(instanceName string, name string, backup api.InstanceBackupPost) (Operation, error)
RenameInstanceBackup requests that Incus renames the backup.
func (*ProtocolIncus) RenameInstanceSnapshot ¶
func (r *ProtocolIncus) RenameInstanceSnapshot(instanceName string, name string, instance api.InstanceSnapshotPost) (Operation, error)
RenameInstanceSnapshot requests that Incus renames the snapshot.
func (*ProtocolIncus) RenameNetwork ¶
func (r *ProtocolIncus) RenameNetwork(name string, network api.NetworkPost) error
RenameNetwork renames an existing network entry.
func (*ProtocolIncus) RenameNetworkACL ¶
func (r *ProtocolIncus) RenameNetworkACL(name string, acl api.NetworkACLPost) error
RenameNetworkACL renames an existing network ACL entry.
func (*ProtocolIncus) RenameNetworkIntegration ¶ added in v0.7.0
func (r *ProtocolIncus) RenameNetworkIntegration(name string, network api.NetworkIntegrationPost) error
RenameNetworkIntegration renames an existing network integration entry.
func (*ProtocolIncus) RenameProfile ¶
func (r *ProtocolIncus) RenameProfile(name string, profile api.ProfilePost) error
RenameProfile renames an existing profile entry.
func (*ProtocolIncus) RenameProject ¶
func (r *ProtocolIncus) RenameProject(name string, project api.ProjectPost) (Operation, error)
RenameProject renames an existing project entry.
func (*ProtocolIncus) RenameStoragePoolVolume ¶
func (r *ProtocolIncus) RenameStoragePoolVolume(pool string, volType string, name string, volume api.StorageVolumePost) error
RenameStoragePoolVolume renames a storage volume.
func (*ProtocolIncus) RenameStoragePoolVolumeBackup ¶
func (r *ProtocolIncus) RenameStoragePoolVolumeBackup(pool string, volName string, name string, backup api.StoragePoolVolumeBackupPost) (Operation, error)
RenameStoragePoolVolumeBackup renames a custom volume backup.
func (*ProtocolIncus) RenameStoragePoolVolumeSnapshot ¶
func (r *ProtocolIncus) RenameStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string, snapshot api.StorageVolumeSnapshotPost) (Operation, error)
RenameStoragePoolVolumeSnapshot renames a storage volume snapshot.
func (*ProtocolIncus) RequireAuthenticated ¶
func (r *ProtocolIncus) RequireAuthenticated(authenticated bool)
RequireAuthenticated sets whether we expect to be authenticated with the server.
func (*ProtocolIncus) SendEvent ¶
func (r *ProtocolIncus) SendEvent(event api.Event) error
SendEvent send an event to the server via the client's event listener connection.
func (*ProtocolIncus) UpdateCertificate ¶
func (r *ProtocolIncus) UpdateCertificate(fingerprint string, certificate api.CertificatePut, ETag string) error
UpdateCertificate updates the certificate definition.
func (*ProtocolIncus) UpdateCluster ¶
func (r *ProtocolIncus) UpdateCluster(cluster api.ClusterPut, ETag string) (Operation, error)
UpdateCluster requests to bootstrap a new cluster or join an existing one.
func (*ProtocolIncus) UpdateClusterCertificate ¶
func (r *ProtocolIncus) UpdateClusterCertificate(certs api.ClusterCertificatePut, ETag string) error
UpdateClusterCertificate updates the cluster certificate for every node in the cluster.
func (*ProtocolIncus) UpdateClusterGroup ¶
func (r *ProtocolIncus) UpdateClusterGroup(name string, group api.ClusterGroupPut, ETag string) error
UpdateClusterGroup updates information about the given cluster group.
func (*ProtocolIncus) UpdateClusterMember ¶
func (r *ProtocolIncus) UpdateClusterMember(name string, member api.ClusterMemberPut, ETag string) error
UpdateClusterMember updates information about the given member.
func (*ProtocolIncus) UpdateClusterMemberState ¶
func (r *ProtocolIncus) UpdateClusterMemberState(name string, state api.ClusterMemberStatePost) (Operation, error)
UpdateClusterMemberState evacuates or restores a cluster member.
func (*ProtocolIncus) UpdateImage ¶
UpdateImage updates the image definition.
func (*ProtocolIncus) UpdateImageAlias ¶
func (r *ProtocolIncus) UpdateImageAlias(name string, alias api.ImageAliasesEntryPut, ETag string) error
UpdateImageAlias updates the image alias definition.
func (*ProtocolIncus) UpdateInstance ¶
func (r *ProtocolIncus) UpdateInstance(name string, instance api.InstancePut, ETag string) (Operation, error)
UpdateInstance updates the instance definition.
func (*ProtocolIncus) UpdateInstanceMetadata ¶
func (r *ProtocolIncus) UpdateInstanceMetadata(name string, metadata api.ImageMetadata, ETag string) error
UpdateInstanceMetadata sets the content of the instance metadata file.
func (*ProtocolIncus) UpdateInstanceSnapshot ¶
func (r *ProtocolIncus) UpdateInstanceSnapshot(instanceName string, name string, instance api.InstanceSnapshotPut, ETag string) (Operation, error)
UpdateInstanceSnapshot requests that Incus updates the instance snapshot.
func (*ProtocolIncus) UpdateInstanceState ¶
func (r *ProtocolIncus) UpdateInstanceState(name string, state api.InstanceStatePut, ETag string) (Operation, error)
UpdateInstanceState updates the instance to match the requested state.
func (*ProtocolIncus) UpdateInstances ¶
func (r *ProtocolIncus) UpdateInstances(state api.InstancesPut, ETag string) (Operation, error)
UpdateInstances updates all instances to match the requested state.
func (*ProtocolIncus) UpdateNetwork ¶
func (r *ProtocolIncus) UpdateNetwork(name string, network api.NetworkPut, ETag string) error
UpdateNetwork updates the network to match the provided Network struct.
func (*ProtocolIncus) UpdateNetworkACL ¶
func (r *ProtocolIncus) UpdateNetworkACL(name string, acl api.NetworkACLPut, ETag string) error
UpdateNetworkACL updates the network ACL to match the provided struct.
func (*ProtocolIncus) UpdateNetworkForward ¶
func (r *ProtocolIncus) UpdateNetworkForward(networkName string, listenAddress string, forward api.NetworkForwardPut, ETag string) error
UpdateNetworkForward updates the network forward to match the provided struct.
func (*ProtocolIncus) UpdateNetworkIntegration ¶ added in v0.7.0
func (r *ProtocolIncus) UpdateNetworkIntegration(name string, integration api.NetworkIntegrationPut, ETag string) error
UpdateNetworkIntegration updates the network integration to match the provided struct.
func (*ProtocolIncus) UpdateNetworkLoadBalancer ¶
func (r *ProtocolIncus) UpdateNetworkLoadBalancer(networkName string, listenAddress string, loadBalancer api.NetworkLoadBalancerPut, ETag string) error
UpdateNetworkLoadBalancer updates the network load balancer to match the provided struct.
func (*ProtocolIncus) UpdateNetworkPeer ¶
func (r *ProtocolIncus) UpdateNetworkPeer(networkName string, peerName string, peer api.NetworkPeerPut, ETag string) error
UpdateNetworkPeer updates the network peer to match the provided struct.
func (*ProtocolIncus) UpdateNetworkZone ¶
func (r *ProtocolIncus) UpdateNetworkZone(name string, zone api.NetworkZonePut, ETag string) error
UpdateNetworkZone updates the network zone to match the provided struct.
func (*ProtocolIncus) UpdateNetworkZoneRecord ¶
func (r *ProtocolIncus) UpdateNetworkZoneRecord(zone string, name string, record api.NetworkZoneRecordPut, ETag string) error
UpdateNetworkZoneRecord updates the network zone record to match the provided struct.
func (*ProtocolIncus) UpdateProfile ¶
func (r *ProtocolIncus) UpdateProfile(name string, profile api.ProfilePut, ETag string) error
UpdateProfile updates the profile to match the provided Profile struct.
func (*ProtocolIncus) UpdateProject ¶
func (r *ProtocolIncus) UpdateProject(name string, project api.ProjectPut, ETag string) error
UpdateProject updates the project to match the provided Project struct.
func (*ProtocolIncus) UpdateServer ¶
func (r *ProtocolIncus) UpdateServer(server api.ServerPut, ETag string) error
UpdateServer updates the server status to match the provided Server struct.
func (*ProtocolIncus) UpdateStoragePool ¶
func (r *ProtocolIncus) UpdateStoragePool(name string, pool api.StoragePoolPut, ETag string) error
UpdateStoragePool updates the pool to match the provided StoragePool struct.
func (*ProtocolIncus) UpdateStoragePoolBucket ¶
func (r *ProtocolIncus) UpdateStoragePoolBucket(poolName string, bucketName string, bucket api.StorageBucketPut, ETag string) error
UpdateStoragePoolBucket updates the storage bucket to match the provided struct.
func (*ProtocolIncus) UpdateStoragePoolBucketKey ¶
func (r *ProtocolIncus) UpdateStoragePoolBucketKey(poolName string, bucketName string, keyName string, key api.StorageBucketKeyPut, ETag string) error
UpdateStoragePoolBucketKey updates an existing storage bucket key.
func (*ProtocolIncus) UpdateStoragePoolVolume ¶
func (r *ProtocolIncus) UpdateStoragePoolVolume(pool string, volType string, name string, volume api.StorageVolumePut, ETag string) error
UpdateStoragePoolVolume updates the volume to match the provided StoragePoolVolume struct.
func (*ProtocolIncus) UpdateStoragePoolVolumeSnapshot ¶
func (r *ProtocolIncus) UpdateStoragePoolVolumeSnapshot(pool string, volumeType string, volumeName string, snapshotName string, volume api.StorageVolumeSnapshotPut, ETag string) error
UpdateStoragePoolVolumeSnapshot updates the volume to match the provided StoragePoolVolume struct.
func (*ProtocolIncus) UpdateWarning ¶
func (r *ProtocolIncus) UpdateWarning(UUID string, warning api.WarningPut, ETag string) error
UpdateWarning updates the warning with the given UUID.
func (*ProtocolIncus) UseProject ¶
func (r *ProtocolIncus) UseProject(name string) InstanceServer
UseProject returns a client that will use a specific project.
func (*ProtocolIncus) UseTarget ¶
func (r *ProtocolIncus) UseTarget(name string) InstanceServer
UseTarget returns a client that will target a specific cluster member. Use this member-specific operations such as specific container placement, preparing a new storage pool or network, ...
func (*ProtocolIncus) WithContext ¶
func (r *ProtocolIncus) WithContext(ctx context.Context) InstanceServer
WithContext returns a client that will add context.Context.
type ProtocolSimpleStreams ¶
type ProtocolSimpleStreams struct {
// contains filtered or unexported fields
}
ProtocolSimpleStreams implements a SimpleStreams API client.
func (*ProtocolSimpleStreams) Disconnect ¶
func (r *ProtocolSimpleStreams) Disconnect()
Disconnect is a no-op for simplestreams.
func (*ProtocolSimpleStreams) ExportImage ¶
func (r *ProtocolSimpleStreams) ExportImage(fingerprint string, image api.ImageExportPost) (Operation, error)
ExportImage exports (copies) an image to a remote server.
func (*ProtocolSimpleStreams) GetConnectionInfo ¶
func (r *ProtocolSimpleStreams) GetConnectionInfo() (*ConnectionInfo, error)
GetConnectionInfo returns the basic connection information used to interact with the server.
func (*ProtocolSimpleStreams) GetHTTPClient ¶
func (r *ProtocolSimpleStreams) GetHTTPClient() (*http.Client, error)
GetHTTPClient returns the http client used for the connection. This can be used to set custom http options.
func (*ProtocolSimpleStreams) GetImage ¶
GetImage returns an Image struct for the provided fingerprint.
func (*ProtocolSimpleStreams) GetImageAlias ¶
func (r *ProtocolSimpleStreams) GetImageAlias(name string) (*api.ImageAliasesEntry, string, error)
GetImageAlias returns an existing alias as an ImageAliasesEntry struct.
func (*ProtocolSimpleStreams) GetImageAliasArchitectures ¶
func (r *ProtocolSimpleStreams) GetImageAliasArchitectures(imageType string, name string) (map[string]*api.ImageAliasesEntry, error)
GetImageAliasArchitectures returns a map of architectures / targets.
func (*ProtocolSimpleStreams) GetImageAliasNames ¶
func (r *ProtocolSimpleStreams) GetImageAliasNames() ([]string, error)
GetImageAliasNames returns the list of available alias names.
func (*ProtocolSimpleStreams) GetImageAliasType ¶
func (r *ProtocolSimpleStreams) GetImageAliasType(imageType string, name string) (*api.ImageAliasesEntry, string, error)
GetImageAliasType returns an existing alias as an ImageAliasesEntry struct.
func (*ProtocolSimpleStreams) GetImageAliases ¶
func (r *ProtocolSimpleStreams) GetImageAliases() ([]api.ImageAliasesEntry, error)
GetImageAliases returns the list of available aliases as ImageAliasesEntry structs.
func (*ProtocolSimpleStreams) GetImageFile ¶
func (r *ProtocolSimpleStreams) GetImageFile(fingerprint string, req ImageFileRequest) (*ImageFileResponse, error)
GetImageFile downloads an image from the server, returning an ImageFileResponse struct.
func (*ProtocolSimpleStreams) GetImageFingerprints ¶
func (r *ProtocolSimpleStreams) GetImageFingerprints() ([]string, error)
GetImageFingerprints returns a list of available image fingerprints.
func (*ProtocolSimpleStreams) GetImageSecret ¶
func (r *ProtocolSimpleStreams) GetImageSecret(fingerprint string) (string, error)
GetImageSecret isn't relevant for the simplestreams protocol.
func (*ProtocolSimpleStreams) GetImages ¶
func (r *ProtocolSimpleStreams) GetImages() ([]api.Image, error)
GetImages returns a list of available images as Image structs.
func (*ProtocolSimpleStreams) GetImagesAllProjects ¶ added in v0.6.0
func (r *ProtocolSimpleStreams) GetImagesAllProjects() ([]api.Image, error)
GetImagesAllProjects returns a list of available images as Image structs.
func (*ProtocolSimpleStreams) GetImagesWithFilter ¶
func (r *ProtocolSimpleStreams) GetImagesWithFilter(filters []string) ([]api.Image, error)
GetImagesWithFilter returns a filtered list of available images as Image structs.
func (*ProtocolSimpleStreams) GetPrivateImage ¶
func (r *ProtocolSimpleStreams) GetPrivateImage(fingerprint string, secret string) (*api.Image, string, error)
GetPrivateImage isn't relevant for the simplestreams protocol.
func (*ProtocolSimpleStreams) GetPrivateImageFile ¶
func (r *ProtocolSimpleStreams) GetPrivateImageFile(fingerprint string, secret string, req ImageFileRequest) (*ImageFileResponse, error)
GetPrivateImageFile isn't relevant for the simplestreams protocol.
type RemoteOperation ¶
type RemoteOperation interface { AddHandler(function func(api.Operation)) (target *EventTarget, err error) CancelTarget() (err error) GetTarget() (op *api.Operation, err error) Wait() (err error) }
The RemoteOperation type represents an Operation that may be using multiple servers.
type Server ¶
type Server interface { GetConnectionInfo() (info *ConnectionInfo, err error) GetHTTPClient() (client *http.Client, err error) DoHTTP(req *http.Request) (resp *http.Response, err error) Disconnect() }
The Server type represents a generic read-only server.
type StoragePoolBucketBackupArgs ¶ added in v0.6.0
type StoragePoolBucketBackupArgs struct { // The backup file BackupFile io.Reader // Name to import backup as Name string }
The StoragePoolBucketBackupArgs struct is used when creating a storage volume from a backup. API extension: storage_bucket_backup.
type StoragePoolVolumeBackupArgs ¶
type StoragePoolVolumeBackupArgs struct { // The backup file BackupFile io.Reader // Name to import backup as Name string }
The StoragePoolVolumeBackupArgs struct is used when creating a storage volume from a backup. API extension: custom_volume_backup.
type StoragePoolVolumeCopyArgs ¶
type StoragePoolVolumeCopyArgs struct { // New name for the target Name string // The transfer mode, can be "pull" (default), "push" or "relay" Mode string // API extension: storage_api_volume_snapshots VolumeOnly bool // API extension: custom_volume_refresh Refresh bool }
The StoragePoolVolumeCopyArgs struct is used to pass additional options during storage volume copy.
type StoragePoolVolumeMoveArgs ¶
type StoragePoolVolumeMoveArgs struct { StoragePoolVolumeCopyArgs // API extension: storage_volume_project_move Project string }
The StoragePoolVolumeMoveArgs struct is used to pass additional options during storage volume move.
Source Files ¶
- connection.go
- doc.go
- events.go
- incus.go
- incus_certificates.go
- incus_cluster.go
- incus_events.go
- incus_images.go
- incus_instances.go
- incus_metadata.go
- incus_network_acls.go
- incus_network_allocations.go
- incus_network_forwards.go
- incus_network_integrations.go
- incus_network_load_balancers.go
- incus_network_peers.go
- incus_network_zones.go
- incus_networks.go
- incus_oidc.go
- incus_operations.go
- incus_profiles.go
- incus_projects.go
- incus_server.go
- incus_storage_buckets.go
- incus_storage_pools.go
- incus_storage_volumes.go
- incus_warnings.go
- interfaces.go
- operations.go
- simplestreams.go
- simplestreams_images.go
- util.go