<filename>sdk/dotnet/Tencentcloud/Dts/MigrateJobConfig.cs// *** 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! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Dts
{
    /// <summary>
    /// Provides a resource to create a dts migrate_job_config
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var service = new Tencentcloud.Dts.MigrateService("service", new Tencentcloud.Dts.MigrateServiceArgs
    ///         {
    ///             SrcDatabaseType = "mysql",
    ///             DstDatabaseType = "cynosdbmysql",
    ///             SrcRegion = "ap-guangzhou",
    ///             DstRegion = "ap-guangzhou",
    ///             InstanceClass = "small",
    ///             JobName = "tf_test_xxx",
    ///             Tags = 
    ///             {
    ///                 new Tencentcloud.Dts.Inputs.MigrateServiceTagArgs
    ///                 {
    ///                     TagKey = "aaa",
    ///                     TagValue = "bbb",
    ///                 },
    ///             },
    ///         });
    ///         var job = new Tencentcloud.Dts.MigrateJob("job", new Tencentcloud.Dts.MigrateJobArgs
    ///         {
    ///             ServiceId = service.Id,
    ///             RunMode = "immediate",
    ///             MigrateOption = new Tencentcloud.Dts.Inputs.MigrateJobMigrateOptionArgs
    ///             {
    ///                 DatabaseTable = new Tencentcloud.Dts.Inputs.MigrateJobMigrateOptionDatabaseTableArgs
    ///                 {
    ///                     ObjectMode = "partial",
    ///                     Databases = 
    ///                     {
    ///                         new Tencentcloud.Dts.Inputs.MigrateJobMigrateOptionDatabaseTableDatabaseArgs
    ///                         {
    ///                             DbName = "tf_ci_test",
    ///                             DbMode = "partial",
    ///                             TableMode = "partial",
    ///                             Tables = 
    ///                             {
    ///                                 new Tencentcloud.Dts.Inputs.MigrateJobMigrateOptionDatabaseTableDatabaseTableArgs
    ///                                 {
    ///                                     TableName = "test",
    ///                                     NewTableName = "test_xxx",
    ///                                     TableEditMode = "rename",
    ///                                 },
    ///                             },
    ///                         },
    ///                     },
    ///                 },
    ///             },
    ///             SrcInfo = new Tencentcloud.Dts.Inputs.MigrateJobSrcInfoArgs
    ///             {
    ///                 Region = "ap-guangzhou",
    ///                 AccessType = "cdb",
    ///                 DatabaseType = "mysql",
    ///                 NodeType = "simple",
    ///                 Infos = 
    ///                 {
    ///                     new Tencentcloud.Dts.Inputs.MigrateJobSrcInfoInfoArgs
    ///                     {
    ///                         User = "root",
    ///                         Password = "xxx",
    ///                         InstanceId = "id",
    ///                     },
    ///                 },
    ///             },
    ///             DstInfo = new Tencentcloud.Dts.Inputs.MigrateJobDstInfoArgs
    ///             {
    ///                 Region = "ap-guangzhou",
    ///                 AccessType = "cdb",
    ///                 DatabaseType = "cynosdbmysql",
    ///                 NodeType = "simple",
    ///                 Infos = 
    ///                 {
    ///                     new Tencentcloud.Dts.Inputs.MigrateJobDstInfoInfoArgs
    ///                     {
    ///                         User = "user",
    ///                         Password = "xxx",
    ///                         InstanceId = "id",
    ///                     },
    ///                 },
    ///             },
    ///             AutoRetryTimeRangeMinutes = 0,
    ///         });
    ///         var start = new Tencentcloud.Dts.MigrateJobStartOperation("start", new Tencentcloud.Dts.MigrateJobStartOperationArgs
    ///         {
    ///             JobId = job.Id,
    ///         });
    ///         // pause the migration job
    ///         var config = new Tencentcloud.Dts.MigrateJobConfig("config", new Tencentcloud.Dts.MigrateJobConfigArgs
    ///         {
    ///             JobId = start.Id,
    ///             Action = "pause",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// Continue the a migration job
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var config = new Tencentcloud.Dts.MigrateJobConfig("config", new Tencentcloud.Dts.MigrateJobConfigArgs
    ///         {
    ///             JobId = tencentcloud_dts_migrate_job_start_operation.Start.Id,
    ///             Action = "continue",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// Complete a migration job when the status is readyComplete
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var config = new Tencentcloud.Dts.MigrateJobConfig("config", new Tencentcloud.Dts.MigrateJobConfigArgs
    ///         {
    ///             JobId = tencentcloud_dts_migrate_job_start_operation.Start.Id,
    ///             Action = "continue",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// Stop a running migration job
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var config = new Tencentcloud.Dts.MigrateJobConfig("config", new Tencentcloud.Dts.MigrateJobConfigArgs
    ///         {
    ///             JobId = tencentcloud_dts_migrate_job_start_operation.Start.Id,
    ///             Action = "stop",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// Isolate a stopped/canceled migration job
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var config = new Tencentcloud.Dts.MigrateJobConfig("config", new Tencentcloud.Dts.MigrateJobConfigArgs
    ///         {
    ///             JobId = tencentcloud_dts_migrate_job_start_operation.Start.Id,
    ///             Action = "isolate",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// Recover a isolated migration job
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var config = new Tencentcloud.Dts.MigrateJobConfig("config", new Tencentcloud.Dts.MigrateJobConfigArgs
    ///         {
    ///             JobId = tencentcloud_dts_migrate_job_start_operation.Start.Id,
    ///             Action = "recover",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Dts/migrateJobConfig:MigrateJobConfig")]
    public partial class MigrateJobConfig : Pulumi.CustomResource
    {
        /// <summary>
        /// The operation want to perform. Valid values are: `pause`, `continue`, `complete`, `recover`,`stop`.
        /// </summary>
        [Output("action")]
        public Output<string> Action { get; private set; } = null!;

        /// <summary>
        /// complete mode, optional value is waitForSync or immediately.
        /// </summary>
        [Output("completeMode")]
        public Output<string?> CompleteMode { get; private set; } = null!;

        /// <summary>
        /// job id.
        /// </summary>
        [Output("jobId")]
        public Output<string> JobId { get; private set; } = null!;


        /// <summary>
        /// Create a MigrateJobConfig resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public MigrateJobConfig(string name, MigrateJobConfigArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Dts/migrateJobConfig:MigrateJobConfig", name, args ?? new MigrateJobConfigArgs(), MakeResourceOptions(options, ""))
        {
        }

        private MigrateJobConfig(string name, Input<string> id, MigrateJobConfigState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Dts/migrateJobConfig:MigrateJobConfig", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/tencentcloudstack",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing MigrateJobConfig resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static MigrateJobConfig Get(string name, Input<string> id, MigrateJobConfigState? state = null, CustomResourceOptions? options = null)
        {
            return new MigrateJobConfig(name, id, state, options);
        }
    }

    public sealed class MigrateJobConfigArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The operation want to perform. Valid values are: `pause`, `continue`, `complete`, `recover`,`stop`.
        /// </summary>
        [Input("action", required: true)]
        public Input<string> Action { get; set; } = null!;

        /// <summary>
        /// complete mode, optional value is waitForSync or immediately.
        /// </summary>
        [Input("completeMode")]
        public Input<string>? CompleteMode { get; set; }

        /// <summary>
        /// job id.
        /// </summary>
        [Input("jobId", required: true)]
        public Input<string> JobId { get; set; } = null!;

        public MigrateJobConfigArgs()
        {
        }
    }

    public sealed class MigrateJobConfigState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The operation want to perform. Valid values are: `pause`, `continue`, `complete`, `recover`,`stop`.
        /// </summary>
        [Input("action")]
        public Input<string>? Action { get; set; }

        /// <summary>
        /// complete mode, optional value is waitForSync or immediately.
        /// </summary>
        [Input("completeMode")]
        public Input<string>? CompleteMode { get; set; }

        /// <summary>
        /// job id.
        /// </summary>
        [Input("jobId")]
        public Input<string>? JobId { get; set; }

        public MigrateJobConfigState()
        {
        }
    }
}
