/******************************************************************************* * Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * ***************************************************************************** * * AWS Tools for Windows (TM) PowerShell (TM) * */ using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Text; using Amazon.PowerShell.Common; using Amazon.Runtime; using Amazon.Batch; using Amazon.Batch.Model; namespace Amazon.PowerShell.Cmdlets.BAT { /// /// Registers an Batch job definition. /// [Cmdlet("Register", "BATJobDefinition", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType("Amazon.Batch.Model.RegisterJobDefinitionResponse")] [AWSCmdlet("Calls the AWS Batch RegisterJobDefinition API operation.", Operation = new[] {"RegisterJobDefinition"}, SelectReturnType = typeof(Amazon.Batch.Model.RegisterJobDefinitionResponse))] [AWSCmdletOutput("Amazon.Batch.Model.RegisterJobDefinitionResponse", "This cmdlet returns an Amazon.Batch.Model.RegisterJobDefinitionResponse object containing multiple properties. The object can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack." )] public partial class RegisterBATJobDefinitionCmdlet : AmazonBatchClientCmdlet, IExecutor { #region Parameter NetworkConfiguration_AssignPublicIp /// /// /// Indicates whether the job has a public IP address. For a job that's running on Fargate /// resources in a private subnet to send outbound traffic to the internet (for example, /// to pull container images), the private subnet requires a NAT gateway be attached to /// route requests to the internet. For more information, see Amazon /// ECS task networking in the Amazon Elastic Container Service Developer Guide. /// The default value is "DISABLED". /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_NetworkConfiguration_AssignPublicIp")] [AWSConstantClassSource("Amazon.Batch.AssignPublicIp")] public Amazon.Batch.AssignPublicIp NetworkConfiguration_AssignPublicIp { get; set; } #endregion #region Parameter RetryStrategy_Attempt /// /// /// The number of times to move a job to the RUNNABLE status. You can specify /// between 1 and 10 attempts. If the value of attempts is greater than one, /// the job is retried on failure the same number of attempts as the value. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("RetryStrategy_Attempts")] public System.Int32? RetryStrategy_Attempt { get; set; } #endregion #region Parameter ContainerProperties_Command /// /// /// The command that's passed to the container. This parameter maps to Cmd /// in the Create /// a container section of the Docker /// Remote API and the COMMAND parameter to docker /// run. For more information, see https://docs.docker.com/engine/reference/builder/#cmd. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String[] ContainerProperties_Command { get; set; } #endregion #region Parameter PodProperties_Container /// /// /// The properties of the container that's used on the Amazon EKS pod. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EksProperties_PodProperties_Containers")] public Amazon.Batch.Model.EksContainer[] PodProperties_Container { get; set; } #endregion #region Parameter RuntimePlatform_CpuArchitecture /// /// /// The vCPU architecture. The default value is X86_64. Valid values are /// X86_64 and ARM64.This parameter must be set to X86_64 for Windows containers. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_RuntimePlatform_CpuArchitecture")] public System.String RuntimePlatform_CpuArchitecture { get; set; } #endregion #region Parameter LinuxParameters_Device /// /// /// Any of the host devices to expose to the container. This parameter maps to Devices /// in the Create /// a container section of the Docker /// Remote API and the --device option to docker /// run.This parameter isn't applicable to jobs that are running on Fargate resources. Don't /// provide it for these jobs. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_LinuxParameters_Devices")] public Amazon.Batch.Model.Device[] LinuxParameters_Device { get; set; } #endregion #region Parameter PodProperties_DnsPolicy /// /// /// The DNS policy for the pod. The default value is ClusterFirst. If the /// hostNetwork parameter is not specified, the default is ClusterFirstWithHostNet. /// ClusterFirst indicates that any DNS query that does not match the configured /// cluster domain suffix is forwarded to the upstream nameserver inherited from the node. /// For more information, see Pod's /// DNS policy in the Kubernetes documentation.Valid values: Default | ClusterFirst | ClusterFirstWithHostNet /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EksProperties_PodProperties_DnsPolicy")] public System.String PodProperties_DnsPolicy { get; set; } #endregion #region Parameter ContainerProperties_Environment /// /// /// The environment variables to pass to a container. This parameter maps to Env /// in the Create /// a container section of the Docker /// Remote API and the --env option to docker /// run.We don't recommend using plaintext environment variables for sensitive information, /// such as credential data.Environment variables cannot start with "AWS_BATCH". This naming convention /// is reserved for variables that Batch sets. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public Amazon.Batch.Model.KeyValuePair[] ContainerProperties_Environment { get; set; } #endregion #region Parameter RetryStrategy_EvaluateOnExit /// /// /// Array of up to 5 objects that specify the conditions where jobs are retried or failed. /// If this parameter is specified, then the attempts parameter must also /// be specified. If none of the listed conditions match, then the job is retried. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public Amazon.Batch.Model.EvaluateOnExit[] RetryStrategy_EvaluateOnExit { get; set; } #endregion #region Parameter ContainerProperties_ExecutionRoleArn /// /// /// The Amazon Resource Name (ARN) of the execution role that Batch can assume. For jobs /// that run on Fargate resources, you must provide an execution role. For more information, /// see Batch /// execution IAM role in the Batch User Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String ContainerProperties_ExecutionRoleArn { get; set; } #endregion #region Parameter PodProperties_HostNetwork /// /// /// Indicates if the pod uses the hosts' network IP address. The default value is true. /// Setting this to false enables the Kubernetes pod networking model. Most /// Batch workloads are egress-only and don't require the overhead of IP allocation for /// each pod for incoming connections. For more information, see Host /// namespaces and Pod /// networking in the Kubernetes documentation. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EksProperties_PodProperties_HostNetwork")] public System.Boolean? PodProperties_HostNetwork { get; set; } #endregion #region Parameter ContainerProperties_Image /// /// /// The image used to start a container. This string is passed directly to the Docker /// daemon. Images in the Docker Hub registry are available by default. Other repositories /// are specified with repository-url/image:tag. It /// can be 255 characters long. It can contain uppercase and lowercase letters, numbers, /// hyphens (-), underscores (_), colons (:), periods (.), forward slashes (/), and number /// signs (#). This parameter maps to Image in the Create /// a container section of the Docker /// Remote API and the IMAGE parameter of docker /// run.Docker image architecture must match the processor architecture of the compute resources /// that they're scheduled on. For example, ARM-based Docker images can only run on ARM-based /// compute resources. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String ContainerProperties_Image { get; set; } #endregion #region Parameter LinuxParameters_InitProcessEnabled /// /// /// If true, run an init process inside the container that forwards signals /// and reaps processes. This parameter maps to the --init option to docker /// run. This parameter requires version 1.25 of the Docker Remote API or greater /// on your container instance. To check the Docker Remote API version on your container /// instance, log in to your container instance and run the following command: sudo /// docker version | grep "Server API version" /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_LinuxParameters_InitProcessEnabled")] public System.Boolean? LinuxParameters_InitProcessEnabled { get; set; } #endregion #region Parameter ContainerProperties_InstanceType /// /// /// The instance type to use for a multi-node parallel job. All node groups in a multi-node /// parallel job must use the same instance type.This parameter isn't applicable to single-node container jobs or jobs that run on /// Fargate resources, and shouldn't be provided. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String ContainerProperties_InstanceType { get; set; } #endregion #region Parameter JobDefinitionName /// /// /// The name of the job definition to register. It can be up to 128 letters long. It can /// contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_). /// /// #if !MODULAR [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)] #else [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)] [System.Management.Automation.AllowEmptyString] [System.Management.Automation.AllowNull] #endif [Amazon.PowerShell.Common.AWSRequiredParameter] public System.String JobDefinitionName { get; set; } #endregion #region Parameter ContainerProperties_JobRoleArn /// /// /// The Amazon Resource Name (ARN) of the IAM role that the container can assume for Amazon /// Web Services permissions. For more information, see IAM /// roles for tasks in the Amazon Elastic Container Service Developer Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String ContainerProperties_JobRoleArn { get; set; } #endregion #region Parameter Metadata_Label /// /// /// Key-value pairs used to identify, sort, and organize cube resources. Can contain up /// to 63 uppercase letters, lowercase letters, numbers, hyphens (-), and underscores /// (_). Labels can be added or modified at any time. Each resource can have multiple /// labels, but each key must be unique for a given object. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EksProperties_PodProperties_Metadata_Labels")] public System.Collections.Hashtable Metadata_Label { get; set; } #endregion #region Parameter LogConfiguration_LogDriver /// /// /// The log driver to use for the container. The valid values that are listed for this /// parameter are log drivers that the Amazon ECS container agent can communicate with /// by default.The supported log drivers are awslogs, fluentd, gelf, /// json-file, journald, logentries, syslog, /// and splunk.Jobs that are running on Fargate resources are restricted to the awslogs /// and splunk log drivers.
awslogs
Specifies the Amazon CloudWatch Logs logging driver. For more information, see Using /// the awslogs log driver in the Batch User Guide and Amazon /// CloudWatch Logs logging driver in the Docker documentation.
fluentd
Specifies the Fluentd logging driver. For more information including usage and options, /// see Fluentd logging /// driver in the Docker documentation.
gelf
Specifies the Graylog Extended Format (GELF) logging driver. For more information /// including usage and options, see Graylog /// Extended Format logging driver in the Docker documentation.
journald
Specifies the journald logging driver. For more information including usage and options, /// see Journald /// logging driver in the Docker documentation.
json-file
Specifies the JSON file logging driver. For more information including usage and options, /// see JSON File /// logging driver in the Docker documentation.
splunk
Specifies the Splunk logging driver. For more information including usage and options, /// see Splunk logging /// driver in the Docker documentation.
syslog
Specifies the syslog logging driver. For more information including usage and options, /// see Syslog logging /// driver in the Docker documentation.
If you have a custom driver that's not listed earlier that you want to work with the /// Amazon ECS container agent, you can fork the Amazon ECS container agent project that's /// available on GitHub and customize /// it to work with that driver. We encourage you to submit pull requests for changes /// that you want to have included. However, Amazon Web Services doesn't currently support /// running modified copies of this software.This parameter requires version 1.18 of the Docker Remote API or greater on your container /// instance. To check the Docker Remote API version on your container instance, log in /// to your container instance and run the following command: sudo docker version /// | grep "Server API version" ///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_LogConfiguration_LogDriver")] [AWSConstantClassSource("Amazon.Batch.LogDriver")] public Amazon.Batch.LogDriver LogConfiguration_LogDriver { get; set; } #endregion #region Parameter NodeProperties_MainNode /// /// /// Specifies the node index for the main node of a multi-node parallel job. This node /// index value must be fewer than the number of nodes. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? NodeProperties_MainNode { get; set; } #endregion #region Parameter LinuxParameters_MaxSwap /// /// /// The total amount of swap memory (in MiB) a container can use. This parameter is translated /// to the --memory-swap option to docker /// run where the value is the sum of the container memory plus the maxSwap /// value. For more information, see --memory-swap details in the Docker documentation.If a maxSwap value of 0 is specified, the container doesn't /// use swap. Accepted values are 0 or any positive integer. If the maxSwap /// parameter is omitted, the container doesn't use the swap configuration for the container /// instance that it's running on. A maxSwap value must be set for the swappiness /// parameter to be used.This parameter isn't applicable to jobs that are running on Fargate resources. Don't /// provide it for these jobs. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_LinuxParameters_MaxSwap")] public System.Int32? LinuxParameters_MaxSwap { get; set; } #endregion #region Parameter ContainerProperties_MountPoint /// /// /// The mount points for data volumes in your container. This parameter maps to Volumes /// in the Create /// a container section of the Docker /// Remote API and the --volume option to docker /// run. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_MountPoints")] public Amazon.Batch.Model.MountPoint[] ContainerProperties_MountPoint { get; set; } #endregion #region Parameter NodeProperties_NodeRangeProperty /// /// /// A list of node ranges and their properties that are associated with a multi-node parallel /// job. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("NodeProperties_NodeRangeProperties")] public Amazon.Batch.Model.NodeRangeProperty[] NodeProperties_NodeRangeProperty { get; set; } #endregion #region Parameter NodeProperties_NumNode /// /// /// The number of nodes that are associated with a multi-node parallel job. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("NodeProperties_NumNodes")] public System.Int32? NodeProperties_NumNode { get; set; } #endregion #region Parameter RuntimePlatform_OperatingSystemFamily /// /// /// The operating system for the compute environment. Valid values are: LINUX /// (default), WINDOWS_SERVER_2019_CORE, WINDOWS_SERVER_2019_FULL, /// WINDOWS_SERVER_2022_CORE, and WINDOWS_SERVER_2022_FULL.The following parameters can’t be set for Windows containers: linuxParameters, /// privileged, user, ulimits, readonlyRootFilesystem, /// and efsVolumeConfiguration.The Batch Scheduler checks before registering a task definition with Fargate. If the /// job requires a Windows container and the first compute environment is LINUX, /// the compute environment is skipped and the next is checked until a Windows-based compute /// environment is found.Fargate Spot is not supported for Windows-based containers on Fargate. A job queue /// will be blocked if a Fargate Windows job is submitted to a job queue with only Fargate /// Spot compute environments. However, you can attach both FARGATE and FARGATE_SPOT /// compute environments to the same job queue. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_RuntimePlatform_OperatingSystemFamily")] public System.String RuntimePlatform_OperatingSystemFamily { get; set; } #endregion #region Parameter LogConfiguration_Option /// /// /// The configuration options to send to the log driver. This parameter requires version /// 1.19 of the Docker Remote API or greater on your container instance. To check the /// Docker Remote API version on your container instance, log in to your container instance /// and run the following command: sudo docker version | grep "Server API version" /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_LogConfiguration_Options")] public System.Collections.Hashtable LogConfiguration_Option { get; set; } #endregion #region Parameter Parameter /// /// /// Default parameter substitution placeholders to set in the job definition. Parameters /// are specified as a key-value pair mapping. Parameters in a SubmitJob /// request override any corresponding parameter defaults from the job definition. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Parameters")] public System.Collections.Hashtable Parameter { get; set; } #endregion #region Parameter PlatformCapability /// /// /// The platform capabilities required by the job definition. If no value is specified, /// it defaults to EC2. To run the job on Fargate resources, specify FARGATE.If the job runs on Amazon EKS resources, then you must not specify platformCapabilities. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("PlatformCapabilities")] public System.String[] PlatformCapability { get; set; } #endregion #region Parameter FargatePlatformConfiguration_PlatformVersion /// /// /// The Fargate platform version where the jobs are running. A platform version is specified /// only for jobs that are running on Fargate resources. If one isn't specified, the LATEST /// platform version is used by default. This uses a recent, approved version of the Fargate /// platform for compute resources. For more information, see Fargate /// platform versions in the Amazon Elastic Container Service Developer Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_FargatePlatformConfiguration_PlatformVersion")] public System.String FargatePlatformConfiguration_PlatformVersion { get; set; } #endregion #region Parameter ContainerProperties_Privileged /// /// /// When this parameter is true, the container is given elevated permissions on the host /// container instance (similar to the root user). This parameter maps to /// Privileged in the Create /// a container section of the Docker /// Remote API and the --privileged option to docker /// run. The default value is false.This parameter isn't applicable to jobs that are running on Fargate resources and /// shouldn't be provided, or specified as false. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? ContainerProperties_Privileged { get; set; } #endregion #region Parameter PropagateTag /// /// /// Specifies whether to propagate the tags from the job or job definition to the corresponding /// Amazon ECS task. If no value is specified, the tags are not propagated. Tags can only /// be propagated to the tasks during task creation. For tags with the same name, job /// tags are given priority over job definitions tags. If the total number of combined /// tags from the job and job definition is over 50, the job is moved to the FAILED /// state.If the job runs on Amazon EKS resources, then you must not specify propagateTags. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("PropagateTags")] public System.Boolean? PropagateTag { get; set; } #endregion #region Parameter ContainerProperties_ReadonlyRootFilesystem /// /// /// When this parameter is true, the container is given read-only access to its root file /// system. This parameter maps to ReadonlyRootfs in the Create /// a container section of the Docker /// Remote API and the --read-only option to docker run. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? ContainerProperties_ReadonlyRootFilesystem { get; set; } #endregion #region Parameter ContainerProperties_ResourceRequirement /// /// /// The type and amount of resources to assign to a container. The supported resources /// include GPU, MEMORY, and VCPU. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_ResourceRequirements")] public Amazon.Batch.Model.ResourceRequirement[] ContainerProperties_ResourceRequirement { get; set; } #endregion #region Parameter SchedulingPriority /// /// /// The scheduling priority for jobs that are submitted with this job definition. This /// only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling /// priority are scheduled before jobs with a lower scheduling priority.The minimum supported value is 0 and the maximum supported value is 9999. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? SchedulingPriority { get; set; } #endregion #region Parameter LogConfiguration_SecretOption /// /// /// The secrets to pass to the log configuration. For more information, see Specifying /// sensitive data in the Batch User Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_LogConfiguration_SecretOptions")] public Amazon.Batch.Model.Secret[] LogConfiguration_SecretOption { get; set; } #endregion #region Parameter ContainerProperties_Secret /// /// /// The secrets for the container. For more information, see Specifying /// sensitive data in the Batch User Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_Secrets")] public Amazon.Batch.Model.Secret[] ContainerProperties_Secret { get; set; } #endregion #region Parameter PodProperties_ServiceAccountName /// /// /// The name of the service account that's used to run the pod. For more information, /// see Kubernetes /// service accounts and Configure /// a Kubernetes service account to assume an IAM role in the Amazon EKS User Guide /// and Configure /// service accounts for pods in the Kubernetes documentation. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EksProperties_PodProperties_ServiceAccountName")] public System.String PodProperties_ServiceAccountName { get; set; } #endregion #region Parameter LinuxParameters_SharedMemorySize /// /// /// The value for the size (in MiB) of the /dev/shm volume. This parameter /// maps to the --shm-size option to docker /// run.This parameter isn't applicable to jobs that are running on Fargate resources. Don't /// provide it for these jobs. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_LinuxParameters_SharedMemorySize")] public System.Int32? LinuxParameters_SharedMemorySize { get; set; } #endregion #region Parameter EphemeralStorage_SizeInGiB /// /// /// The total amount, in GiB, of ephemeral storage to set for the task. The minimum supported /// value is 21 GiB and the maximum supported value is 200 GiB. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_EphemeralStorage_SizeInGiB")] public System.Int32? EphemeralStorage_SizeInGiB { get; set; } #endregion #region Parameter LinuxParameters_Swappiness /// /// /// You can use this parameter to tune a container's memory swappiness behavior. A swappiness /// value of 0 causes swapping to not occur unless absolutely necessary. /// A swappiness value of 100 causes pages to be swapped aggressively. /// Valid values are whole numbers between 0 and 100. If the /// swappiness parameter isn't specified, a default value of 60 /// is used. If a value isn't specified for maxSwap, then this parameter /// is ignored. If maxSwap is set to 0, the container doesn't use swap. This /// parameter maps to the --memory-swappiness option to docker /// run.Consider the following when you use a per-container swap configuration.This parameter isn't applicable to jobs that are running on Fargate resources. Don't /// provide it for these jobs. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_LinuxParameters_Swappiness")] public System.Int32? LinuxParameters_Swappiness { get; set; } #endregion #region Parameter Tag /// /// /// The tags that you apply to the job definition to help you categorize and organize /// your resources. Each tag consists of a key and an optional value. For more information, /// see Tagging /// Amazon Web Services Resources in Batch User Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Tags")] public System.Collections.Hashtable Tag { get; set; } #endregion #region Parameter Timeout /// /// /// The timeout configuration for jobs that are submitted with this job definition, after /// which Batch terminates your jobs if they have not finished. If a job is terminated /// due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds. /// Any timeout configuration that's specified during a SubmitJob operation overrides /// the timeout configuration defined here. For more information, see Job /// Timeouts in the Batch User Guide. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public Amazon.Batch.Model.JobTimeout Timeout { get; set; } #endregion #region Parameter LinuxParameters_Tmpf /// /// /// The container path, mount options, and size (in MiB) of the tmpfs mount. /// This parameter maps to the --tmpfs option to docker /// run.This parameter isn't applicable to jobs that are running on Fargate resources. Don't /// provide this parameter for this resource type. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_LinuxParameters_Tmpfs")] public Amazon.Batch.Model.Tmpfs[] LinuxParameters_Tmpf { get; set; } #endregion #region Parameter Type /// /// /// The type of job definition. For more information about multi-node parallel jobs, see /// Creating /// a multi-node parallel job definition in the Batch User Guide.If the job is run on Fargate resources, then multinode isn't supported. /// /// #if !MODULAR [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] #else [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)] [System.Management.Automation.AllowNull] #endif [Amazon.PowerShell.Common.AWSRequiredParameter] [AWSConstantClassSource("Amazon.Batch.JobDefinitionType")] public Amazon.Batch.JobDefinitionType Type { get; set; } #endregion #region Parameter ContainerProperties_Ulimit /// /// /// A list of ulimits to set in the container. This parameter maps to Ulimits /// in the Create /// a container section of the Docker /// Remote API and the --ulimit option to docker /// run.This parameter isn't applicable to jobs that are running on Fargate resources and /// shouldn't be provided. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_Ulimits")] public Amazon.Batch.Model.Ulimit[] ContainerProperties_Ulimit { get; set; } #endregion #region Parameter ContainerProperties_User /// /// /// The user name to use inside the container. This parameter maps to User /// in the Create /// a container section of the Docker /// Remote API and the --user option to docker /// run. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String ContainerProperties_User { get; set; } #endregion #region Parameter ContainerProperties_Volume /// /// /// A list of data volumes used in a job. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContainerProperties_Volumes")] public Amazon.Batch.Model.Volume[] ContainerProperties_Volume { get; set; } #endregion #region Parameter PodProperties_Volume /// /// /// Specifies the volumes for a job definition that uses Amazon EKS resources. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("EksProperties_PodProperties_Volumes")] public Amazon.Batch.Model.EksVolume[] PodProperties_Volume { get; set; } #endregion #region Parameter ContainerProperties_Memory /// /// /// This parameter is deprecated, use resourceRequirements to specify the /// memory requirements for the job definition. It's not supported for jobs running on /// Fargate resources. For jobs that run on EC2 resources, it specifies the memory hard /// limit (in MiB) for a container. If your container attempts to exceed the specified /// number, it's terminated. You must specify at least 4 MiB of memory for a job using /// this parameter. The memory hard limit can be specified in several places. It must /// be specified for each node at least once. /// /// This parameter is deprecated. /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [System.ObsoleteAttribute("This field is deprecated, use resourceRequirements instead.")] public System.Int32? ContainerProperties_Memory { get; set; } #endregion #region Parameter ContainerProperties_Vcpus /// /// /// This parameter is deprecated, use resourceRequirements to specify the /// vCPU requirements for the job definition. It's not supported for jobs running on Fargate /// resources. For jobs running on EC2 resources, it specifies the number of vCPUs reserved /// for the job.Each vCPU is equivalent to 1,024 CPU shares. This parameter maps to CpuShares /// in the Create /// a container section of the Docker /// Remote API and the --cpu-shares option to docker /// run. The number of vCPUs must be specified but can be specified in several places. /// You must specify it at least once for each node. /// /// This parameter is deprecated. /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [System.ObsoleteAttribute("This field is deprecated, use resourceRequirements instead.")] public System.Int32? ContainerProperties_Vcpus { get; set; } #endregion #region Parameter Select /// /// Use the -Select parameter to control the cmdlet output. The default value is '*'. /// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.Batch.Model.RegisterJobDefinitionResponse). /// Specifying the name of a property of type Amazon.Batch.Model.RegisterJobDefinitionResponse will result in that property being returned. /// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value. /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public string Select { get; set; } = "*"; #endregion #region Parameter PassThru /// /// Changes the cmdlet behavior to return the value passed to the JobDefinitionName parameter. /// The -PassThru parameter is deprecated, use -Select '^JobDefinitionName' instead. This parameter will be removed in a future version. /// [System.Obsolete("The -PassThru parameter is deprecated, use -Select '^JobDefinitionName' instead. This parameter will be removed in a future version.")] [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter PassThru { get; set; } #endregion #region Parameter Force /// /// This parameter overrides confirmation prompts to force /// the cmdlet to continue its operation. This parameter should always /// be used with caution. /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter Force { get; set; } #endregion protected override void ProcessRecord() { this._AWSSignerType = "v4"; base.ProcessRecord(); var resourceIdentifiersText = FormatParameterValuesForConfirmationMsg(nameof(this.JobDefinitionName), MyInvocation.BoundParameters); if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "Register-BATJobDefinition (RegisterJobDefinition)")) { return; } var context = new CmdletContext(); // allow for manipulation of parameters prior to loading into context PreExecutionContextLoad(context); #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute if (ParameterWasBound(nameof(this.Select))) { context.Select = CreateSelectDelegate(Select) ?? throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select)); if (this.PassThru.IsPresent) { throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select)); } } else if (this.PassThru.IsPresent) { context.Select = (response, cmdlet) => this.JobDefinitionName; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute if (this.ContainerProperties_Command != null) { context.ContainerProperties_Command = new List(this.ContainerProperties_Command); } if (this.ContainerProperties_Environment != null) { context.ContainerProperties_Environment = new List(this.ContainerProperties_Environment); } context.EphemeralStorage_SizeInGiB = this.EphemeralStorage_SizeInGiB; context.ContainerProperties_ExecutionRoleArn = this.ContainerProperties_ExecutionRoleArn; context.FargatePlatformConfiguration_PlatformVersion = this.FargatePlatformConfiguration_PlatformVersion; context.ContainerProperties_Image = this.ContainerProperties_Image; context.ContainerProperties_InstanceType = this.ContainerProperties_InstanceType; context.ContainerProperties_JobRoleArn = this.ContainerProperties_JobRoleArn; if (this.LinuxParameters_Device != null) { context.LinuxParameters_Device = new List(this.LinuxParameters_Device); } context.LinuxParameters_InitProcessEnabled = this.LinuxParameters_InitProcessEnabled; context.LinuxParameters_MaxSwap = this.LinuxParameters_MaxSwap; context.LinuxParameters_SharedMemorySize = this.LinuxParameters_SharedMemorySize; context.LinuxParameters_Swappiness = this.LinuxParameters_Swappiness; if (this.LinuxParameters_Tmpf != null) { context.LinuxParameters_Tmpf = new List(this.LinuxParameters_Tmpf); } context.LogConfiguration_LogDriver = this.LogConfiguration_LogDriver; if (this.LogConfiguration_Option != null) { context.LogConfiguration_Option = new Dictionary(StringComparer.Ordinal); foreach (var hashKey in this.LogConfiguration_Option.Keys) { context.LogConfiguration_Option.Add((String)hashKey, (String)(this.LogConfiguration_Option[hashKey])); } } if (this.LogConfiguration_SecretOption != null) { context.LogConfiguration_SecretOption = new List(this.LogConfiguration_SecretOption); } #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute context.ContainerProperties_Memory = this.ContainerProperties_Memory; #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute if (this.ContainerProperties_MountPoint != null) { context.ContainerProperties_MountPoint = new List(this.ContainerProperties_MountPoint); } context.NetworkConfiguration_AssignPublicIp = this.NetworkConfiguration_AssignPublicIp; context.ContainerProperties_Privileged = this.ContainerProperties_Privileged; context.ContainerProperties_ReadonlyRootFilesystem = this.ContainerProperties_ReadonlyRootFilesystem; if (this.ContainerProperties_ResourceRequirement != null) { context.ContainerProperties_ResourceRequirement = new List(this.ContainerProperties_ResourceRequirement); } context.RuntimePlatform_CpuArchitecture = this.RuntimePlatform_CpuArchitecture; context.RuntimePlatform_OperatingSystemFamily = this.RuntimePlatform_OperatingSystemFamily; if (this.ContainerProperties_Secret != null) { context.ContainerProperties_Secret = new List(this.ContainerProperties_Secret); } if (this.ContainerProperties_Ulimit != null) { context.ContainerProperties_Ulimit = new List(this.ContainerProperties_Ulimit); } context.ContainerProperties_User = this.ContainerProperties_User; #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute context.ContainerProperties_Vcpus = this.ContainerProperties_Vcpus; #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute if (this.ContainerProperties_Volume != null) { context.ContainerProperties_Volume = new List(this.ContainerProperties_Volume); } if (this.PodProperties_Container != null) { context.PodProperties_Container = new List(this.PodProperties_Container); } context.PodProperties_DnsPolicy = this.PodProperties_DnsPolicy; context.PodProperties_HostNetwork = this.PodProperties_HostNetwork; if (this.Metadata_Label != null) { context.Metadata_Label = new Dictionary(StringComparer.Ordinal); foreach (var hashKey in this.Metadata_Label.Keys) { context.Metadata_Label.Add((String)hashKey, (String)(this.Metadata_Label[hashKey])); } } context.PodProperties_ServiceAccountName = this.PodProperties_ServiceAccountName; if (this.PodProperties_Volume != null) { context.PodProperties_Volume = new List(this.PodProperties_Volume); } context.JobDefinitionName = this.JobDefinitionName; #if MODULAR if (this.JobDefinitionName == null && ParameterWasBound(nameof(this.JobDefinitionName))) { WriteWarning("You are passing $null as a value for parameter JobDefinitionName which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues."); } #endif context.NodeProperties_MainNode = this.NodeProperties_MainNode; if (this.NodeProperties_NodeRangeProperty != null) { context.NodeProperties_NodeRangeProperty = new List(this.NodeProperties_NodeRangeProperty); } context.NodeProperties_NumNode = this.NodeProperties_NumNode; if (this.Parameter != null) { context.Parameter = new Dictionary(StringComparer.Ordinal); foreach (var hashKey in this.Parameter.Keys) { context.Parameter.Add((String)hashKey, (String)(this.Parameter[hashKey])); } } if (this.PlatformCapability != null) { context.PlatformCapability = new List(this.PlatformCapability); } context.PropagateTag = this.PropagateTag; context.RetryStrategy_Attempt = this.RetryStrategy_Attempt; if (this.RetryStrategy_EvaluateOnExit != null) { context.RetryStrategy_EvaluateOnExit = new List(this.RetryStrategy_EvaluateOnExit); } context.SchedulingPriority = this.SchedulingPriority; if (this.Tag != null) { context.Tag = new Dictionary(StringComparer.Ordinal); foreach (var hashKey in this.Tag.Keys) { context.Tag.Add((String)hashKey, (String)(this.Tag[hashKey])); } } context.Timeout = this.Timeout; context.Type = this.Type; #if MODULAR if (this.Type == null && ParameterWasBound(nameof(this.Type))) { WriteWarning("You are passing $null as a value for parameter Type which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues."); } #endif // allow further manipulation of loaded context prior to processing PostExecutionContextLoad(context); var output = Execute(context) as CmdletOutput; ProcessOutput(output); } #region IExecutor Members public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Batch.Model.RegisterJobDefinitionRequest(); // populate ContainerProperties var requestContainerPropertiesIsNull = true; request.ContainerProperties = new Amazon.Batch.Model.ContainerProperties(); List requestContainerProperties_containerProperties_Command = null; if (cmdletContext.ContainerProperties_Command != null) { requestContainerProperties_containerProperties_Command = cmdletContext.ContainerProperties_Command; } if (requestContainerProperties_containerProperties_Command != null) { request.ContainerProperties.Command = requestContainerProperties_containerProperties_Command; requestContainerPropertiesIsNull = false; } List requestContainerProperties_containerProperties_Environment = null; if (cmdletContext.ContainerProperties_Environment != null) { requestContainerProperties_containerProperties_Environment = cmdletContext.ContainerProperties_Environment; } if (requestContainerProperties_containerProperties_Environment != null) { request.ContainerProperties.Environment = requestContainerProperties_containerProperties_Environment; requestContainerPropertiesIsNull = false; } System.String requestContainerProperties_containerProperties_ExecutionRoleArn = null; if (cmdletContext.ContainerProperties_ExecutionRoleArn != null) { requestContainerProperties_containerProperties_ExecutionRoleArn = cmdletContext.ContainerProperties_ExecutionRoleArn; } if (requestContainerProperties_containerProperties_ExecutionRoleArn != null) { request.ContainerProperties.ExecutionRoleArn = requestContainerProperties_containerProperties_ExecutionRoleArn; requestContainerPropertiesIsNull = false; } System.String requestContainerProperties_containerProperties_Image = null; if (cmdletContext.ContainerProperties_Image != null) { requestContainerProperties_containerProperties_Image = cmdletContext.ContainerProperties_Image; } if (requestContainerProperties_containerProperties_Image != null) { request.ContainerProperties.Image = requestContainerProperties_containerProperties_Image; requestContainerPropertiesIsNull = false; } System.String requestContainerProperties_containerProperties_InstanceType = null; if (cmdletContext.ContainerProperties_InstanceType != null) { requestContainerProperties_containerProperties_InstanceType = cmdletContext.ContainerProperties_InstanceType; } if (requestContainerProperties_containerProperties_InstanceType != null) { request.ContainerProperties.InstanceType = requestContainerProperties_containerProperties_InstanceType; requestContainerPropertiesIsNull = false; } System.String requestContainerProperties_containerProperties_JobRoleArn = null; if (cmdletContext.ContainerProperties_JobRoleArn != null) { requestContainerProperties_containerProperties_JobRoleArn = cmdletContext.ContainerProperties_JobRoleArn; } if (requestContainerProperties_containerProperties_JobRoleArn != null) { request.ContainerProperties.JobRoleArn = requestContainerProperties_containerProperties_JobRoleArn; requestContainerPropertiesIsNull = false; } #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute System.Int32? requestContainerProperties_containerProperties_Memory = null; if (cmdletContext.ContainerProperties_Memory != null) { requestContainerProperties_containerProperties_Memory = cmdletContext.ContainerProperties_Memory.Value; } if (requestContainerProperties_containerProperties_Memory != null) { request.ContainerProperties.Memory = requestContainerProperties_containerProperties_Memory.Value; requestContainerPropertiesIsNull = false; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute List requestContainerProperties_containerProperties_MountPoint = null; if (cmdletContext.ContainerProperties_MountPoint != null) { requestContainerProperties_containerProperties_MountPoint = cmdletContext.ContainerProperties_MountPoint; } if (requestContainerProperties_containerProperties_MountPoint != null) { request.ContainerProperties.MountPoints = requestContainerProperties_containerProperties_MountPoint; requestContainerPropertiesIsNull = false; } System.Boolean? requestContainerProperties_containerProperties_Privileged = null; if (cmdletContext.ContainerProperties_Privileged != null) { requestContainerProperties_containerProperties_Privileged = cmdletContext.ContainerProperties_Privileged.Value; } if (requestContainerProperties_containerProperties_Privileged != null) { request.ContainerProperties.Privileged = requestContainerProperties_containerProperties_Privileged.Value; requestContainerPropertiesIsNull = false; } System.Boolean? requestContainerProperties_containerProperties_ReadonlyRootFilesystem = null; if (cmdletContext.ContainerProperties_ReadonlyRootFilesystem != null) { requestContainerProperties_containerProperties_ReadonlyRootFilesystem = cmdletContext.ContainerProperties_ReadonlyRootFilesystem.Value; } if (requestContainerProperties_containerProperties_ReadonlyRootFilesystem != null) { request.ContainerProperties.ReadonlyRootFilesystem = requestContainerProperties_containerProperties_ReadonlyRootFilesystem.Value; requestContainerPropertiesIsNull = false; } List requestContainerProperties_containerProperties_ResourceRequirement = null; if (cmdletContext.ContainerProperties_ResourceRequirement != null) { requestContainerProperties_containerProperties_ResourceRequirement = cmdletContext.ContainerProperties_ResourceRequirement; } if (requestContainerProperties_containerProperties_ResourceRequirement != null) { request.ContainerProperties.ResourceRequirements = requestContainerProperties_containerProperties_ResourceRequirement; requestContainerPropertiesIsNull = false; } List requestContainerProperties_containerProperties_Secret = null; if (cmdletContext.ContainerProperties_Secret != null) { requestContainerProperties_containerProperties_Secret = cmdletContext.ContainerProperties_Secret; } if (requestContainerProperties_containerProperties_Secret != null) { request.ContainerProperties.Secrets = requestContainerProperties_containerProperties_Secret; requestContainerPropertiesIsNull = false; } List requestContainerProperties_containerProperties_Ulimit = null; if (cmdletContext.ContainerProperties_Ulimit != null) { requestContainerProperties_containerProperties_Ulimit = cmdletContext.ContainerProperties_Ulimit; } if (requestContainerProperties_containerProperties_Ulimit != null) { request.ContainerProperties.Ulimits = requestContainerProperties_containerProperties_Ulimit; requestContainerPropertiesIsNull = false; } System.String requestContainerProperties_containerProperties_User = null; if (cmdletContext.ContainerProperties_User != null) { requestContainerProperties_containerProperties_User = cmdletContext.ContainerProperties_User; } if (requestContainerProperties_containerProperties_User != null) { request.ContainerProperties.User = requestContainerProperties_containerProperties_User; requestContainerPropertiesIsNull = false; } #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute System.Int32? requestContainerProperties_containerProperties_Vcpus = null; if (cmdletContext.ContainerProperties_Vcpus != null) { requestContainerProperties_containerProperties_Vcpus = cmdletContext.ContainerProperties_Vcpus.Value; } if (requestContainerProperties_containerProperties_Vcpus != null) { request.ContainerProperties.Vcpus = requestContainerProperties_containerProperties_Vcpus.Value; requestContainerPropertiesIsNull = false; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute List requestContainerProperties_containerProperties_Volume = null; if (cmdletContext.ContainerProperties_Volume != null) { requestContainerProperties_containerProperties_Volume = cmdletContext.ContainerProperties_Volume; } if (requestContainerProperties_containerProperties_Volume != null) { request.ContainerProperties.Volumes = requestContainerProperties_containerProperties_Volume; requestContainerPropertiesIsNull = false; } Amazon.Batch.Model.EphemeralStorage requestContainerProperties_containerProperties_EphemeralStorage = null; // populate EphemeralStorage var requestContainerProperties_containerProperties_EphemeralStorageIsNull = true; requestContainerProperties_containerProperties_EphemeralStorage = new Amazon.Batch.Model.EphemeralStorage(); System.Int32? requestContainerProperties_containerProperties_EphemeralStorage_ephemeralStorage_SizeInGiB = null; if (cmdletContext.EphemeralStorage_SizeInGiB != null) { requestContainerProperties_containerProperties_EphemeralStorage_ephemeralStorage_SizeInGiB = cmdletContext.EphemeralStorage_SizeInGiB.Value; } if (requestContainerProperties_containerProperties_EphemeralStorage_ephemeralStorage_SizeInGiB != null) { requestContainerProperties_containerProperties_EphemeralStorage.SizeInGiB = requestContainerProperties_containerProperties_EphemeralStorage_ephemeralStorage_SizeInGiB.Value; requestContainerProperties_containerProperties_EphemeralStorageIsNull = false; } // determine if requestContainerProperties_containerProperties_EphemeralStorage should be set to null if (requestContainerProperties_containerProperties_EphemeralStorageIsNull) { requestContainerProperties_containerProperties_EphemeralStorage = null; } if (requestContainerProperties_containerProperties_EphemeralStorage != null) { request.ContainerProperties.EphemeralStorage = requestContainerProperties_containerProperties_EphemeralStorage; requestContainerPropertiesIsNull = false; } Amazon.Batch.Model.FargatePlatformConfiguration requestContainerProperties_containerProperties_FargatePlatformConfiguration = null; // populate FargatePlatformConfiguration var requestContainerProperties_containerProperties_FargatePlatformConfigurationIsNull = true; requestContainerProperties_containerProperties_FargatePlatformConfiguration = new Amazon.Batch.Model.FargatePlatformConfiguration(); System.String requestContainerProperties_containerProperties_FargatePlatformConfiguration_fargatePlatformConfiguration_PlatformVersion = null; if (cmdletContext.FargatePlatformConfiguration_PlatformVersion != null) { requestContainerProperties_containerProperties_FargatePlatformConfiguration_fargatePlatformConfiguration_PlatformVersion = cmdletContext.FargatePlatformConfiguration_PlatformVersion; } if (requestContainerProperties_containerProperties_FargatePlatformConfiguration_fargatePlatformConfiguration_PlatformVersion != null) { requestContainerProperties_containerProperties_FargatePlatformConfiguration.PlatformVersion = requestContainerProperties_containerProperties_FargatePlatformConfiguration_fargatePlatformConfiguration_PlatformVersion; requestContainerProperties_containerProperties_FargatePlatformConfigurationIsNull = false; } // determine if requestContainerProperties_containerProperties_FargatePlatformConfiguration should be set to null if (requestContainerProperties_containerProperties_FargatePlatformConfigurationIsNull) { requestContainerProperties_containerProperties_FargatePlatformConfiguration = null; } if (requestContainerProperties_containerProperties_FargatePlatformConfiguration != null) { request.ContainerProperties.FargatePlatformConfiguration = requestContainerProperties_containerProperties_FargatePlatformConfiguration; requestContainerPropertiesIsNull = false; } Amazon.Batch.Model.NetworkConfiguration requestContainerProperties_containerProperties_NetworkConfiguration = null; // populate NetworkConfiguration var requestContainerProperties_containerProperties_NetworkConfigurationIsNull = true; requestContainerProperties_containerProperties_NetworkConfiguration = new Amazon.Batch.Model.NetworkConfiguration(); Amazon.Batch.AssignPublicIp requestContainerProperties_containerProperties_NetworkConfiguration_networkConfiguration_AssignPublicIp = null; if (cmdletContext.NetworkConfiguration_AssignPublicIp != null) { requestContainerProperties_containerProperties_NetworkConfiguration_networkConfiguration_AssignPublicIp = cmdletContext.NetworkConfiguration_AssignPublicIp; } if (requestContainerProperties_containerProperties_NetworkConfiguration_networkConfiguration_AssignPublicIp != null) { requestContainerProperties_containerProperties_NetworkConfiguration.AssignPublicIp = requestContainerProperties_containerProperties_NetworkConfiguration_networkConfiguration_AssignPublicIp; requestContainerProperties_containerProperties_NetworkConfigurationIsNull = false; } // determine if requestContainerProperties_containerProperties_NetworkConfiguration should be set to null if (requestContainerProperties_containerProperties_NetworkConfigurationIsNull) { requestContainerProperties_containerProperties_NetworkConfiguration = null; } if (requestContainerProperties_containerProperties_NetworkConfiguration != null) { request.ContainerProperties.NetworkConfiguration = requestContainerProperties_containerProperties_NetworkConfiguration; requestContainerPropertiesIsNull = false; } Amazon.Batch.Model.RuntimePlatform requestContainerProperties_containerProperties_RuntimePlatform = null; // populate RuntimePlatform var requestContainerProperties_containerProperties_RuntimePlatformIsNull = true; requestContainerProperties_containerProperties_RuntimePlatform = new Amazon.Batch.Model.RuntimePlatform(); System.String requestContainerProperties_containerProperties_RuntimePlatform_runtimePlatform_CpuArchitecture = null; if (cmdletContext.RuntimePlatform_CpuArchitecture != null) { requestContainerProperties_containerProperties_RuntimePlatform_runtimePlatform_CpuArchitecture = cmdletContext.RuntimePlatform_CpuArchitecture; } if (requestContainerProperties_containerProperties_RuntimePlatform_runtimePlatform_CpuArchitecture != null) { requestContainerProperties_containerProperties_RuntimePlatform.CpuArchitecture = requestContainerProperties_containerProperties_RuntimePlatform_runtimePlatform_CpuArchitecture; requestContainerProperties_containerProperties_RuntimePlatformIsNull = false; } System.String requestContainerProperties_containerProperties_RuntimePlatform_runtimePlatform_OperatingSystemFamily = null; if (cmdletContext.RuntimePlatform_OperatingSystemFamily != null) { requestContainerProperties_containerProperties_RuntimePlatform_runtimePlatform_OperatingSystemFamily = cmdletContext.RuntimePlatform_OperatingSystemFamily; } if (requestContainerProperties_containerProperties_RuntimePlatform_runtimePlatform_OperatingSystemFamily != null) { requestContainerProperties_containerProperties_RuntimePlatform.OperatingSystemFamily = requestContainerProperties_containerProperties_RuntimePlatform_runtimePlatform_OperatingSystemFamily; requestContainerProperties_containerProperties_RuntimePlatformIsNull = false; } // determine if requestContainerProperties_containerProperties_RuntimePlatform should be set to null if (requestContainerProperties_containerProperties_RuntimePlatformIsNull) { requestContainerProperties_containerProperties_RuntimePlatform = null; } if (requestContainerProperties_containerProperties_RuntimePlatform != null) { request.ContainerProperties.RuntimePlatform = requestContainerProperties_containerProperties_RuntimePlatform; requestContainerPropertiesIsNull = false; } Amazon.Batch.Model.LogConfiguration requestContainerProperties_containerProperties_LogConfiguration = null; // populate LogConfiguration var requestContainerProperties_containerProperties_LogConfigurationIsNull = true; requestContainerProperties_containerProperties_LogConfiguration = new Amazon.Batch.Model.LogConfiguration(); Amazon.Batch.LogDriver requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_LogDriver = null; if (cmdletContext.LogConfiguration_LogDriver != null) { requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_LogDriver = cmdletContext.LogConfiguration_LogDriver; } if (requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_LogDriver != null) { requestContainerProperties_containerProperties_LogConfiguration.LogDriver = requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_LogDriver; requestContainerProperties_containerProperties_LogConfigurationIsNull = false; } Dictionary requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_Option = null; if (cmdletContext.LogConfiguration_Option != null) { requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_Option = cmdletContext.LogConfiguration_Option; } if (requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_Option != null) { requestContainerProperties_containerProperties_LogConfiguration.Options = requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_Option; requestContainerProperties_containerProperties_LogConfigurationIsNull = false; } List requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_SecretOption = null; if (cmdletContext.LogConfiguration_SecretOption != null) { requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_SecretOption = cmdletContext.LogConfiguration_SecretOption; } if (requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_SecretOption != null) { requestContainerProperties_containerProperties_LogConfiguration.SecretOptions = requestContainerProperties_containerProperties_LogConfiguration_logConfiguration_SecretOption; requestContainerProperties_containerProperties_LogConfigurationIsNull = false; } // determine if requestContainerProperties_containerProperties_LogConfiguration should be set to null if (requestContainerProperties_containerProperties_LogConfigurationIsNull) { requestContainerProperties_containerProperties_LogConfiguration = null; } if (requestContainerProperties_containerProperties_LogConfiguration != null) { request.ContainerProperties.LogConfiguration = requestContainerProperties_containerProperties_LogConfiguration; requestContainerPropertiesIsNull = false; } Amazon.Batch.Model.LinuxParameters requestContainerProperties_containerProperties_LinuxParameters = null; // populate LinuxParameters var requestContainerProperties_containerProperties_LinuxParametersIsNull = true; requestContainerProperties_containerProperties_LinuxParameters = new Amazon.Batch.Model.LinuxParameters(); List requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Device = null; if (cmdletContext.LinuxParameters_Device != null) { requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Device = cmdletContext.LinuxParameters_Device; } if (requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Device != null) { requestContainerProperties_containerProperties_LinuxParameters.Devices = requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Device; requestContainerProperties_containerProperties_LinuxParametersIsNull = false; } System.Boolean? requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_InitProcessEnabled = null; if (cmdletContext.LinuxParameters_InitProcessEnabled != null) { requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_InitProcessEnabled = cmdletContext.LinuxParameters_InitProcessEnabled.Value; } if (requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_InitProcessEnabled != null) { requestContainerProperties_containerProperties_LinuxParameters.InitProcessEnabled = requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_InitProcessEnabled.Value; requestContainerProperties_containerProperties_LinuxParametersIsNull = false; } System.Int32? requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_MaxSwap = null; if (cmdletContext.LinuxParameters_MaxSwap != null) { requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_MaxSwap = cmdletContext.LinuxParameters_MaxSwap.Value; } if (requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_MaxSwap != null) { requestContainerProperties_containerProperties_LinuxParameters.MaxSwap = requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_MaxSwap.Value; requestContainerProperties_containerProperties_LinuxParametersIsNull = false; } System.Int32? requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_SharedMemorySize = null; if (cmdletContext.LinuxParameters_SharedMemorySize != null) { requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_SharedMemorySize = cmdletContext.LinuxParameters_SharedMemorySize.Value; } if (requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_SharedMemorySize != null) { requestContainerProperties_containerProperties_LinuxParameters.SharedMemorySize = requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_SharedMemorySize.Value; requestContainerProperties_containerProperties_LinuxParametersIsNull = false; } System.Int32? requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Swappiness = null; if (cmdletContext.LinuxParameters_Swappiness != null) { requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Swappiness = cmdletContext.LinuxParameters_Swappiness.Value; } if (requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Swappiness != null) { requestContainerProperties_containerProperties_LinuxParameters.Swappiness = requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Swappiness.Value; requestContainerProperties_containerProperties_LinuxParametersIsNull = false; } List requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Tmpf = null; if (cmdletContext.LinuxParameters_Tmpf != null) { requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Tmpf = cmdletContext.LinuxParameters_Tmpf; } if (requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Tmpf != null) { requestContainerProperties_containerProperties_LinuxParameters.Tmpfs = requestContainerProperties_containerProperties_LinuxParameters_linuxParameters_Tmpf; requestContainerProperties_containerProperties_LinuxParametersIsNull = false; } // determine if requestContainerProperties_containerProperties_LinuxParameters should be set to null if (requestContainerProperties_containerProperties_LinuxParametersIsNull) { requestContainerProperties_containerProperties_LinuxParameters = null; } if (requestContainerProperties_containerProperties_LinuxParameters != null) { request.ContainerProperties.LinuxParameters = requestContainerProperties_containerProperties_LinuxParameters; requestContainerPropertiesIsNull = false; } // determine if request.ContainerProperties should be set to null if (requestContainerPropertiesIsNull) { request.ContainerProperties = null; } // populate EksProperties var requestEksPropertiesIsNull = true; request.EksProperties = new Amazon.Batch.Model.EksProperties(); Amazon.Batch.Model.EksPodProperties requestEksProperties_eksProperties_PodProperties = null; // populate PodProperties var requestEksProperties_eksProperties_PodPropertiesIsNull = true; requestEksProperties_eksProperties_PodProperties = new Amazon.Batch.Model.EksPodProperties(); List requestEksProperties_eksProperties_PodProperties_podProperties_Container = null; if (cmdletContext.PodProperties_Container != null) { requestEksProperties_eksProperties_PodProperties_podProperties_Container = cmdletContext.PodProperties_Container; } if (requestEksProperties_eksProperties_PodProperties_podProperties_Container != null) { requestEksProperties_eksProperties_PodProperties.Containers = requestEksProperties_eksProperties_PodProperties_podProperties_Container; requestEksProperties_eksProperties_PodPropertiesIsNull = false; } System.String requestEksProperties_eksProperties_PodProperties_podProperties_DnsPolicy = null; if (cmdletContext.PodProperties_DnsPolicy != null) { requestEksProperties_eksProperties_PodProperties_podProperties_DnsPolicy = cmdletContext.PodProperties_DnsPolicy; } if (requestEksProperties_eksProperties_PodProperties_podProperties_DnsPolicy != null) { requestEksProperties_eksProperties_PodProperties.DnsPolicy = requestEksProperties_eksProperties_PodProperties_podProperties_DnsPolicy; requestEksProperties_eksProperties_PodPropertiesIsNull = false; } System.Boolean? requestEksProperties_eksProperties_PodProperties_podProperties_HostNetwork = null; if (cmdletContext.PodProperties_HostNetwork != null) { requestEksProperties_eksProperties_PodProperties_podProperties_HostNetwork = cmdletContext.PodProperties_HostNetwork.Value; } if (requestEksProperties_eksProperties_PodProperties_podProperties_HostNetwork != null) { requestEksProperties_eksProperties_PodProperties.HostNetwork = requestEksProperties_eksProperties_PodProperties_podProperties_HostNetwork.Value; requestEksProperties_eksProperties_PodPropertiesIsNull = false; } System.String requestEksProperties_eksProperties_PodProperties_podProperties_ServiceAccountName = null; if (cmdletContext.PodProperties_ServiceAccountName != null) { requestEksProperties_eksProperties_PodProperties_podProperties_ServiceAccountName = cmdletContext.PodProperties_ServiceAccountName; } if (requestEksProperties_eksProperties_PodProperties_podProperties_ServiceAccountName != null) { requestEksProperties_eksProperties_PodProperties.ServiceAccountName = requestEksProperties_eksProperties_PodProperties_podProperties_ServiceAccountName; requestEksProperties_eksProperties_PodPropertiesIsNull = false; } List requestEksProperties_eksProperties_PodProperties_podProperties_Volume = null; if (cmdletContext.PodProperties_Volume != null) { requestEksProperties_eksProperties_PodProperties_podProperties_Volume = cmdletContext.PodProperties_Volume; } if (requestEksProperties_eksProperties_PodProperties_podProperties_Volume != null) { requestEksProperties_eksProperties_PodProperties.Volumes = requestEksProperties_eksProperties_PodProperties_podProperties_Volume; requestEksProperties_eksProperties_PodPropertiesIsNull = false; } Amazon.Batch.Model.EksMetadata requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata = null; // populate Metadata var requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_MetadataIsNull = true; requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata = new Amazon.Batch.Model.EksMetadata(); Dictionary requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata_metadata_Label = null; if (cmdletContext.Metadata_Label != null) { requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata_metadata_Label = cmdletContext.Metadata_Label; } if (requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata_metadata_Label != null) { requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata.Labels = requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata_metadata_Label; requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_MetadataIsNull = false; } // determine if requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata should be set to null if (requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_MetadataIsNull) { requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata = null; } if (requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata != null) { requestEksProperties_eksProperties_PodProperties.Metadata = requestEksProperties_eksProperties_PodProperties_eksProperties_PodProperties_Metadata; requestEksProperties_eksProperties_PodPropertiesIsNull = false; } // determine if requestEksProperties_eksProperties_PodProperties should be set to null if (requestEksProperties_eksProperties_PodPropertiesIsNull) { requestEksProperties_eksProperties_PodProperties = null; } if (requestEksProperties_eksProperties_PodProperties != null) { request.EksProperties.PodProperties = requestEksProperties_eksProperties_PodProperties; requestEksPropertiesIsNull = false; } // determine if request.EksProperties should be set to null if (requestEksPropertiesIsNull) { request.EksProperties = null; } if (cmdletContext.JobDefinitionName != null) { request.JobDefinitionName = cmdletContext.JobDefinitionName; } // populate NodeProperties var requestNodePropertiesIsNull = true; request.NodeProperties = new Amazon.Batch.Model.NodeProperties(); System.Int32? requestNodeProperties_nodeProperties_MainNode = null; if (cmdletContext.NodeProperties_MainNode != null) { requestNodeProperties_nodeProperties_MainNode = cmdletContext.NodeProperties_MainNode.Value; } if (requestNodeProperties_nodeProperties_MainNode != null) { request.NodeProperties.MainNode = requestNodeProperties_nodeProperties_MainNode.Value; requestNodePropertiesIsNull = false; } List requestNodeProperties_nodeProperties_NodeRangeProperty = null; if (cmdletContext.NodeProperties_NodeRangeProperty != null) { requestNodeProperties_nodeProperties_NodeRangeProperty = cmdletContext.NodeProperties_NodeRangeProperty; } if (requestNodeProperties_nodeProperties_NodeRangeProperty != null) { request.NodeProperties.NodeRangeProperties = requestNodeProperties_nodeProperties_NodeRangeProperty; requestNodePropertiesIsNull = false; } System.Int32? requestNodeProperties_nodeProperties_NumNode = null; if (cmdletContext.NodeProperties_NumNode != null) { requestNodeProperties_nodeProperties_NumNode = cmdletContext.NodeProperties_NumNode.Value; } if (requestNodeProperties_nodeProperties_NumNode != null) { request.NodeProperties.NumNodes = requestNodeProperties_nodeProperties_NumNode.Value; requestNodePropertiesIsNull = false; } // determine if request.NodeProperties should be set to null if (requestNodePropertiesIsNull) { request.NodeProperties = null; } if (cmdletContext.Parameter != null) { request.Parameters = cmdletContext.Parameter; } if (cmdletContext.PlatformCapability != null) { request.PlatformCapabilities = cmdletContext.PlatformCapability; } if (cmdletContext.PropagateTag != null) { request.PropagateTags = cmdletContext.PropagateTag.Value; } // populate RetryStrategy var requestRetryStrategyIsNull = true; request.RetryStrategy = new Amazon.Batch.Model.RetryStrategy(); System.Int32? requestRetryStrategy_retryStrategy_Attempt = null; if (cmdletContext.RetryStrategy_Attempt != null) { requestRetryStrategy_retryStrategy_Attempt = cmdletContext.RetryStrategy_Attempt.Value; } if (requestRetryStrategy_retryStrategy_Attempt != null) { request.RetryStrategy.Attempts = requestRetryStrategy_retryStrategy_Attempt.Value; requestRetryStrategyIsNull = false; } List requestRetryStrategy_retryStrategy_EvaluateOnExit = null; if (cmdletContext.RetryStrategy_EvaluateOnExit != null) { requestRetryStrategy_retryStrategy_EvaluateOnExit = cmdletContext.RetryStrategy_EvaluateOnExit; } if (requestRetryStrategy_retryStrategy_EvaluateOnExit != null) { request.RetryStrategy.EvaluateOnExit = requestRetryStrategy_retryStrategy_EvaluateOnExit; requestRetryStrategyIsNull = false; } // determine if request.RetryStrategy should be set to null if (requestRetryStrategyIsNull) { request.RetryStrategy = null; } if (cmdletContext.SchedulingPriority != null) { request.SchedulingPriority = cmdletContext.SchedulingPriority.Value; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.Timeout != null) { request.Timeout = cmdletContext.Timeout; } if (cmdletContext.Type != null) { request.Type = cmdletContext.Type; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return output; } public ExecutorContext CreateContext() { return new CmdletContext(); } #endregion #region AWS Service Operation Call private Amazon.Batch.Model.RegisterJobDefinitionResponse CallAWSServiceOperation(IAmazonBatch client, Amazon.Batch.Model.RegisterJobDefinitionRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Batch", "RegisterJobDefinition"); try { #if DESKTOP return client.RegisterJobDefinition(request); #elif CORECLR return client.RegisterJobDefinitionAsync(request).GetAwaiter().GetResult(); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } } #endregion internal partial class CmdletContext : ExecutorContext { public List ContainerProperties_Command { get; set; } public List ContainerProperties_Environment { get; set; } public System.Int32? EphemeralStorage_SizeInGiB { get; set; } public System.String ContainerProperties_ExecutionRoleArn { get; set; } public System.String FargatePlatformConfiguration_PlatformVersion { get; set; } public System.String ContainerProperties_Image { get; set; } public System.String ContainerProperties_InstanceType { get; set; } public System.String ContainerProperties_JobRoleArn { get; set; } public List LinuxParameters_Device { get; set; } public System.Boolean? LinuxParameters_InitProcessEnabled { get; set; } public System.Int32? LinuxParameters_MaxSwap { get; set; } public System.Int32? LinuxParameters_SharedMemorySize { get; set; } public System.Int32? LinuxParameters_Swappiness { get; set; } public List LinuxParameters_Tmpf { get; set; } public Amazon.Batch.LogDriver LogConfiguration_LogDriver { get; set; } public Dictionary LogConfiguration_Option { get; set; } public List LogConfiguration_SecretOption { get; set; } [System.ObsoleteAttribute] public System.Int32? ContainerProperties_Memory { get; set; } public List ContainerProperties_MountPoint { get; set; } public Amazon.Batch.AssignPublicIp NetworkConfiguration_AssignPublicIp { get; set; } public System.Boolean? ContainerProperties_Privileged { get; set; } public System.Boolean? ContainerProperties_ReadonlyRootFilesystem { get; set; } public List ContainerProperties_ResourceRequirement { get; set; } public System.String RuntimePlatform_CpuArchitecture { get; set; } public System.String RuntimePlatform_OperatingSystemFamily { get; set; } public List ContainerProperties_Secret { get; set; } public List ContainerProperties_Ulimit { get; set; } public System.String ContainerProperties_User { get; set; } [System.ObsoleteAttribute] public System.Int32? ContainerProperties_Vcpus { get; set; } public List ContainerProperties_Volume { get; set; } public List PodProperties_Container { get; set; } public System.String PodProperties_DnsPolicy { get; set; } public System.Boolean? PodProperties_HostNetwork { get; set; } public Dictionary Metadata_Label { get; set; } public System.String PodProperties_ServiceAccountName { get; set; } public List PodProperties_Volume { get; set; } public System.String JobDefinitionName { get; set; } public System.Int32? NodeProperties_MainNode { get; set; } public List NodeProperties_NodeRangeProperty { get; set; } public System.Int32? NodeProperties_NumNode { get; set; } public Dictionary Parameter { get; set; } public List PlatformCapability { get; set; } public System.Boolean? PropagateTag { get; set; } public System.Int32? RetryStrategy_Attempt { get; set; } public List RetryStrategy_EvaluateOnExit { get; set; } public System.Int32? SchedulingPriority { get; set; } public Dictionary Tag { get; set; } public Amazon.Batch.Model.JobTimeout Timeout { get; set; } public Amazon.Batch.JobDefinitionType Type { get; set; } public System.Func Select { get; set; } = (response, cmdlet) => response; } } }