swagger: '2.0' info: contact: email: lxc-devel@lists.linuxcontainers.org name: Incus upstream url: https://github.com/lxc/incus description: 'This is the REST API used by all Incus clients. Internal endpoints aren''t included in this documentation. The Incus API is available over both a local unix+http and remote https API. Authentication for local users relies on group membership and access to the unix socket. For remote users, the default authentication method is TLS client certificates.' license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0 title: Incus external REST certificates instances API version: '1.0' tags: - name: instances paths: /1.0/instances: get: description: Returns a list of instances (URLs). operationId: instances_get parameters: - description: Project name example: default in: query name: project type: string - description: Collection filter example: default in: query name: filter type: string - description: Retrieve instances from all projects in: query name: all-projects type: boolean produces: - application/json responses: '200': description: API endpoints schema: description: Sync response properties: metadata: description: List of endpoints example: "[\n \"/1.0/instances/foo\",\n \"/1.0/instances/bar\"\n]" items: type: string type: array status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the instances tags: - instances post: consumes: - application/json description: 'Creates a new instance. Depending on the source, this can create an instance from an existing local image, remote image, existing local instance or snapshot, remote migration stream or backup file.' operationId: instances_post parameters: - description: Project name example: default in: query name: project type: string - description: Cluster member example: default in: query name: target type: string - description: Instance request in: body name: instance schema: $ref: '#/definitions/InstancesPost' - description: Raw backup file in: body name: raw_backup produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Create a new instance tags: - instances put: consumes: - application/json description: Changes the running state of all instances. operationId: instances_put parameters: - description: Project name example: default in: query name: project type: string - description: State in: body name: state schema: $ref: '#/definitions/InstancesPut' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Bulk instance state update tags: - instances /1.0/instances/{name}: delete: description: 'Deletes a specific instance. This also deletes anything owned by the instance such as snapshots and backups.' operationId: instance_delete parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Delete an instance tags: - instances get: description: Gets a specific instance (basic struct). operationId: instance_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: Instance schema: description: Sync response properties: metadata: $ref: '#/definitions/Instance' status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the instance tags: - instances patch: consumes: - application/json description: Updates a subset of the instance configuration operationId: instance_patch parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Update request in: body name: instance schema: $ref: '#/definitions/InstancePut' produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Partially update the instance tags: - instances post: consumes: - application/json description: 'Renames, moves an instance between pools or migrates an instance to another server. The returned operation metadata will vary based on what''s requested. For rename or move within the same server, this is a simple background operation with progress data. For migration, in the push case, this will similarly be a background operation with progress data, for the pull case, it will be a websocket operation with a number of secrets to be passed to the target server.' operationId: instance_post parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Migration request in: body name: migration schema: $ref: '#/definitions/InstancePost' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Rename or move/migrate an instance tags: - instances put: consumes: - application/json description: Updates the instance configuration or trigger a snapshot restore. operationId: instance_put parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Update request in: body name: instance schema: $ref: '#/definitions/InstancePut' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Update the instance tags: - instances /1.0/instances/{name}/access: get: description: Gets the access information for the instance. operationId: instance_access parameters: - description: Instance name in: path name: name required: true type: string - description: Project name in: query name: project type: string produces: - application/json responses: '200': description: Access schema: description: Sync response properties: metadata: $ref: '#/definitions/Access' status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get who has access to an instance tags: - instances /1.0/instances/{name}/backups: get: description: Returns a list of instance backups (URLs). operationId: instance_backups_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: API endpoints schema: description: Sync response properties: metadata: description: List of endpoints example: "[\n \"/1.0/instances/foo/backups/backup0\",\n \"/1.0/instances/foo/backups/backup1\"\n]" items: type: string type: array status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the backups tags: - instances post: consumes: - application/json description: 'Creates a new backup. If the `Accept` header is set to `application/octet-stream`, this directly streams the backup tarball to the client without any intermediate operation.' operationId: instance_backups_post parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Backup request in: body name: backup schema: $ref: '#/definitions/InstanceBackupsPost' produces: - application/json - application/octet-stream responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Create a backup tags: - instances /1.0/instances/{name}/backups/{backup}: delete: consumes: - application/json description: Deletes the instance backup. operationId: instance_backup_delete parameters: - description: Instance name in: path name: name required: true type: string - description: Backup name in: path name: backup required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Delete a backup tags: - instances get: description: Gets a specific instance backup. operationId: instance_backup_get parameters: - description: Instance name in: path name: name required: true type: string - description: Backup name in: path name: backup required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: Instance backup schema: description: Sync response properties: metadata: $ref: '#/definitions/InstanceBackup' status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the backup tags: - instances post: consumes: - application/json description: Renames an instance backup. operationId: instance_backup_post parameters: - description: Instance name in: path name: name required: true type: string - description: Backup name in: path name: backup required: true type: string - description: Project name example: default in: query name: project type: string - description: Backup rename in: body name: backup schema: $ref: '#/definitions/InstanceBackupPost' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Rename a backup tags: - instances /1.0/instances/{name}/backups/{backup}/export: get: description: Download the raw backup file(s) from the server. operationId: instance_backup_export parameters: - description: Instance name in: path name: name required: true type: string - description: Backup name in: path name: backup required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/octet-stream responses: '200': description: Raw image data '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the raw backup file(s) tags: - instances /1.0/instances/{name}/backups?recursion=1: get: description: Returns a list of instance backups (structs). operationId: instance_backups_get_recursion1 parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: API endpoints schema: description: Sync response properties: metadata: description: List of instance backups items: $ref: '#/definitions/InstanceBackup' type: array status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the backups tags: - instances /1.0/instances/{name}/bitmaps: post: consumes: - application/json description: Creates a new bitmap. operationId: instance_bitmaps_post parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Bitmap request in: body name: bitmap schema: $ref: '#/definitions/StorageVolumeBitmapsPost' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Create a bitmap tags: - instances /1.0/instances/{name}/console: delete: description: Clears the console log buffer. operationId: instance_console_delete parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Clear the console log tags: - instances get: description: 'Gets the console output for the instance either as text log or as vga screendump.' operationId: instance_console_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - default: log description: Console type enum: - log - vga example: vga in: query name: type type: string produces: - application/json responses: '200': description: 'Console output either as raw console log or as vga screendump in PNG format depending on the `type` parameter provided with the request. ' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get console output tags: - instances post: consumes: - application/json description: 'Connects to the console of an instance. The returned operation metadata will contain two websockets, one for data and one for control.' operationId: instance_console_post parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Console request in: body name: console schema: $ref: '#/definitions/InstanceConsolePost' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Connect to console tags: - instances /1.0/instances/{name}/debug/memory: get: description: 'Returns memory debug information of a running instance. Only supported for VMs.' operationId: instance_debug_memory_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Memory dump format example: elf in: query name: format type: string responses: '200': description: Success '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get memory debug information of an instance tags: - instances /1.0/instances/{name}/debug/repair: get: description: Runs an internal repair action on the instance. operationId: instance_debug_repair_post parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: State in: body name: state schema: $ref: '#/definitions/InstanceDebugRepairPost' responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Trigger a repair action on the instance. tags: - instances /1.0/instances/{name}/exec: post: consumes: - application/json description: 'Executes a command inside an instance. The returned operation metadata will contain either 2 or 4 websockets. In non-interactive mode, you''ll get one websocket for each of stdin, stdout and stderr. In interactive mode, a single bi-directional websocket is used for stdin and stdout/stderr. An additional "control" socket is always added on top which can be used for out of band communications. This allows sending signals and window sizing information through.' operationId: instance_exec_post parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Exec request in: body name: exec schema: $ref: '#/definitions/InstanceExecPost' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Run a command tags: - instances /1.0/instances/{name}/files: delete: description: Removes the file. operationId: instance_files_delete parameters: - description: Instance name in: path name: name required: true type: string - description: Path to the file example: default in: query name: path type: string - description: Project name example: default in: query name: project type: string - description: Perform recursive deletion example: true in: header name: X-Incus-force schema: type: boolean produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Delete a file tags: - instances get: description: Gets the file content. If it's a directory, a json list of files will be returned instead. operationId: instance_files_get parameters: - description: Instance name in: path name: name required: true type: string - description: Path to the file example: default in: query name: path type: string - description: Project name example: default in: query name: project type: string produces: - application/json - application/octet-stream responses: '200': description: Raw file or directory listing headers: X-Incus-gid: description: File owner GID X-Incus-mode: description: Mode mask X-Incus-modified: description: Last modified date X-Incus-type: description: Type of file (file, symlink or directory) X-Incus-uid: description: File owner UID '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get a file tags: - instances head: description: Gets the file or directory metadata. operationId: instance_files_head parameters: - description: Instance name in: path name: name required: true type: string - description: Path to the file example: default in: query name: path type: string - description: Project name example: default in: query name: project type: string responses: '200': description: Raw file or directory listing headers: X-Incus-gid: description: File owner GID X-Incus-mode: description: Mode mask X-Incus-modified: description: Last modified date X-Incus-type: description: Type of file (file, symlink or directory) X-Incus-uid: description: File owner UID '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get metadata for a file tags: - instances post: consumes: - application/octet-stream description: Creates a new file in the instance. operationId: instance_files_post parameters: - description: Instance name in: path name: name required: true type: string - description: Path to the file example: default in: query name: path type: string - description: Project name example: default in: query name: project type: string - description: Raw file content in: body name: raw_file - description: File owner UID example: 1000 in: header name: X-Incus-uid schema: type: integer - description: File owner GID example: 1000 in: header name: X-Incus-gid schema: type: integer - description: File mode example: 420 in: header name: X-Incus-mode schema: type: integer - description: Type of file (file, symlink or directory) example: file in: header name: X-Incus-type schema: type: string - description: Write mode (overwrite or append) example: overwrite in: header name: X-Incus-write schema: type: string produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Create or replace a file tags: - instances /1.0/instances/{name}/logs: get: description: Returns a list of log files (URLs). operationId: instance_logs_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: API endpoints schema: description: Sync response properties: metadata: description: List of endpoints example: "[\n \"/1.0/instances/foo/logs/lxc.log\"\n]" items: type: string type: array status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get the log files tags: - instances /1.0/instances/{name}/logs/{filename}: delete: description: Removes the log file. operationId: instance_log_delete parameters: - description: Instance name in: path name: name required: true type: string - description: Log file name in: path name: filename required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Delete the log file tags: - instances get: description: Gets the log file. operationId: instance_log_get parameters: - description: Instance name in: path name: name required: true type: string - description: Log file name in: path name: filename required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json - application/octet-stream responses: '200': description: Raw file '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get the log file tags: - instances /1.0/instances/{name}/logs/exec-output: get: description: Returns a list of exec record-output files (URLs). operationId: instance_exec-outputs_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: API endpoints schema: description: Sync response properties: metadata: description: List of endpoints example: "[\n \"/1.0/instances/foo/logs/exec-output/exec_d0a89537-0617-4ed6-a79b-c2e88a970965.stdout\",\n \"/1.0/instances/foo/logs/exec-output/exec_d0a89537-0617-4ed6-a79b-c2e88a970965.stderr\",\n]" items: type: string type: array status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get the exec record-output files tags: - instances /1.0/instances/{name}/logs/exec-output/{filename}: delete: description: Removes the exec record-output file. operationId: instance_exec-output_delete parameters: - description: Instance name in: path name: name required: true type: string - description: Log file name in: path name: filename required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Delete the exec record-output file tags: - instances get: description: Gets the exec-output file. operationId: instance_exec-output_get parameters: - description: Instance name in: path name: name required: true type: string - description: Log file name in: path name: filename required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json - application/octet-stream responses: '200': description: Raw file '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get the exec-output log file tags: - instances /1.0/instances/{name}/metadata: get: description: Gets the image metadata for the instance. operationId: instance_metadata_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: Image metadata schema: description: Sync response properties: metadata: $ref: '#/definitions/ImageMetadata' status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the instance image metadata tags: - instances patch: consumes: - application/json description: Updates a subset of the instance image metadata. operationId: instance_metadata_patch parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Image metadata in: body name: metadata required: true schema: $ref: '#/definitions/ImageMetadata' produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '412': $ref: '#/responses/PreconditionFailed' '500': $ref: '#/responses/InternalServerError' summary: Partially update the image metadata tags: - instances put: consumes: - application/json description: Updates the instance image metadata. operationId: instance_metadata_put parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Image metadata in: body name: metadata required: true schema: $ref: '#/definitions/ImageMetadata' produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '412': $ref: '#/responses/PreconditionFailed' '500': $ref: '#/responses/InternalServerError' summary: Update the image metadata tags: - instances /1.0/instances/{name}/metadata/templates: delete: description: Removes the template file. operationId: instance_metadata_templates_delete parameters: - description: Instance name in: path name: name required: true type: string - description: Template name example: default in: query name: path type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Delete a template file tags: - instances get: description: 'If no path specified, returns a list of template file names. If a path is specified, returns the file content.' operationId: instance_metadata_templates_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Template name example: hostname.tpl in: query name: path type: string produces: - application/json - application/octet-stream responses: '200': description: Raw template file or file listing '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get the template file names or a specific tags: - instances post: consumes: - application/octet-stream description: Creates a new image template file for the instance. operationId: instance_metadata_templates_post parameters: - description: Instance name in: path name: name required: true type: string - description: Template name example: default in: query name: path type: string - description: Project name example: default in: query name: project type: string - description: Raw file content in: body name: raw_file produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Create or replace a template file tags: - instances /1.0/instances/{name}/rebuild: post: consumes: - application/octet-stream description: Rebuild an instance using an alternate image or as empty. operationId: instance_rebuild_post parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: InstanceRebuild request in: body name: instance required: true schema: $ref: '#/definitions/InstanceRebuildPost' produces: - application/json responses: '200': $ref: '#/responses/EmptySyncResponse' '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Rebuild an instance tags: - instances /1.0/instances/{name}/sftp: get: description: Upgrades the request to an SFTP connection of the instance's filesystem. operationId: instance_sftp parameters: - description: Instance name in: path name: name required: true type: string produces: - application/json - application/octet-stream responses: '101': description: Switching protocols to SFTP '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '404': $ref: '#/responses/NotFound' '500': $ref: '#/responses/InternalServerError' summary: Get the instance SFTP connection tags: - instances /1.0/instances/{name}/snapshots: get: description: Returns a list of instance snapshots (URLs). operationId: instance_snapshots_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: API endpoints schema: description: Sync response properties: metadata: description: List of endpoints example: "[\n \"/1.0/instances/foo/snapshots/snap0\",\n \"/1.0/instances/foo/snapshots/snap1\"\n]" items: type: string type: array status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the snapshots tags: - instances post: consumes: - application/json description: Creates a new snapshot. operationId: instance_snapshots_post parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: Snapshot request in: body name: snapshot schema: $ref: '#/definitions/InstanceSnapshotsPost' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Create a snapshot tags: - instances /1.0/instances/{name}/snapshots/{snapshot}: delete: consumes: - application/json description: Deletes the instance snapshot. operationId: instance_snapshot_delete parameters: - description: Instance name in: path name: name required: true type: string - description: Snapshot name in: path name: snapshot required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Delete a snapshot tags: - instances get: description: Gets a specific instance snapshot. operationId: instance_snapshot_get parameters: - description: Instance name in: path name: name required: true type: string - description: Snapshot name in: path name: snapshot required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: Instance snapshot schema: description: Sync response properties: metadata: $ref: '#/definitions/InstanceSnapshot' status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the snapshot tags: - instances patch: consumes: - application/json description: Updates a subset of the snapshot config. operationId: instance_snapshot_patch parameters: - description: Instance name in: path name: name required: true type: string - description: Snapshot name in: path name: snapshot required: true type: string - description: Project name example: default in: query name: project type: string - description: Snapshot update in: body name: snapshot schema: $ref: '#/definitions/InstanceSnapshotPut' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Partially update snapshot tags: - instances post: consumes: - application/json description: 'Renames or migrates an instance snapshot to another server. The returned operation metadata will vary based on what''s requested. For rename or move within the same server, this is a simple background operation with progress data. For migration, in the push case, this will similarly be a background operation with progress data, for the pull case, it will be a websocket operation with a number of secrets to be passed to the target server.' operationId: instance_snapshot_post parameters: - description: Instance name in: path name: name required: true type: string - description: Snapshot name in: path name: snapshot required: true type: string - description: Project name example: default in: query name: project type: string - description: Snapshot migration in: body name: snapshot schema: $ref: '#/definitions/InstanceSnapshotPost' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Rename or move/migrate a snapshot tags: - instances put: consumes: - application/json description: Updates the snapshot config. operationId: instance_snapshot_put parameters: - description: Instance name in: path name: name required: true type: string - description: Snapshot name in: path name: snapshot required: true type: string - description: Project name example: default in: query name: project type: string - description: Snapshot update in: body name: snapshot schema: $ref: '#/definitions/InstanceSnapshotPut' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Update snapshot tags: - instances /1.0/instances/{name}/snapshots?recursion=1: get: description: Returns a list of instance snapshots (structs). operationId: instance_snapshots_get_recursion1 parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: API endpoints schema: description: Sync response properties: metadata: description: List of instance snapshots items: $ref: '#/definitions/InstanceSnapshot' type: array status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the snapshots tags: - instances /1.0/instances/{name}/state: get: description: 'Gets the runtime state of the instance. This is a reasonably expensive call as it causes code to be run inside of the instance to retrieve the resource usage and network information.' operationId: instance_state_get parameters: - description: Instance name in: path name: name required: true type: string - description: Project name in: query name: project type: string produces: - application/json responses: '200': description: State schema: description: Sync response properties: metadata: $ref: '#/definitions/InstanceState' status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the runtime state tags: - instances put: consumes: - application/json description: Changes the running state of the instance. operationId: instance_state_put parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string - description: State in: body name: state schema: $ref: '#/definitions/InstanceStatePut' produces: - application/json responses: '202': $ref: '#/responses/Operation' '400': $ref: '#/responses/BadRequest' '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Change the state tags: - instances /1.0/instances/{name}?recursion=1: get: description: 'Gets a specific instance (full struct). recursion=1 also includes information about state, snapshots and backups.' operationId: instance_get_recursion1 parameters: - description: Instance name in: path name: name required: true type: string - description: Project name example: default in: query name: project type: string produces: - application/json responses: '200': description: Instance schema: description: Sync response properties: metadata: $ref: '#/definitions/InstanceFull' status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the instance tags: - instances /1.0/instances?recursion=1: get: description: Returns a list of instances (basic structs). operationId: instances_get_recursion1 parameters: - description: Project name example: default in: query name: project type: string - description: Collection filter example: default in: query name: filter type: string - description: Retrieve instances from all projects in: query name: all-projects type: boolean produces: - application/json responses: '200': description: API endpoints schema: description: Sync response properties: metadata: description: List of instances items: $ref: '#/definitions/Instance' type: array status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the instances tags: - instances /1.0/instances?recursion=2: get: description: 'Returns a list of instances (full structs). The main difference between recursion=1 and recursion=2 is that the latter also includes state and snapshot information allowing for a single API call to return everything needed by most clients.' operationId: instances_get_recursion2 parameters: - description: Project name example: default in: query name: project type: string - description: Collection filter example: default in: query name: filter type: string - description: Retrieve instances from all projects in: query name: all-projects type: boolean produces: - application/json responses: '200': description: API endpoints schema: description: Sync response properties: metadata: description: List of instances items: $ref: '#/definitions/InstanceFull' type: array status: description: Status description example: Success type: string status_code: description: Status code example: 200 type: integer type: description: Response type example: sync type: string type: object '403': $ref: '#/responses/Forbidden' '500': $ref: '#/responses/InternalServerError' summary: Get the instances tags: - instances definitions: StatusCode: format: int64 title: StatusCode represents a valid operation and container status. type: integer x-go-package: github.com/lxc/incus/v7/shared/api InstanceState: properties: cpu: $ref: '#/definitions/InstanceStateCPU' disk: additionalProperties: $ref: '#/definitions/InstanceStateDisk' description: Disk usage key/value pairs type: object x-go-name: Disk memory: $ref: '#/definitions/InstanceStateMemory' network: additionalProperties: $ref: '#/definitions/InstanceStateNetwork' description: Network usage key/value pairs type: object x-go-name: Network os_info: $ref: '#/definitions/InstanceStateOSInfo' pid: description: PID of the runtime example: 7281 format: int64 type: integer x-go-name: Pid processes: description: Number of processes in the instance example: 50 format: int64 type: integer x-go-name: Processes started_at: description: 'The time that the instance started at API extension: instance_state_started_at.' format: date-time type: string x-go-name: StartedAt status: description: Current status (Running, Stopped, Frozen or Error) example: Running type: string x-go-name: Status status_code: $ref: '#/definitions/StatusCode' title: InstanceState represents an instance's state. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceBackup: properties: created_at: description: When the backup was created example: '2021-03-23T16:38:37.753398689-04:00' format: date-time type: string x-go-name: CreatedAt expires_at: description: When the backup expires (gets auto-deleted) example: '2021-03-23T17:38:37.753398689-04:00' format: date-time type: string x-go-name: ExpiresAt instance_only: description: Whether to ignore snapshots example: false type: boolean x-go-name: InstanceOnly name: description: Backup name example: backup0 type: string x-go-name: Name optimized_storage: description: Whether to use a pool-optimized binary format (instead of plain tarball) example: true type: boolean x-go-name: OptimizedStorage title: InstanceBackup represents an instance backup. type: object x-go-package: github.com/lxc/incus/v7/shared/api Access: items: $ref: '#/definitions/AccessEntry' title: Access represents everyone that may access a particular resource. type: array x-go-package: github.com/lxc/incus/v7/shared/api BackupTarget: properties: access_key: description: AccessKey is the S3 API access key example: GOOG1234 type: string x-go-name: AccessKey bucket_name: description: BucketName is the name of the S3 bucket. example: my_bucket type: string x-go-name: BucketName path: description: Path is the target path. example: foo/test.tar type: string x-go-name: Path protocol: description: Protocol is the upload protocol. example: S3 type: string x-go-name: Protocol secret_key: description: SecretKey is the S3 API access key example: secret123 type: string x-go-name: SecretKey url: description: URL is the HTTPS URL for the backup example: https://storage.googleapis.com type: string x-go-name: URL title: BackupTarget represents the target storage server for an instance or volume backup. type: object x-go-package: github.com/lxc/incus/v7/shared/api StorageVolumeBitmapsPost: description: StorageVolumeBitmapsPost represents the fields available for a new volume bitmap properties: disabled: description: The bitmap is created in the disabled state example: false type: boolean x-go-name: Disabled granularity: description: Granularity of the dirty bitmap in bytes example: 32768 format: int64 type: integer x-go-name: Granularity name: description: Bitmap name example: bitmap0 type: string x-go-name: Name persistent: description: true if the bitmap was stored on disk, is scheduled to be stored on disk, or both example: false type: boolean x-go-name: Persistent type: object x-go-package: github.com/lxc/incus/v7/shared/api InstancePost: properties: Config: description: Instance configuration file. example: security.nesting: 'true' type: object Devices: description: Instance devices. example: root: path: / pool: default type: disk type: object Profiles: description: List of profiles applied to the instance. example: - default items: type: string type: array allow_inconsistent: description: AllowInconsistent allow inconsistent copies when migrating. example: false type: boolean x-go-name: AllowInconsistent instance_only: description: Whether snapshots should be discarded (migration only) example: false type: boolean x-go-name: InstanceOnly live: description: Whether to perform a live migration (migration only) example: false type: boolean x-go-name: Live migration: description: Whether the instance is being migrated to another server example: false type: boolean x-go-name: Migration name: description: New name for the instance example: bar type: string x-go-name: Name pool: description: Target pool for local cross-pool move example: baz type: string x-go-name: Pool project: description: Target project for local cross-project move example: foo type: string x-go-name: Project target: $ref: '#/definitions/InstancePostTarget' title: InstancePost represents the fields required to rename/move an instance. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceBackupsPost: properties: compression_algorithm: description: What compression algorithm to use example: gzip type: string x-go-name: CompressionAlgorithm expires_at: description: When the backup expires (gets auto-deleted) example: '2021-03-23T17:38:37.753398689-04:00' format: date-time type: string x-go-name: ExpiresAt instance_only: description: Whether to ignore snapshots example: false type: boolean x-go-name: InstanceOnly name: description: Backup name example: backup0 type: string x-go-name: Name optimized_storage: description: Whether to use a pool-optimized binary format (instead of plain tarball) example: true type: boolean x-go-name: OptimizedStorage root_only: description: Whether to ignore dependent volumes example: false type: boolean x-go-name: RootOnly target: $ref: '#/definitions/BackupTarget' title: InstanceBackupsPost represents the fields available for a new instance backup. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceType: title: InstanceType represents the type if instance being returned or requested via the API. type: string x-go-package: github.com/lxc/incus/v7/shared/api InstanceStateOSInfo: properties: fqdn: description: FQDN of the instance. example: myhost.mydomain.local type: string x-go-name: FQDN hostname: description: Hostname of the instance. example: myhost type: string x-go-name: Hostname kernel_version: description: Version of the kernel running in the instance. example: 6.1.0-25-amd64 type: string x-go-name: KernelVersion os: description: Operating system running in the instance. example: Debian GNU/Linux type: string x-go-name: OS os_version: description: Version of the operating system. example: 12 (bookworm) type: string x-go-name: OSVersion title: InstanceStateOSInfo represents the operating system information section of an instance's state. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceRebuildPost: properties: source: $ref: '#/definitions/InstanceSource' title: InstanceRebuildPost indicates how to rebuild an instance. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstancePut: properties: architecture: description: Architecture name example: x86_64 type: string x-go-name: Architecture config: description: Instance configuration (see doc/instances.md) example: security.nesting: 'true' type: object x-go-name: Config description: description: Instance description example: My test instance type: string x-go-name: Description devices: description: Instance devices (see doc/instances.md) example: root: path: / pool: default type: disk type: object x-go-name: Devices disk_only: description: Whether only the instances disk should be restored example: false type: boolean x-go-name: DiskOnly ephemeral: description: Whether the instance is ephemeral (deleted on shutdown) example: false type: boolean x-go-name: Ephemeral profiles: description: List of profiles applied to the instance example: - default items: type: string type: array x-go-name: Profiles restore: description: If set, instance will be restored to the provided snapshot name example: snap0 type: string x-go-name: Restore stateful: description: Whether the instance currently has saved state on disk example: false type: boolean x-go-name: Stateful title: InstancePut represents the modifiable fields of an instance. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceExecPost: properties: command: description: Command and its arguments example: - bash items: type: string type: array x-go-name: Command cwd: description: Current working directory for the command example: /home/foo/ type: string x-go-name: Cwd environment: additionalProperties: type: string description: Additional environment to pass to the command example: FOO: BAR type: object x-go-name: Environment group: description: GID of the user to spawn the command as example: 1000 format: uint32 type: integer x-go-name: Group height: description: Terminal height in rows (for interactive) example: 24 format: int64 type: integer x-go-name: Height interactive: description: Whether the command is to be spawned in interactive mode (singled PTY instead of 3 PIPEs) example: true type: boolean x-go-name: Interactive record-output: description: Whether to capture the output for later download (requires non-interactive) type: boolean x-go-name: RecordOutput user: description: UID of the user to spawn the command as example: 1000 format: uint32 type: integer x-go-name: User wait-for-websocket: description: Whether to wait for all websockets to be connected before spawning the command example: true type: boolean x-go-name: WaitForWS width: description: Terminal width in characters (for interactive) example: 80 format: int64 type: integer x-go-name: Width title: InstanceExecPost represents an instance exec request. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstancePostTarget: properties: certificate: description: The certificate of the migration target example: X509 PEM certificate type: string x-go-name: Certificate operation: description: The operation URL on the remote target example: https://1.2.3.4:8443/1.0/operations/5e8e1638-5345-4c2d-bac9-2c79c8577292 type: string x-go-name: Operation secrets: additionalProperties: type: string description: Migration websockets credentials example: criu: random-string migration: random-string type: object x-go-name: Websockets title: InstancePostTarget represents the migration target host and operation. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceStatePut: properties: action: description: State change action (start, stop, restart, freeze, unfreeze) example: start type: string x-go-name: Action force: description: Whether to force the action (for stop and restart) example: false type: boolean x-go-name: Force stateful: description: Whether to store the runtime state (for stop) example: false type: boolean x-go-name: Stateful timeout: description: How long to wait (in s) before giving up (when force isn't set) example: 30 format: int64 type: integer x-go-name: Timeout title: InstanceStatePut represents the modifiable fields of an instance's state. type: object x-go-package: github.com/lxc/incus/v7/shared/api Instance: properties: architecture: description: Architecture name example: x86_64 type: string x-go-name: Architecture config: description: Instance configuration (see doc/instances.md) example: security.nesting: 'true' type: object x-go-name: Config created_at: description: Instance creation timestamp example: '2021-03-23T20:00:00-04:00' format: date-time type: string x-go-name: CreatedAt description: description: Instance description example: My test instance type: string x-go-name: Description devices: description: Instance devices (see doc/instances.md) example: root: path: / pool: default type: disk type: object x-go-name: Devices disk_only: description: Whether only the instances disk should be restored example: false type: boolean x-go-name: DiskOnly ephemeral: description: Whether the instance is ephemeral (deleted on shutdown) example: false type: boolean x-go-name: Ephemeral expanded_config: description: Expanded configuration (all profiles and local config merged) example: security.nesting: 'true' type: object x-go-name: ExpandedConfig expanded_devices: description: Expanded devices (all profiles and local devices merged) example: root: path: / pool: default type: disk type: object x-go-name: ExpandedDevices last_used_at: description: Last start timestamp example: '2021-03-23T20:00:00-04:00' format: date-time type: string x-go-name: LastUsedAt location: description: What cluster member this instance is located on example: server01 type: string x-go-name: Location name: description: Instance name example: foo type: string x-go-name: Name profiles: description: List of profiles applied to the instance example: - default items: type: string type: array x-go-name: Profiles project: description: Instance project name example: foo type: string x-go-name: Project restore: description: If set, instance will be restored to the provided snapshot name example: snap0 type: string x-go-name: Restore stateful: description: Whether the instance currently has saved state on disk example: false type: boolean x-go-name: Stateful status: description: Instance status (see instance_state) example: Running type: string x-go-name: Status status_code: $ref: '#/definitions/StatusCode' type: description: The type of instance (container or virtual-machine) example: container type: string x-go-name: Type title: Instance represents an instance. type: object x-go-package: github.com/lxc/incus/v7/shared/api AccessEntry: properties: identifier: description: Certificate fingerprint example: 636b69519d27ae3b0e398cb7928043846ce1e3842f0ca7a589993dd913ab8cc9 type: string x-go-name: Identifier provider: description: Which authorization method the certificate uses example: tls, openfga type: string x-go-name: Provider role: description: The role associated with the certificate example: admin, view, operator type: string x-go-name: Role title: AccessEntry represents an entity having access to the resource. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceStateNetworkAddress: description: 'InstanceStateNetworkAddress represents a network address as part of the network section of an instance''s state.' properties: address: description: IP address example: fd42:4c81:5770:1eaf:1266:6aff:fe0c:eedd type: string x-go-name: Address family: description: Network family (inet or inet6) example: inet6 type: string x-go-name: Family netmask: description: Network mask example: '64' type: string x-go-name: Netmask scope: description: Address scope (local, link or global) example: global type: string x-go-name: Scope type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceSource: properties: alias: description: Image alias name (for image source) example: ubuntu/22.04 type: string x-go-name: Alias allow_inconsistent: description: Whether to ignore errors when copying (e.g. for volatile files) example: false type: boolean x-go-name: AllowInconsistent base-image: description: Base image fingerprint (for faster migration) example: ed56997f7c5b48e8d78986d2467a26109be6fb9f2d92e8c7b08eb8b6cec7629a type: string x-go-name: BaseImage certificate: description: Certificate (for remote images or migration) example: X509 PEM certificate type: string x-go-name: Certificate fingerprint: description: Image fingerprint (for image source) example: ed56997f7c5b48e8d78986d2467a26109be6fb9f2d92e8c7b08eb8b6cec7629a type: string x-go-name: Fingerprint instance_only: description: Whether the copy should skip the snapshots (for copy) example: false type: boolean x-go-name: InstanceOnly live: description: Whether this is a live migration (for migration) example: false type: boolean x-go-name: Live mode: description: Whether to use pull or push mode (for migration) example: pull type: string x-go-name: Mode operation: description: Remote operation URL (for migration) example: https://1.2.3.4:8443/1.0/operations/1721ae08-b6a8-416a-9614-3f89302466e1 type: string x-go-name: Operation project: description: Source project name (for copy and local image) example: blah type: string x-go-name: Project properties: additionalProperties: type: string description: Image filters (for image source) example: os: Ubuntu release: jammy variant: cloud type: object x-go-name: Properties protocol: description: Protocol name (for remote image) example: simplestreams type: string x-go-name: Protocol refresh: description: Whether this is refreshing an existing instance (for migration and copy) example: false type: boolean x-go-name: Refresh refresh_exclude_older: description: Whether to exclude source snapshots earlier than latest target snapshot example: false type: boolean x-go-name: RefreshExcludeOlder secret: description: Remote server secret (for remote private images) example: RANDOM-STRING type: string x-go-name: Secret secrets: additionalProperties: type: string description: Map of migration websockets (for migration) example: criu: RANDOM-STRING rsync: RANDOM-STRING type: object x-go-name: Websockets server: description: Remote server URL (for remote images) example: https://images.linuxcontainers.org type: string x-go-name: Server source: description: Existing instance name or snapshot (for copy) example: foo/snap0 type: string x-go-name: Source type: description: Source type example: image type: string x-go-name: Type title: InstanceSource represents the creation source for a new instance. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceFull: properties: architecture: description: Architecture name example: x86_64 type: string x-go-name: Architecture backups: description: List of backups. items: $ref: '#/definitions/InstanceBackup' type: array x-go-name: Backups config: description: Instance configuration (see doc/instances.md) example: security.nesting: 'true' type: object x-go-name: Config created_at: description: Instance creation timestamp example: '2021-03-23T20:00:00-04:00' format: date-time type: string x-go-name: CreatedAt description: description: Instance description example: My test instance type: string x-go-name: Description devices: description: Instance devices (see doc/instances.md) example: root: path: / pool: default type: disk type: object x-go-name: Devices disk_only: description: Whether only the instances disk should be restored example: false type: boolean x-go-name: DiskOnly ephemeral: description: Whether the instance is ephemeral (deleted on shutdown) example: false type: boolean x-go-name: Ephemeral expanded_config: description: Expanded configuration (all profiles and local config merged) example: security.nesting: 'true' type: object x-go-name: ExpandedConfig expanded_devices: description: Expanded devices (all profiles and local devices merged) example: root: path: / pool: default type: disk type: object x-go-name: ExpandedDevices last_used_at: description: Last start timestamp example: '2021-03-23T20:00:00-04:00' format: date-time type: string x-go-name: LastUsedAt location: description: What cluster member this instance is located on example: server01 type: string x-go-name: Location name: description: Instance name example: foo type: string x-go-name: Name profiles: description: List of profiles applied to the instance example: - default items: type: string type: array x-go-name: Profiles project: description: Instance project name example: foo type: string x-go-name: Project restore: description: If set, instance will be restored to the provided snapshot name example: snap0 type: string x-go-name: Restore snapshots: description: List of snapshots. items: $ref: '#/definitions/InstanceSnapshot' type: array x-go-name: Snapshots state: $ref: '#/definitions/InstanceState' stateful: description: Whether the instance currently has saved state on disk example: false type: boolean x-go-name: Stateful status: description: Instance status (see instance_state) example: Running type: string x-go-name: Status status_code: $ref: '#/definitions/StatusCode' type: description: The type of instance (container or virtual-machine) example: container type: string x-go-name: Type title: InstanceFull is a combination of Instance, InstanceBackup, InstanceState and InstanceSnapshot. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstancesPut: properties: state: $ref: '#/definitions/InstanceStatePut' title: InstancesPut represents the fields available for a mass update. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceStateNetworkCounters: description: 'InstanceStateNetworkCounters represents packet counters as part of the network section of an instance''s state.' properties: bytes_received: description: Number of bytes received example: 192021 format: int64 type: integer x-go-name: BytesReceived bytes_sent: description: Number of bytes sent example: 10888579 format: int64 type: integer x-go-name: BytesSent errors_received: description: Number of errors received example: 14 format: int64 type: integer x-go-name: ErrorsReceived errors_sent: description: Number of errors sent example: 41 format: int64 type: integer x-go-name: ErrorsSent packets_dropped_inbound: description: Number of inbound packets dropped example: 179 format: int64 type: integer x-go-name: PacketsDroppedInbound packets_dropped_outbound: description: Number of outbound packets dropped example: 541 format: int64 type: integer x-go-name: PacketsDroppedOutbound packets_received: description: Number of packets received example: 1748 format: int64 type: integer x-go-name: PacketsReceived packets_sent: description: Number of packets sent example: 964 format: int64 type: integer x-go-name: PacketsSent type: object x-go-package: github.com/lxc/incus/v7/shared/api ImageMetadata: description: ImageMetadata represents image metadata (used in image tarball) properties: architecture: description: Architecture name example: x86_64 type: string x-go-name: Architecture creation_date: description: Image creation data (as UNIX epoch) example: 1620655439 format: int64 type: integer x-go-name: CreationDate expiry_date: description: Image expiry data (as UNIX epoch) example: 1620685757 format: int64 type: integer x-go-name: ExpiryDate properties: additionalProperties: type: string description: Descriptive properties example: os: Ubuntu release: jammy variant: cloud type: object x-go-name: Properties templates: additionalProperties: $ref: '#/definitions/ImageMetadataTemplate' description: Template for files in the image type: object x-go-name: Templates type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceBackupPost: properties: name: description: New backup name example: backup1 type: string x-go-name: Name title: InstanceBackupPost represents the fields available for the renaming of a instance backup. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceStateMemory: properties: swap_usage: description: SWAP usage in bytes example: 12297557 format: int64 type: integer x-go-name: SwapUsage swap_usage_peak: description: Peak SWAP usage in bytes example: 12297557 format: int64 type: integer x-go-name: SwapUsagePeak total: description: Total memory size in bytes example: 12297557 format: int64 type: integer x-go-name: Total usage: description: Memory usage in bytes example: 73248768 format: int64 type: integer x-go-name: Usage usage_peak: description: Peak memory usage in bytes example: 73785344 format: int64 type: integer x-go-name: UsagePeak title: InstanceStateMemory represents the memory information section of an instance's state. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceSnapshotsPost: properties: expires_at: description: When the snapshot expires (gets auto-deleted) example: '2021-03-23T17:38:37.753398689-04:00' format: date-time type: string x-go-name: ExpiresAt name: description: Snapshot name example: snap0 type: string x-go-name: Name stateful: description: Whether the snapshot should include runtime state example: false type: boolean x-go-name: Stateful title: InstanceSnapshotsPost represents the fields available for a new instance snapshot. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceSnapshotPut: properties: expires_at: description: When the snapshot expires (gets auto-deleted) example: '2021-03-23T17:38:37.753398689-04:00' format: date-time type: string x-go-name: ExpiresAt title: InstanceSnapshotPut represents the modifiable fields of an instance snapshot. type: object x-go-package: github.com/lxc/incus/v7/shared/api Operation: description: Operation represents a background operation properties: class: description: Type of operation (task, token or websocket) example: websocket type: string x-go-name: Class created_at: description: Operation creation time example: '2021-03-23T17:38:37.753398689-04:00' format: date-time type: string x-go-name: CreatedAt description: description: Description of the operation example: Executing command type: string x-go-name: Description err: description: Operation error message example: Some error message type: string x-go-name: Err id: description: UUID of the operation example: 6916c8a6-9b7d-4abd-90b3-aedfec7ec7da type: string x-go-name: ID location: description: What cluster member this record was found on example: server01 type: string x-go-name: Location may_cancel: description: Whether the operation can be canceled example: false type: boolean x-go-name: MayCancel metadata: additionalProperties: {} description: Operation specific metadata example: command: - bash environment: HOME: /root LANG: C.UTF-8 PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin TERM: xterm USER: root fds: '0': da3046cf02c0116febf4ef3fe4eaecdf308e720c05e5a9c730ce1a6f15417f66 '1': 05896879d8692607bd6e4a09475667da3b5f6714418ab0ee0e5720b4c57f754b interactive: true type: object x-go-name: Metadata resources: additionalProperties: items: type: string type: array description: Affected resources example: instances: - /1.0/instances/foo type: object x-go-name: Resources status: description: Status name example: Running type: string x-go-name: Status status_code: $ref: '#/definitions/StatusCode' updated_at: description: Operation last change example: '2021-03-23T17:38:37.753398689-04:00' format: date-time type: string x-go-name: UpdatedAt type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceStateNetwork: properties: addresses: description: List of IP addresses items: $ref: '#/definitions/InstanceStateNetworkAddress' type: array x-go-name: Addresses counters: $ref: '#/definitions/InstanceStateNetworkCounters' host_name: description: Name of the interface on the host example: vethbbcd39c7 type: string x-go-name: HostName hwaddr: description: MAC address example: 10:66:6a:0c:ee:dd type: string x-go-name: Hwaddr mtu: description: MTU (maximum transmit unit) for the interface example: 1500 format: int64 type: integer x-go-name: Mtu state: description: Administrative state of the interface (up/down) example: up type: string x-go-name: State type: description: Type of interface (broadcast, loopback, point-to-point, ...) example: broadcast type: string x-go-name: Type title: InstanceStateNetwork represents the network information section of an instance's state. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstancesPost: properties: architecture: description: Architecture name example: x86_64 type: string x-go-name: Architecture config: description: Instance configuration (see doc/instances.md) example: security.nesting: 'true' type: object x-go-name: Config description: description: Instance description example: My test instance type: string x-go-name: Description devices: description: Instance devices (see doc/instances.md) example: root: path: / pool: default type: disk type: object x-go-name: Devices disk_only: description: Whether only the instances disk should be restored example: false type: boolean x-go-name: DiskOnly ephemeral: description: Whether the instance is ephemeral (deleted on shutdown) example: false type: boolean x-go-name: Ephemeral instance_type: description: Cloud instance type (AWS, GCP, Azure, ...) to emulate with limits example: t1.micro type: string x-go-name: InstanceType name: description: Instance name example: foo type: string x-go-name: Name profiles: description: List of profiles applied to the instance example: - default items: type: string type: array x-go-name: Profiles restore: description: If set, instance will be restored to the provided snapshot name example: snap0 type: string x-go-name: Restore source: $ref: '#/definitions/InstanceSource' start: description: Whether to start the instance after creation example: true type: boolean x-go-name: Start stateful: description: Whether the instance currently has saved state on disk example: false type: boolean x-go-name: Stateful type: $ref: '#/definitions/InstanceType' title: InstancesPost represents the fields available for a new instance. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceStateDisk: properties: total: description: Total size in bytes example: 502239232 format: int64 type: integer x-go-name: Total usage: description: Disk usage in bytes example: 502239232 format: int64 type: integer x-go-name: Usage title: InstanceStateDisk represents the disk information section of an instance's state. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceDebugRepairPost: properties: action: description: The desired repair action. example: rebuild-config-volume type: string x-go-name: Action title: InstanceDebugRepairPost represents an instance repair request. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceSnapshot: properties: architecture: description: Architecture name example: x86_64 type: string x-go-name: Architecture config: description: Instance configuration (see doc/instances.md) example: security.nesting: 'true' type: object x-go-name: Config created_at: description: Instance creation timestamp example: '2021-03-23T20:00:00-04:00' format: date-time type: string x-go-name: CreatedAt description: description: Instance description example: My description type: string x-go-name: Description devices: description: Instance devices (see doc/instances.md) example: root: path: / pool: default type: disk type: object x-go-name: Devices ephemeral: description: Whether the instance is ephemeral (deleted on shutdown) example: false type: boolean x-go-name: Ephemeral expanded_config: description: Expanded configuration (all profiles and local config merged) example: security.nesting: 'true' type: object x-go-name: ExpandedConfig expanded_devices: description: Expanded devices (all profiles and local devices merged) example: root: path: / pool: default type: disk type: object x-go-name: ExpandedDevices expires_at: description: When the snapshot expires (gets auto-deleted) example: '2021-03-23T17:38:37.753398689-04:00' format: date-time type: string x-go-name: ExpiresAt last_used_at: description: Last start timestamp example: '2021-03-23T20:00:00-04:00' format: date-time type: string x-go-name: LastUsedAt name: description: Snapshot name example: foo type: string x-go-name: Name profiles: description: List of profiles applied to the instance example: - default items: type: string type: array x-go-name: Profiles size: description: Size of the snapshot in bytes example: 143360 format: int64 type: integer x-go-name: Size stateful: description: Whether the instance currently has saved state on disk example: false type: boolean x-go-name: Stateful title: InstanceSnapshot represents an instance snapshot. type: object x-go-package: github.com/lxc/incus/v7/shared/api ImageMetadataTemplate: description: ImageMetadataTemplate represents a template entry in image metadata (used in image tarball) properties: create_only: description: Whether to trigger only if the file is missing example: false type: boolean x-go-name: CreateOnly gid: description: The file owner gid. example: '1000' type: string x-go-name: GID mode: description: The file permissions. example: '644' type: string x-go-name: Mode properties: additionalProperties: type: string description: Key/value properties to pass to the template example: foo: bar type: object x-go-name: Properties template: description: The template itself as a valid pongo2 template example: pongo2-template type: string x-go-name: Template uid: description: The file owner uid. example: '1000' type: string x-go-name: UID when: description: When to trigger the template (create, copy or start) example: create items: type: string type: array x-go-name: When type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceSnapshotPost: properties: live: description: Whether to perform a live migration (requires migration) example: false type: boolean x-go-name: Live migration: description: Whether this is a migration request example: false type: boolean x-go-name: Migration name: description: New name for the snapshot example: foo type: string x-go-name: Name target: $ref: '#/definitions/InstancePostTarget' title: InstanceSnapshotPost represents the fields required to rename/move an instance snapshot. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceStateCPU: properties: allocated_time: description: CPU time available per second, in nanoseconds example: 4000000000 format: int64 type: integer x-go-name: AllocatedTime usage: description: CPU usage in nanoseconds example: 3637691016 format: int64 type: integer x-go-name: Usage title: InstanceStateCPU represents the cpu information section of an instance's state. type: object x-go-package: github.com/lxc/incus/v7/shared/api InstanceConsolePost: properties: force: description: Forces a connection to the console example: true type: boolean x-go-name: Force height: description: Console height in rows (console type only) example: 24 format: int64 type: integer x-go-name: Height type: description: Type of console to attach to (console or vga) example: console type: string x-go-name: Type width: description: Console width in columns (console type only) example: 80 format: int64 type: integer x-go-name: Width title: InstanceConsolePost represents an instance console request. type: object x-go-package: github.com/lxc/incus/v7/shared/api responses: Forbidden: description: Forbidden schema: properties: error: example: not authorized type: string x-go-name: Error error_code: example: 403 format: int64 type: integer x-go-name: ErrorCode type: example: error type: string x-go-name: Type type: object InternalServerError: description: Internal Server Error schema: properties: error: example: internal server error type: string x-go-name: Error error_code: example: 500 format: int64 type: integer x-go-name: ErrorCode type: example: error type: string x-go-name: Type type: object BadRequest: description: Bad Request schema: properties: error: example: bad request type: string x-go-name: Error error_code: example: 400 format: int64 type: integer x-go-name: ErrorCode type: example: error type: string x-go-name: Type type: object EmptySyncResponse: description: Empty sync response schema: properties: status: example: Success type: string x-go-name: Status status_code: example: 200 format: int64 type: integer x-go-name: StatusCode type: example: sync type: string x-go-name: Type type: object PreconditionFailed: description: Precondition Failed schema: properties: error: example: precondition failed type: string x-go-name: Error error_code: example: 412 format: int64 type: integer x-go-name: ErrorCode type: example: error type: string x-go-name: Type type: object NotFound: description: Not found schema: properties: error: example: not found type: string x-go-name: Error error_code: example: 404 format: int64 type: integer x-go-name: ErrorCode type: example: error type: string x-go-name: Type type: object Operation: description: Operation schema: properties: metadata: $ref: '#/definitions/Operation' operation: example: /1.0/operations/66e83638-9dd7-4a26-aef2-5462814869a1 type: string x-go-name: Operation status: example: Operation created type: string x-go-name: Status status_code: example: 100 format: int64 type: integer x-go-name: StatusCode type: example: async type: string x-go-name: Type type: object