registerJobDefinition

Registers an Batch job definition.

Samples

// This demonstrates calling the RegisterJobDefinition action, including tags.
val resp = batchClient.registerJobDefinition {
    jobDefinitionName = "sleep30"
    type = JobDefinitionType.fromValue("container")
    containerProperties = ContainerProperties {
        image = "busybox"
        command = listOf<String>(
            "sleep",
            "30"
        )
        resourceRequirements = listOf<ResourceRequirement>(
            ResourceRequirement {
                type = ResourceType.fromValue("MEMORY")
                value = "128"
            },
            ResourceRequirement {
                type = ResourceType.fromValue("VCPU")
                value = "1"
            }                
        )
    }
    tags = mapOf<String, String>(
        "Department" to "Engineering",
        "User" to "JaneDoe"
    )
}
// This example registers a job definition for a simple container job.
val resp = batchClient.registerJobDefinition {
    containerProperties = ContainerProperties {
        image = "busybox"
        command = listOf<String>(
            "sleep",
            "10"
        )
        resourceRequirements = listOf<ResourceRequirement>(
            ResourceRequirement {
                type = ResourceType.fromValue("MEMORY")
                value = "128"
            },
            ResourceRequirement {
                type = ResourceType.fromValue("VCPU")
                value = "1"
            }                
        )
    }
    type = JobDefinitionType.fromValue("container")
    jobDefinitionName = "sleep10"
}