UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

347 lines (346 loc) 11.1 kB
import * as pulumi from "@pulumi/pulumi"; /** * Use this data source to get an available IMS image within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as huaweicloud from "@pulumi/huaweicloud"; * * const config = new pulumi.Config(); * const imageId = config.requireObject("imageId"); * const test = huaweicloud.Ims.getImage({ * imageId: imageId, * }); * const ubuntu = huaweicloud.Ims.getImage({ * name: "Ubuntu 18.04 server 64bit", * visibility: "public", * mostRecent: true, * }); * const centos-1 = huaweicloud.Ims.getImage({ * architecture: "x86", * visibility: "public", * mostRecent: true, * }); * const centos-2 = huaweicloud.Ims.getImage({ * architecture: "x86", * nameRegex: "^CentOS 7.4", * visibility: "public", * mostRecent: true, * }); * const bmsImage = huaweicloud.Ims.getImage({ * architecture: "x86", * imageType: "Ironic", * visibility: "public", * mostRecent: true, * }); * ``` */ export declare function getImage(args?: GetImageArgs, opts?: pulumi.InvokeOptions): Promise<GetImageResult>; /** * A collection of arguments for invoking getImage. */ export interface GetImageArgs { /** * Specifies the image architecture type. The value can be **x86** or **arm**. */ architecture?: string; /** * Specifies the enterprise project ID of the image. * For enterprise users, if omitted, will query the images under all enterprise projects. */ enterpriseProjectId?: string; /** * Specifies the ECS flavor ID used to filter out available images. * You can specify only one flavor ID and only ECS flavor ID is valid, BMS flavor is not supported. */ flavorId?: string; /** * Specifies the ID of the image. */ imageId?: string; /** * Specifies the environment where the image is used. * The valid values are as follows: * + **FusionCompute**: Cloud server image, also known as system disk image. * + **DataImage**: Data disk image. * + **Ironic**: Bare metal server image. * + **IsoImage**: ISO image. */ imageType?: string; /** * Specifies whether it is a whole image. The valid value is **true** or **false**. * Defaults to **false**. */ isWholeImage?: boolean; /** * Specifies whether to return the latest updated image if the query returns more than * results. The valid value is **true** or **false**. Defaults to **false**. */ mostRecent?: boolean; /** * Specifies the name of the image. Cannot be used simultaneously with `nameRegex`. */ name?: string; /** * Specifies the regular expression of the name of the image. * Cannot be used simultaneously with `name`. */ nameRegex?: string; /** * Specifies the image OS type. The value can be **Windows**, **Ubuntu**, **RedHat**, **SUSE**, * **CentOS**, **Debian**, **OpenSUSE**, **Oracle Linux**, **Fedora**, **Other**, **CoreOS**, or **EulerOS**. */ os?: string; /** * The operating system version of the image. */ osVersion?: string; /** * Specifies the owner (UUID) of the image. */ owner?: string; /** * Specifies the region in which to obtain the images. * If omitted, the provider-level region will be used. */ region?: string; /** * @deprecated size_max is deprecated */ sizeMax?: number; /** * @deprecated size_min is deprecated */ sizeMin?: number; /** * Specifies whether to sort the query results in ascending or descending order. * The valid values are as follows: * + **asc**: Ascending order. * + **desc**: Descending order. */ sortDirection?: string; /** * Specifies which field to use for sorting. The valid values are **name**, * **container_format**, **disk_format**, **status**, **id**, **size**, and **created_at**. Defaults to **name**. */ sortKey?: string; /** * Specifies the image tag in **Key=Value** format. */ tag?: string; /** * Specifies the visibility of the image. Must be one of **public**, **private**, * **market** or **shared**. */ visibility?: string; } /** * A collection of values returned by getImage. */ export interface GetImageResult { /** * The time when the image status changes to active, in RFC3339 format. */ readonly activeAt: string; readonly architecture: string; /** * The backup ID of the whole image in the CBR vault. */ readonly backupId: string; readonly checksum: string; /** * The format of the image's container. */ readonly containerFormat: string; /** * The creation time of the image, in RFC3339 format. */ readonly createdAt: string; /** * The image source. The format is **server_backup,backup_id**, **instance,instance_id**, * **server_backup,vault_id**, **volume,volume_id**, **file,image_url**, or **image,region,image_id**. */ readonly dataOrigin: string; /** * The description of the image. */ readonly description: string; /** * The image format. The value can be **zvhd2**, **vhd**, **zvhd**, **raw**, **qcow2**, or **iso**. */ readonly diskFormat: string; readonly enterpriseProjectId: string; /** * The image file download and upload links. */ readonly file: string; readonly flavorId?: string; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly imageId: string; readonly imageType: string; readonly isWholeImage?: boolean; /** * The maximum memory supported by the image, in MB unit. */ readonly maxRamMb: number; readonly metadata: { [key: string]: string; }; /** * The minimum disk space required to run an image, in GB unit. * + When the operating system is Linux, the value ranges from `10` to `1,024`. * + When the operating system is Windows, the value ranges from `20` to `1,024`. */ readonly minDiskGb: number; /** * The minimum memory required to run an image, in MB unit. */ readonly minRamMb: number; readonly mostRecent?: boolean; readonly name: string; readonly nameRegex?: string; readonly os: string; /** * The operating system version of the image. */ readonly osVersion: string; readonly owner: string; /** * Indicates whether the image is protected, protected images cannot be deleted. * The valid value is **true** or **false**. */ readonly protected: boolean; readonly region: string; /** * The image view. */ readonly schema: string; /** * The size of the image file, in bytes unit. */ readonly sizeBytes: number; /** * @deprecated size_max is deprecated */ readonly sizeMax?: number; /** * @deprecated size_min is deprecated */ readonly sizeMin?: number; readonly sortDirection?: string; readonly sortKey?: string; /** * The status of the image. The valid value is **active**. */ readonly status: string; readonly tag?: string; /** * The last update time of the image, in RFC3339 format. */ readonly updatedAt: string; readonly visibility: string; } export declare function getImageOutput(args?: GetImageOutputArgs, opts?: pulumi.InvokeOptions): pulumi.Output<GetImageResult>; /** * A collection of arguments for invoking getImage. */ export interface GetImageOutputArgs { /** * Specifies the image architecture type. The value can be **x86** or **arm**. */ architecture?: pulumi.Input<string>; /** * Specifies the enterprise project ID of the image. * For enterprise users, if omitted, will query the images under all enterprise projects. */ enterpriseProjectId?: pulumi.Input<string>; /** * Specifies the ECS flavor ID used to filter out available images. * You can specify only one flavor ID and only ECS flavor ID is valid, BMS flavor is not supported. */ flavorId?: pulumi.Input<string>; /** * Specifies the ID of the image. */ imageId?: pulumi.Input<string>; /** * Specifies the environment where the image is used. * The valid values are as follows: * + **FusionCompute**: Cloud server image, also known as system disk image. * + **DataImage**: Data disk image. * + **Ironic**: Bare metal server image. * + **IsoImage**: ISO image. */ imageType?: pulumi.Input<string>; /** * Specifies whether it is a whole image. The valid value is **true** or **false**. * Defaults to **false**. */ isWholeImage?: pulumi.Input<boolean>; /** * Specifies whether to return the latest updated image if the query returns more than * results. The valid value is **true** or **false**. Defaults to **false**. */ mostRecent?: pulumi.Input<boolean>; /** * Specifies the name of the image. Cannot be used simultaneously with `nameRegex`. */ name?: pulumi.Input<string>; /** * Specifies the regular expression of the name of the image. * Cannot be used simultaneously with `name`. */ nameRegex?: pulumi.Input<string>; /** * Specifies the image OS type. The value can be **Windows**, **Ubuntu**, **RedHat**, **SUSE**, * **CentOS**, **Debian**, **OpenSUSE**, **Oracle Linux**, **Fedora**, **Other**, **CoreOS**, or **EulerOS**. */ os?: pulumi.Input<string>; /** * The operating system version of the image. */ osVersion?: pulumi.Input<string>; /** * Specifies the owner (UUID) of the image. */ owner?: pulumi.Input<string>; /** * Specifies the region in which to obtain the images. * If omitted, the provider-level region will be used. */ region?: pulumi.Input<string>; /** * @deprecated size_max is deprecated */ sizeMax?: pulumi.Input<number>; /** * @deprecated size_min is deprecated */ sizeMin?: pulumi.Input<number>; /** * Specifies whether to sort the query results in ascending or descending order. * The valid values are as follows: * + **asc**: Ascending order. * + **desc**: Descending order. */ sortDirection?: pulumi.Input<string>; /** * Specifies which field to use for sorting. The valid values are **name**, * **container_format**, **disk_format**, **status**, **id**, **size**, and **created_at**. Defaults to **name**. */ sortKey?: pulumi.Input<string>; /** * Specifies the image tag in **Key=Value** format. */ tag?: pulumi.Input<string>; /** * Specifies the visibility of the image. Must be one of **public**, **private**, * **market** or **shared**. */ visibility?: pulumi.Input<string>; }