All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.googlenative.vmmigration.v1alpha1.kotlin.CutoverJob.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.vmmigration.v1alpha1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.vmmigration.v1alpha1.kotlin.outputs.ComputeEngineTargetDetailsResponse
import com.pulumi.googlenative.vmmigration.v1alpha1.kotlin.outputs.CutoverStepResponse
import com.pulumi.googlenative.vmmigration.v1alpha1.kotlin.outputs.StatusResponse
import com.pulumi.googlenative.vmmigration.v1alpha1.kotlin.outputs.TargetVMDetailsResponse
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import com.pulumi.googlenative.vmmigration.v1alpha1.kotlin.outputs.ComputeEngineTargetDetailsResponse.Companion.toKotlin as computeEngineTargetDetailsResponseToKotlin
import com.pulumi.googlenative.vmmigration.v1alpha1.kotlin.outputs.CutoverStepResponse.Companion.toKotlin as cutoverStepResponseToKotlin
import com.pulumi.googlenative.vmmigration.v1alpha1.kotlin.outputs.StatusResponse.Companion.toKotlin as statusResponseToKotlin
import com.pulumi.googlenative.vmmigration.v1alpha1.kotlin.outputs.TargetVMDetailsResponse.Companion.toKotlin as targetVMDetailsResponseToKotlin

/**
 * Builder for [CutoverJob].
 */
@PulumiTagMarker
public class CutoverJobResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: CutoverJobArgs = CutoverJobArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend CutoverJobArgsBuilder.() -> Unit) {
        val builder = CutoverJobArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): CutoverJob {
        val builtJavaResource =
            com.pulumi.googlenative.vmmigration.v1alpha1.CutoverJob(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return CutoverJob(builtJavaResource)
    }
}

/**
 * Initiates a Cutover of a specific migrating VM. The returned LRO is completed when the cutover job resource is created and the job is initiated.
 * Auto-naming is currently not supported for this resource.
 * Note - this resource's API doesn't support deletion. When deleted, the resource will persist
 * on Google Cloud even though it will be deleted from Pulumi state.
 */
public class CutoverJob internal constructor(
    override val javaResource: com.pulumi.googlenative.vmmigration.v1alpha1.CutoverJob,
) : KotlinCustomResource(javaResource, CutoverJobMapper) {
    /**
     * Details of the target VM in Compute Engine.
     */
    public val computeEngineTargetDetails: Output
        get() = javaResource.computeEngineTargetDetails().applyValue({ args0 ->
            args0.let({ args0 ->
                computeEngineTargetDetailsResponseToKotlin(args0)
            })
        })

    /**
     * Details of the VM in Compute Engine. Deprecated: Use compute_engine_target_details instead.
     */
    @Deprecated(
        message = """
  Output only. Details of the VM in Compute Engine. Deprecated: Use compute_engine_target_details
      instead.
  """,
    )
    public val computeEngineVmDetails: Output
        get() = javaResource.computeEngineVmDetails().applyValue({ args0 ->
            args0.let({ args0 ->
                targetVMDetailsResponseToKotlin(args0)
            })
        })

    /**
     * The time the cutover job was created (as an API call, not when it was actually created in the target).
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Required. The cutover job identifier.
     */
    public val cutoverJobId: Output
        get() = javaResource.cutoverJobId().applyValue({ args0 -> args0 })

    /**
     * The time the cutover job had finished.
     */
    public val endTime: Output
        get() = javaResource.endTime().applyValue({ args0 -> args0 })

    /**
     * Provides details for the errors that led to the Cutover Job's state.
     */
    public val error: Output
        get() = javaResource.error().applyValue({ args0 ->
            args0.let({ args0 ->
                statusResponseToKotlin(args0)
            })
        })

    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    public val migratingVmId: Output
        get() = javaResource.migratingVmId().applyValue({ args0 -> args0 })

    /**
     * The name of the cutover job.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The current progress in percentage of the cutover job.
     */
    public val progress: Output
        get() = javaResource.progress().applyValue({ args0 -> args0 })

    /**
     * The current progress in percentage of the cutover job.
     */
    public val progressPercent: Output
        get() = javaResource.progressPercent().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * A request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
     */
    public val requestId: Output?
        get() = javaResource.requestId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    public val sourceId: Output
        get() = javaResource.sourceId().applyValue({ args0 -> args0 })

    /**
     * State of the cutover job.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * A message providing possible extra details about the current state.
     */
    public val stateMessage: Output
        get() = javaResource.stateMessage().applyValue({ args0 -> args0 })

    /**
     * The time the state was last updated.
     */
    public val stateTime: Output
        get() = javaResource.stateTime().applyValue({ args0 -> args0 })

    /**
     * The cutover steps list representing its progress.
     */
    public val steps: Output>
        get() = javaResource.steps().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    cutoverStepResponseToKotlin(args0)
                })
            })
        })

    /**
     * Details of the VM to create as the target of this cutover job. Deprecated: Use compute_engine_target_details instead.
     */
    @Deprecated(
        message = """
  Output only. Details of the VM to create as the target of this cutover job. Deprecated: Use
      compute_engine_target_details instead.
  """,
    )
    public val targetDetails: Output
        get() = javaResource.targetDetails().applyValue({ args0 ->
            args0.let({ args0 ->
                targetVMDetailsResponseToKotlin(args0)
            })
        })
}

public object CutoverJobMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.vmmigration.v1alpha1.CutoverJob::class == javaResource::class

    override fun map(javaResource: Resource): CutoverJob = CutoverJob(
        javaResource as
            com.pulumi.googlenative.vmmigration.v1alpha1.CutoverJob,
    )
}

/**
 * @see [CutoverJob].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [CutoverJob].
 */
public suspend fun cutoverJob(name: String, block: suspend CutoverJobResourceBuilder.() -> Unit): CutoverJob {
    val builder = CutoverJobResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [CutoverJob].
 * @param name The _unique_ name of the resulting resource.
 */
public fun cutoverJob(name: String): CutoverJob {
    val builder = CutoverJobResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy