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

222 lines
8.6 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 inputs from "./types/input";
import * as outputs from "./types/output";
import * as utilities from "./utilities";
/**
* ## # incus.Image
*
* Manages a locally-stored Incus image.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as incus from "@kiterun/incus";
*
* const alpine = new incus.Image("alpine", {sourceImage: {
* remote: "images",
* name: "alpine/edge",
* }});
* const test1 = new incus.Instance("test1", {
* name: "test1",
* image: alpine.fingerprint,
* ephemeral: false,
* });
* ```
*
* ## Notes
*
* * See the Incus [documentation](https://linuxcontainers.org/incus/docs/main/howto/images_remote) for more info on default image remotes.
*/
export class Image extends pulumi.CustomResource {
/**
* Get an existing Image 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?: ImageState, opts?: pulumi.CustomResourceOptions): Image {
return new Image(name, <any>state, { ...opts, id: id });
}
/** @internal */
public static readonly __pulumiType = 'incus:index/image:Image';
/**
* Returns true if the given object is an instance of Image. 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 Image {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Image.__pulumiType;
}
/**
* *Optional* - A list of aliases to assign to the image after
* pulling.
*/
public readonly aliases!: pulumi.Output<string[] | undefined>;
/**
* The list of aliases that were copied from the
* `sourceImage`.
*/
public /*out*/ readonly copiedAliases!: pulumi.Output<string[]>;
/**
* The datetime of image creation, in Unix time.
*/
public /*out*/ readonly createdAt!: pulumi.Output<number>;
/**
* The unique hash fingperint of the image.
*/
public /*out*/ readonly fingerprint!: pulumi.Output<string>;
/**
* *Optional* - Name of the project where the image will be stored.
*/
public readonly project!: pulumi.Output<string | undefined>;
/**
* *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>;
public /*out*/ readonly resourceId!: pulumi.Output<string>;
/**
* *Optional* - The image file from the local file system from which the image will be created. See reference below.
*/
public readonly sourceFile!: pulumi.Output<outputs.ImageSourceFile | undefined>;
/**
* *Optional* - The source image from which the image will be created. See reference below.
*/
public readonly sourceImage!: pulumi.Output<outputs.ImageSourceImage | undefined>;
/**
* *Optional* - The source instance from which the image will be created. See reference below.
*/
public readonly sourceInstance!: pulumi.Output<outputs.ImageSourceInstance | undefined>;
/**
* Create a Image 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?: ImageArgs, opts?: pulumi.CustomResourceOptions)
constructor(name: string, argsOrState?: ImageArgs | ImageState, opts?: pulumi.CustomResourceOptions) {
let resourceInputs: pulumi.Inputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState as ImageState | undefined;
resourceInputs["aliases"] = state ? state.aliases : undefined;
resourceInputs["copiedAliases"] = state ? state.copiedAliases : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["fingerprint"] = state ? state.fingerprint : undefined;
resourceInputs["project"] = state ? state.project : undefined;
resourceInputs["remote"] = state ? state.remote : undefined;
resourceInputs["resourceId"] = state ? state.resourceId : undefined;
resourceInputs["sourceFile"] = state ? state.sourceFile : undefined;
resourceInputs["sourceImage"] = state ? state.sourceImage : undefined;
resourceInputs["sourceInstance"] = state ? state.sourceInstance : undefined;
} else {
const args = argsOrState as ImageArgs | undefined;
resourceInputs["aliases"] = args ? args.aliases : undefined;
resourceInputs["project"] = args ? args.project : undefined;
resourceInputs["remote"] = args ? args.remote : undefined;
resourceInputs["sourceFile"] = args ? args.sourceFile : undefined;
resourceInputs["sourceImage"] = args ? args.sourceImage : undefined;
resourceInputs["sourceInstance"] = args ? args.sourceInstance : undefined;
resourceInputs["copiedAliases"] = undefined /*out*/;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["fingerprint"] = undefined /*out*/;
resourceInputs["resourceId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Image.__pulumiType, name, resourceInputs, opts);
}
}
/**
* Input properties used for looking up and filtering Image resources.
*/
export interface ImageState {
/**
* *Optional* - A list of aliases to assign to the image after
* pulling.
*/
aliases?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The list of aliases that were copied from the
* `sourceImage`.
*/
copiedAliases?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The datetime of image creation, in Unix time.
*/
createdAt?: pulumi.Input<number>;
/**
* The unique hash fingperint of the image.
*/
fingerprint?: pulumi.Input<string>;
/**
* *Optional* - Name of the project where the image 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>;
resourceId?: pulumi.Input<string>;
/**
* *Optional* - The image file from the local file system from which the image will be created. See reference below.
*/
sourceFile?: pulumi.Input<inputs.ImageSourceFile>;
/**
* *Optional* - The source image from which the image will be created. See reference below.
*/
sourceImage?: pulumi.Input<inputs.ImageSourceImage>;
/**
* *Optional* - The source instance from which the image will be created. See reference below.
*/
sourceInstance?: pulumi.Input<inputs.ImageSourceInstance>;
}
/**
* The set of arguments for constructing a Image resource.
*/
export interface ImageArgs {
/**
* *Optional* - A list of aliases to assign to the image after
* pulling.
*/
aliases?: pulumi.Input<pulumi.Input<string>[]>;
/**
* *Optional* - Name of the project where the image 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* - The image file from the local file system from which the image will be created. See reference below.
*/
sourceFile?: pulumi.Input<inputs.ImageSourceFile>;
/**
* *Optional* - The source image from which the image will be created. See reference below.
*/
sourceImage?: pulumi.Input<inputs.ImageSourceImage>;
/**
* *Optional* - The source instance from which the image will be created. See reference below.
*/
sourceInstance?: pulumi.Input<inputs.ImageSourceInstance>;
}