import * as API from "@distilled.cloud/core/api"; import { type HetznerOpError, type HetznerOpContext } from "../protocol.ts"; export type { HetznerOpError, HetznerOpContext }; export interface AttachVolumeRequest { /** ID of the Volume. */ id: number; /** ID of the Server the Volume will be attached to. */ server: number; /** Auto-mount the Volume after attaching it. */ automount?: boolean; } /** Status of the Action. */ export type AttachVolumeResponseActionStatus = "running" | "success" | "error"; export interface AttachVolumeResponseActionResourcesItem { /** ID of the Resource. */ id: number; /** Type of the Resource. */ type: string; } /** Resources the Action relates to. */ export type AttachVolumeResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export interface AttachVolumeResponseActionError { /** Fixed error code for machines. */ code: string; /** Error message for humans. */ message: string; } export interface AttachVolumeResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: AttachVolumeResponseActionStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: AttachVolumeResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AttachVolumeResponseActionError | null; } export interface AttachVolumeResponse { action: AttachVolumeResponseAction; } export interface ChangeVolumeProtectionRequest { /** ID of the Volume. */ id: number; /** If true, prevents the Volume from being deleted. */ delete?: boolean; } /** Status of the Action. */ export type ChangeVolumeProtectionResponseActionStatus = "running" | "success" | "error"; export type ChangeVolumeProtectionResponseActionResourcesItem = AttachVolumeResponseActionResourcesItem; /** Resources the Action relates to. */ export type ChangeVolumeProtectionResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type ChangeVolumeProtectionResponseActionError = AttachVolumeResponseActionError; export interface ChangeVolumeProtectionResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: ChangeVolumeProtectionResponseActionStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: ChangeVolumeProtectionResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AttachVolumeResponseActionError | null; } export interface ChangeVolumeProtectionResponse { action: ChangeVolumeProtectionResponseAction; } export interface DetachVolumeRequest { /** ID of the Volume. */ id: number; } /** Status of the Action. */ export type DetachVolumeResponseActionStatus = "running" | "success" | "error"; export type DetachVolumeResponseActionResourcesItem = AttachVolumeResponseActionResourcesItem; /** Resources the Action relates to. */ export type DetachVolumeResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type DetachVolumeResponseActionError = AttachVolumeResponseActionError; export interface DetachVolumeResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: DetachVolumeResponseActionStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: DetachVolumeResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AttachVolumeResponseActionError | null; } export interface DetachVolumeResponse { action: DetachVolumeResponseAction; } export interface GetVolumesActionRequest { /** ID of the Action. */ id: number; } /** Status of the Action. */ export type GetVolumesActionResponseActionStatus = "running" | "success" | "error"; export type GetVolumesActionResponseActionResourcesItem = AttachVolumeResponseActionResourcesItem; /** Resources the Action relates to. */ export type GetVolumesActionResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type GetVolumesActionResponseActionError = AttachVolumeResponseActionError; export interface GetVolumesActionResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: GetVolumesActionResponseActionStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: GetVolumesActionResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AttachVolumeResponseActionError | null; } export interface GetVolumesActionResponse { action: GetVolumesActionResponseAction; } export type ListVolumeActionsRequestSortItem = "id" | "id:asc" | "id:desc" | "command" | "command:asc" | "command:desc" | "status" | "status:asc" | "status:desc" | "started" | "started:asc" | "started:desc" | "finished" | "finished:asc" | "finished:desc"; export type ListVolumeActionsRequestSortList = Array; /** Status of the Action. */ export type ListVolumeActionsRequestStatusItem = "running" | "success" | "error"; export type ListVolumeActionsRequestStatusList = Array; export interface ListVolumeActionsRequest { /** ID of the Volume. */ id: number; /** Sort actions by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListVolumeActionsRequestSortList; /** Filter the actions by status. May be used multiple times. The response will only contain actions matching the specified statuses. */ status?: ListVolumeActionsRequestStatusList; /** Page number to return. For more information, see "[Pagination](#description/pagination)". */ page?: number; /** Maximum number of entries returned per page. For more information, see "[Pagination](#description/pagination)". */ per_page?: number; } /** Status of the Action. */ export type ListVolumeActionsResponseActionsItemStatus = "running" | "success" | "error"; export type ListVolumeActionsResponseActionsItemResourcesItem = AttachVolumeResponseActionResourcesItem; /** Resources the Action relates to. */ export type ListVolumeActionsResponseActionsItemResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type ListVolumeActionsResponseActionsItemError = AttachVolumeResponseActionError; export interface ListVolumeActionsResponseActionsItem { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: ListVolumeActionsResponseActionsItemStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: ListVolumeActionsResponseActionsItemResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AttachVolumeResponseActionError | null; } export type ListVolumeActionsResponseActionsList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export interface ListVolumeActionsResponseMetaPagination { /** Current page number. */ page: number; /** Maximum number of entries returned per page. */ per_page: number; /** Page number of the previous page. Can be null if the current page is the first one. */ previous_page: number | null; /** Page number of the next page. Can be null if the current page is the last one. */ next_page: number | null; /** Page number of the last page available. Can be null if the current page is the last one. */ last_page: number | null; /** Total number of entries that exist for this query. Can be null if unknown. */ total_entries: number | null; } export interface ListVolumeActionsResponseMeta { /** See "[Pagination](#description/pagination)" for more information. */ pagination: ListVolumeActionsResponseMetaPagination; } export interface ListVolumeActionsResponse { actions: ListVolumeActionsResponseActionsList; meta: ListVolumeActionsResponseMeta; } export type ListVolumesActionsRequestIdList = Array; export type ListVolumesActionsRequestSortItem = "id" | "id:asc" | "id:desc" | "command" | "command:asc" | "command:desc" | "status" | "status:asc" | "status:desc" | "started" | "started:asc" | "started:desc" | "finished" | "finished:asc" | "finished:desc"; export type ListVolumesActionsRequestSortList = Array; /** Status of the Action. */ export type ListVolumesActionsRequestStatusItem = "running" | "success" | "error"; export type ListVolumesActionsRequestStatusList = Array; export interface ListVolumesActionsRequest { /** Filter the actions by ID. May be used multiple times. The response will only contain actions matching the specified IDs. */ id?: ListVolumesActionsRequestIdList; /** Sort actions by field and direction. May be used multiple times. For more information, see "[Sorting](#description/sorting)". */ sort?: ListVolumesActionsRequestSortList; /** Filter the actions by status. May be used multiple times. The response will only contain actions matching the specified statuses. */ status?: ListVolumesActionsRequestStatusList; /** Page number to return. For more information, see "[Pagination](#description/pagination)". */ page?: number; /** Maximum number of entries returned per page. For more information, see "[Pagination](#description/pagination)". */ per_page?: number; } /** Status of the Action. */ export type ListVolumesActionsResponseActionsItemStatus = "running" | "success" | "error"; export type ListVolumesActionsResponseActionsItemResourcesItem = AttachVolumeResponseActionResourcesItem; /** Resources the Action relates to. */ export type ListVolumesActionsResponseActionsItemResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type ListVolumesActionsResponseActionsItemError = AttachVolumeResponseActionError; export interface ListVolumesActionsResponseActionsItem { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: ListVolumesActionsResponseActionsItemStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: ListVolumesActionsResponseActionsItemResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AttachVolumeResponseActionError | null; } export type ListVolumesActionsResponseActionsList = Array; /** See "[Pagination](#description/pagination)" for more information. */ export type ListVolumesActionsResponseMetaPagination = ListVolumeActionsResponseMetaPagination; export type ListVolumesActionsResponseMeta = ListVolumeActionsResponseMeta; export interface ListVolumesActionsResponse { actions: ListVolumesActionsResponseActionsList; meta: ListVolumeActionsResponseMeta; } export interface ResizeVolumeRequest { /** ID of the Volume. */ id: number; /** New Volume size in GB (must be greater than current size). */ size: number; } /** Status of the Action. */ export type ResizeVolumeResponseActionStatus = "running" | "success" | "error"; export type ResizeVolumeResponseActionResourcesItem = AttachVolumeResponseActionResourcesItem; /** Resources the Action relates to. */ export type ResizeVolumeResponseActionResourcesList = Array; /** Error message for the Action if an error occurred, otherwise null. */ export type ResizeVolumeResponseActionError = AttachVolumeResponseActionError; export interface ResizeVolumeResponseAction { /** ID of the [Action](#description/actions). */ id: number; /** Command executed in the Action. */ command: string; /** Status of the Action. */ status: ResizeVolumeResponseActionStatus; /** Point in time when the Action was started (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). */ started: string; /** Point in time when the Action was finished (in [RFC3339](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format). Only set if the Action is finished otherwise null. */ finished: string | null; /** Progress of the Action in percent. */ progress: number; /** Resources the Action relates to. */ resources: ResizeVolumeResponseActionResourcesList; /** Error message for the Action if an error occurred, otherwise null. */ error: AttachVolumeResponseActionError | null; } export interface ResizeVolumeResponse { action: ResizeVolumeResponseAction; } export type AttachVolumeError = HetznerOpError; /** Attach Volume to a Server Attaches a Volume to a Server. Works only if the Server is in the same Location as the Volume. */ export declare const attachVolume: API.OperationMethod; export type ChangeVolumeProtectionError = HetznerOpError; /** Change Volume Protection Changes the protection configuration of a Volume. */ export declare const changeVolumeProtection: API.OperationMethod; export type DetachVolumeError = HetznerOpError; /** Detach Volume Detaches a Volume from the Server it's attached to. You may attach it to a Server again at a later time. */ export declare const detachVolume: API.OperationMethod; export type GetVolumesActionError = HetznerOpError; /** Get an Action Returns a specific Action object. */ export declare const getVolumesAction: API.OperationMethod; export type ListVolumeActionsError = HetznerOpError; /** List Actions for a Volume Returns all Action objects for a Volume. You can `sort` the results by using the sort URI parameter, and filter them with the `status` parameter. */ export declare const listVolumeActions: API.PaginatedOperationMethod; export type ListVolumesActionsError = HetznerOpError; /** List Actions Returns all Action objects. You can `sort` the results by using the sort URI parameter, and filter them with the `status` and `id` parameter. */ export declare const listVolumesActions: API.PaginatedOperationMethod; export type ResizeVolumeError = HetznerOpError; /** Resize Volume Changes the size of a Volume. Note that downsizing a Volume is not possible. */ export declare const resizeVolume: API.OperationMethod; //# sourceMappingURL=volume_actions.d.ts.map