UNPKG

@huaweicloudos/pulumi

Version:

A Pulumi package for creating and managing Huaweicloud cloud resources.

320 lines (319 loc) 13.3 kB
import * as pulumi from "@pulumi/pulumi"; import { input as inputs, output as outputs } from "../types"; /** * Manages an SMS migration task resource within HuaweiCloud. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pulumi from "@huaweicloudos/pulumi"; * * const config = new pulumi.Config(); * const sourceServer = config.requireObject("sourceServer"); * const templateId = config.requireObject("templateId"); * const migration = new huaweicloud.sms.Task("migration", { * type: "MIGRATE_FILE", * osType: "LINUX", * sourceServerId: sourceServer, * vmTemplateId: templateId, * action: "start", * }); * ``` * * ## Import * * SMS migration tasks can be imported by `id`, e.g. * * ```sh * $ pulumi import huaweicloud:Sms/task:Task demo 6402c49b-7d9a-413e-8b5f-a7307f7d5679 * ``` * * Note that the imported state may not be identical to your resource definition, due to some attributes missing from the API response. The missing attributes include`use_public_ip`, `syncing` and `action`. It is generally recommended running `terraform plan` after importing a migration task. You can then decide if changes should be applied to the task, or the resource definition should be updated to align with the task. Also you can ignore changes as below. hcl resource "huaweicloud_sms_task" "demo" { * * ... * * lifecycle { * * ignore_changes = [ * * use_public_ip, syncing, action, * * ] * * } } */ export declare class Task extends pulumi.CustomResource { /** * Get an existing Task 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. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: TaskState, opts?: pulumi.CustomResourceOptions): Task; /** * Returns true if the given object is an instance of Task. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Task; /** * Specifies the operation after the task is created. * The value can be **start**, **stop** and **restart**. */ readonly action: pulumi.Output<string | undefined>; /** * The enterprise project id of the target server. */ readonly enterpriseProjectId: pulumi.Output<string>; /** * The migration rate, in MB/s. */ readonly migrateSpeed: pulumi.Output<number>; /** * Specifies the IP address of the target server. * Use the EIP of the target server if the migration network type is Internet. * Use the private IP address of the target server if the migration network type is Direct Connect or VPN. * Changing this parameter will create a new resource. */ readonly migrationIp: pulumi.Output<string | undefined>; /** * Specifies the OS type of the source server. The value can be **WINDOWS** and **LINUX**. * Changing this parameter will create a new resource. */ readonly osType: pulumi.Output<string>; /** * Specifies the project ID where the target server is located. * If omitted, the default project in the region will be used. Changing this parameter will create a new resource. */ readonly projectId: pulumi.Output<string>; /** * Specifies the region where the target server is located. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ readonly region: pulumi.Output<string>; /** * Specifies the ID of the source server. * Changing this parameter will create a new resource. */ readonly sourceServerId: pulumi.Output<string>; /** * Specifies whether to start the target server after the migration. * The default value is `true`. Changing this parameter will create a new resource. */ readonly startTargetServer: pulumi.Output<boolean | undefined>; /** * The status of the migration task. */ readonly state: pulumi.Output<string>; /** * - Specifies whether to perform a continuous synchronization after the first replication. * The default value is `false`. Changing this parameter will create a new resource. */ readonly syncing: pulumi.Output<boolean | undefined>; /** * Specifies the disk configurations of the target server. * If omitted, it will be obtained from the source server. The object * is documented below. Changing this parameter will create a new resource. */ readonly targetServerDisks: pulumi.Output<outputs.Sms.TaskTargetServerDisk[]>; /** * Specifies the existing server ID as the target server. * This parameter and `vmTemplateId` are alternative. Changing this parameter will create a new resource. */ readonly targetServerId: pulumi.Output<string>; /** * The name of the target server. */ readonly targetServerName: pulumi.Output<string>; /** * Specifies the type of the migration task. Available values are * **MIGRATE_FILE**(file-level migration) and **MIGRATE_BLOCK**(block-level migration). * Changing this parameter will create a new resource. */ readonly type: pulumi.Output<string>; /** * Specifies whether to use a public IP address for migration. * The default value is `true`. Changing this parameter will create a new resource. */ readonly usePublicIp: pulumi.Output<boolean | undefined>; /** * Specifies the template used to create the target server automatically. * This parameter and `targetServerId` are alternative. Changing this parameter will create a new resource. */ readonly vmTemplateId: pulumi.Output<string | undefined>; /** * Create a Task 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: TaskArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Task resources. */ export interface TaskState { /** * Specifies the operation after the task is created. * The value can be **start**, **stop** and **restart**. */ action?: pulumi.Input<string>; /** * The enterprise project id of the target server. */ enterpriseProjectId?: pulumi.Input<string>; /** * The migration rate, in MB/s. */ migrateSpeed?: pulumi.Input<number>; /** * Specifies the IP address of the target server. * Use the EIP of the target server if the migration network type is Internet. * Use the private IP address of the target server if the migration network type is Direct Connect or VPN. * Changing this parameter will create a new resource. */ migrationIp?: pulumi.Input<string>; /** * Specifies the OS type of the source server. The value can be **WINDOWS** and **LINUX**. * Changing this parameter will create a new resource. */ osType?: pulumi.Input<string>; /** * Specifies the project ID where the target server is located. * If omitted, the default project in the region will be used. Changing this parameter will create a new resource. */ projectId?: pulumi.Input<string>; /** * Specifies the region where the target server is located. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Specifies the ID of the source server. * Changing this parameter will create a new resource. */ sourceServerId?: pulumi.Input<string>; /** * Specifies whether to start the target server after the migration. * The default value is `true`. Changing this parameter will create a new resource. */ startTargetServer?: pulumi.Input<boolean>; /** * The status of the migration task. */ state?: pulumi.Input<string>; /** * - Specifies whether to perform a continuous synchronization after the first replication. * The default value is `false`. Changing this parameter will create a new resource. */ syncing?: pulumi.Input<boolean>; /** * Specifies the disk configurations of the target server. * If omitted, it will be obtained from the source server. The object * is documented below. Changing this parameter will create a new resource. */ targetServerDisks?: pulumi.Input<pulumi.Input<inputs.Sms.TaskTargetServerDisk>[]>; /** * Specifies the existing server ID as the target server. * This parameter and `vmTemplateId` are alternative. Changing this parameter will create a new resource. */ targetServerId?: pulumi.Input<string>; /** * The name of the target server. */ targetServerName?: pulumi.Input<string>; /** * Specifies the type of the migration task. Available values are * **MIGRATE_FILE**(file-level migration) and **MIGRATE_BLOCK**(block-level migration). * Changing this parameter will create a new resource. */ type?: pulumi.Input<string>; /** * Specifies whether to use a public IP address for migration. * The default value is `true`. Changing this parameter will create a new resource. */ usePublicIp?: pulumi.Input<boolean>; /** * Specifies the template used to create the target server automatically. * This parameter and `targetServerId` are alternative. Changing this parameter will create a new resource. */ vmTemplateId?: pulumi.Input<string>; } /** * The set of arguments for constructing a Task resource. */ export interface TaskArgs { /** * Specifies the operation after the task is created. * The value can be **start**, **stop** and **restart**. */ action?: pulumi.Input<string>; /** * Specifies the IP address of the target server. * Use the EIP of the target server if the migration network type is Internet. * Use the private IP address of the target server if the migration network type is Direct Connect or VPN. * Changing this parameter will create a new resource. */ migrationIp?: pulumi.Input<string>; /** * Specifies the OS type of the source server. The value can be **WINDOWS** and **LINUX**. * Changing this parameter will create a new resource. */ osType: pulumi.Input<string>; /** * Specifies the project ID where the target server is located. * If omitted, the default project in the region will be used. Changing this parameter will create a new resource. */ projectId?: pulumi.Input<string>; /** * Specifies the region where the target server is located. * If omitted, the provider-level region will be used. Changing this parameter will create a new resource. */ region?: pulumi.Input<string>; /** * Specifies the ID of the source server. * Changing this parameter will create a new resource. */ sourceServerId: pulumi.Input<string>; /** * Specifies whether to start the target server after the migration. * The default value is `true`. Changing this parameter will create a new resource. */ startTargetServer?: pulumi.Input<boolean>; /** * - Specifies whether to perform a continuous synchronization after the first replication. * The default value is `false`. Changing this parameter will create a new resource. */ syncing?: pulumi.Input<boolean>; /** * Specifies the disk configurations of the target server. * If omitted, it will be obtained from the source server. The object * is documented below. Changing this parameter will create a new resource. */ targetServerDisks?: pulumi.Input<pulumi.Input<inputs.Sms.TaskTargetServerDisk>[]>; /** * Specifies the existing server ID as the target server. * This parameter and `vmTemplateId` are alternative. Changing this parameter will create a new resource. */ targetServerId?: pulumi.Input<string>; /** * Specifies the type of the migration task. Available values are * **MIGRATE_FILE**(file-level migration) and **MIGRATE_BLOCK**(block-level migration). * Changing this parameter will create a new resource. */ type: pulumi.Input<string>; /** * Specifies whether to use a public IP address for migration. * The default value is `true`. Changing this parameter will create a new resource. */ usePublicIp?: pulumi.Input<boolean>; /** * Specifies the template used to create the target server automatically. * This parameter and `targetServerId` are alternative. Changing this parameter will create a new resource. */ vmTemplateId?: pulumi.Input<string>; }