Files
pulumi-incus/sdk/nodejs/instanceSnapshot.ts
2025-04-24 21:09:04 -04:00

184 lines
6.8 KiB
TypeScript
Generated

// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "./utilities";
/**
* ## # incus.InstanceSnapshot
*
* Manages a snapshot of an Incus instance.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
*
* const instance = new incus.Instance("instance", {
* name: "my-instance",
* image: "ubuntu",
* ephemeral: false,
* });
* const snap1 = new incus.InstanceSnapshot("snap1", {
* name: "my-snapshot-1",
* instance: instance.name,
* });
* ```
*/
export class InstanceSnapshot extends pulumi.CustomResource {
/**
* Get an existing InstanceSnapshot resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: InstanceSnapshotState, opts?: pulumi.CustomResourceOptions): InstanceSnapshot {
return new InstanceSnapshot(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/instanceSnapshot:InstanceSnapshot';
/**
* Returns true if the given object is an instance of InstanceSnapshot. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
public static isInstance(obj: any): obj is InstanceSnapshot {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === InstanceSnapshot.__pulumiType;
}
/**
* The time Incus reported the snapshot was successfully created,
* in UTC.
*/
public /*out*/ readonly createdAt!: pulumi.Output<number>;
/**
* **Required** - The name of the instance to snapshot.
*/
public readonly instance!: pulumi.Output<string>;
/**
* **Required** - Name of the snapshot.
*/
public readonly name!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the snapshot will be stored.
*/
public readonly project!: pulumi.Output<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
public readonly remote!: pulumi.Output<string | undefined>;
/**
* *Optional* - Set to `true` to create a stateful snapshot,
* `false` for stateless. Stateful snapshots include runtime state. Defaults to
* `false`.
*/
public readonly stateful!: pulumi.Output<boolean>;
/**
* Create a InstanceSnapshot resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: InstanceSnapshotArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: InstanceSnapshotArgs | InstanceSnapshotState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as InstanceSnapshotState | undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["instance"] = state ? state.instance : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["stateful"] = state ? state.stateful : undefined;
} else {
const args = argsOrState as InstanceSnapshotArgs | undefined;
if ((!args || args.instance === undefined) && !opts.urn) {
throw new Error("Missing required property 'instance'");
}
resourceInputs["instance"] = args ? args.instance : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["project"] = (args ? args.project : undefined) ?? "default";
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["stateful"] = args ? args.stateful : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(InstanceSnapshot.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering InstanceSnapshot resources.
*/
export interface InstanceSnapshotState {
/**
* The time Incus reported the snapshot was successfully created,
* in UTC.
*/
createdAt?: pulumi.Input<number>;
/**
* **Required** - The name of the instance to snapshot.
*/
instance?: pulumi.Input<string>;
/**
* **Required** - Name of the snapshot.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the snapshot will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Set to `true` to create a stateful snapshot,
* `false` for stateless. Stateful snapshots include runtime state. Defaults to
* `false`.
*/
stateful?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a InstanceSnapshot resource.
*/
export interface InstanceSnapshotArgs {
/**
* **Required** - The name of the instance to snapshot.
*/
instance: pulumi.Input<string>;
/**
* **Required** - Name of the snapshot.
*/
name?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the snapshot will be stored.
*/
project?: pulumi.Input<string>;
/**
* *Optional* - The remote in which the resource will be created. If
* not provided, the provider's default remote will be used.
*/
remote?: pulumi.Input<string>;
/**
* *Optional* - Set to `true` to create a stateful snapshot,
* `false` for stateless. Stateful snapshots include runtime state. Defaults to
* `false`.
*/
stateful?: pulumi.Input<boolean>;
}