/// <summary> /// Initiates the asynchronous execution of the CreateAutoScalingGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateAutoScalingGroup operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<CreateAutoScalingGroupResponse> CreateAutoScalingGroupAsync(CreateAutoScalingGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateAutoScalingGroupRequestMarshaller(); var unmarshaller = CreateAutoScalingGroupResponseUnmarshaller.Instance; return InvokeAsync<CreateAutoScalingGroupRequest,CreateAutoScalingGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeCreateAutoScalingGroup(CreateAutoScalingGroupRequest createAutoScalingGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new CreateAutoScalingGroupRequestMarshaller().Marshall(createAutoScalingGroupRequest); var unmarshaller = CreateAutoScalingGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
internal CreateAutoScalingGroupResponse CreateAutoScalingGroup(CreateAutoScalingGroupRequest request) { var marshaller = new CreateAutoScalingGroupRequestMarshaller(); var unmarshaller = CreateAutoScalingGroupResponseUnmarshaller.Instance; return Invoke<CreateAutoScalingGroupRequest,CreateAutoScalingGroupResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Creates a new Auto Scaling group with the specified name and other attributes. When the creation request is completed, the Auto /// Scaling group is ready to be used in other calls. </para> <para><b>NOTE:</b> The Auto Scaling group name must be unique within the scope of /// your AWS account. </para> /// </summary> /// /// <param name="createAutoScalingGroupRequest">Container for the necessary parameters to execute the CreateAutoScalingGroup service method on /// AmazonAutoScaling.</param> /// /// <exception cref="LimitExceededException"/> /// <exception cref="AlreadyExistsException"/> public CreateAutoScalingGroupResponse CreateAutoScalingGroup(CreateAutoScalingGroupRequest createAutoScalingGroupRequest) { IAsyncResult asyncResult = invokeCreateAutoScalingGroup(createAutoScalingGroupRequest, null, null, true); return EndCreateAutoScalingGroup(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the CreateAutoScalingGroup operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.CreateAutoScalingGroup"/> /// </summary> /// /// <param name="createAutoScalingGroupRequest">Container for the necessary parameters to execute the CreateAutoScalingGroup operation on /// AmazonAutoScaling.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public IAsyncResult BeginCreateAutoScalingGroup(CreateAutoScalingGroupRequest createAutoScalingGroupRequest, AsyncCallback callback, object state) { return invokeCreateAutoScalingGroup(createAutoScalingGroupRequest, callback, state, false); }
/// <summary> /// <para> Creates a new Auto Scaling group with the specified name and other attributes. When the creation request is completed, the Auto /// Scaling group is ready to be used in other calls. </para> <para><b>NOTE:</b> The Auto Scaling group name must be unique within the scope of /// your AWS account. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateAutoScalingGroup service method on /// AmazonAutoScaling.</param> /// /// <exception cref="T:Amazon.AutoScaling.Model.LimitExceededException" /> /// <exception cref="T:Amazon.AutoScaling.Model.AlreadyExistsException" /> public CreateAutoScalingGroupResponse CreateAutoScalingGroup(CreateAutoScalingGroupRequest request) { var task = CreateAutoScalingGroupAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the CreateAutoScalingGroup operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.CreateAutoScalingGroup"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateAutoScalingGroup operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<CreateAutoScalingGroupResponse> CreateAutoScalingGroupAsync(CreateAutoScalingGroupRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateAutoScalingGroupRequestMarshaller(); var unmarshaller = CreateAutoScalingGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, CreateAutoScalingGroupRequest, CreateAutoScalingGroupResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
private Amazon.AutoScaling.Model.CreateAutoScalingGroupResponse CallAWSServiceOperation(IAmazonAutoScaling client, Amazon.AutoScaling.Model.CreateAutoScalingGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Auto Scaling", "CreateAutoScalingGroup"); try { #if DESKTOP return(client.CreateAutoScalingGroup(request)); #elif CORECLR return(client.CreateAutoScalingGroupAsync(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; } }
/// <summary> /// Initiates the asynchronous execution of the CreateAutoScalingGroup operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateAutoScalingGroup operation on AmazonAutoScalingClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndCreateAutoScalingGroup /// operation.</returns> public IAsyncResult BeginCreateAutoScalingGroup(CreateAutoScalingGroupRequest request, AsyncCallback callback, object state) { var marshaller = new CreateAutoScalingGroupRequestMarshaller(); var unmarshaller = CreateAutoScalingGroupResponseUnmarshaller.Instance; return BeginInvoke<CreateAutoScalingGroupRequest>(request, marshaller, unmarshaller, callback, state); }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.AutoScaling.Model.CreateAutoScalingGroupRequest(); if (cmdletContext.AutoScalingGroupName != null) { request.AutoScalingGroupName = cmdletContext.AutoScalingGroupName; } if (cmdletContext.AvailabilityZone != null) { request.AvailabilityZones = cmdletContext.AvailabilityZone; } if (cmdletContext.CapacityRebalance != null) { request.CapacityRebalance = cmdletContext.CapacityRebalance.Value; } if (cmdletContext.Context != null) { request.Context = cmdletContext.Context; } if (cmdletContext.DefaultCooldown != null) { request.DefaultCooldown = cmdletContext.DefaultCooldown.Value; } if (cmdletContext.DesiredCapacity != null) { request.DesiredCapacity = cmdletContext.DesiredCapacity.Value; } if (cmdletContext.DesiredCapacityType != null) { request.DesiredCapacityType = cmdletContext.DesiredCapacityType; } if (cmdletContext.HealthCheckGracePeriod != null) { request.HealthCheckGracePeriod = cmdletContext.HealthCheckGracePeriod.Value; } if (cmdletContext.HealthCheckType != null) { request.HealthCheckType = cmdletContext.HealthCheckType; } if (cmdletContext.InstanceId != null) { request.InstanceId = cmdletContext.InstanceId; } if (cmdletContext.LaunchConfigurationName != null) { request.LaunchConfigurationName = cmdletContext.LaunchConfigurationName; } // populate LaunchTemplate var requestLaunchTemplateIsNull = true; request.LaunchTemplate = new Amazon.AutoScaling.Model.LaunchTemplateSpecification(); System.String requestLaunchTemplate_launchTemplate_LaunchTemplateId = null; if (cmdletContext.LaunchTemplate_LaunchTemplateId != null) { requestLaunchTemplate_launchTemplate_LaunchTemplateId = cmdletContext.LaunchTemplate_LaunchTemplateId; } if (requestLaunchTemplate_launchTemplate_LaunchTemplateId != null) { request.LaunchTemplate.LaunchTemplateId = requestLaunchTemplate_launchTemplate_LaunchTemplateId; requestLaunchTemplateIsNull = false; } System.String requestLaunchTemplate_launchTemplate_LaunchTemplateName = null; if (cmdletContext.LaunchTemplate_LaunchTemplateName != null) { requestLaunchTemplate_launchTemplate_LaunchTemplateName = cmdletContext.LaunchTemplate_LaunchTemplateName; } if (requestLaunchTemplate_launchTemplate_LaunchTemplateName != null) { request.LaunchTemplate.LaunchTemplateName = requestLaunchTemplate_launchTemplate_LaunchTemplateName; requestLaunchTemplateIsNull = false; } System.String requestLaunchTemplate_launchTemplate_Version = null; if (cmdletContext.LaunchTemplate_Version != null) { requestLaunchTemplate_launchTemplate_Version = cmdletContext.LaunchTemplate_Version; } if (requestLaunchTemplate_launchTemplate_Version != null) { request.LaunchTemplate.Version = requestLaunchTemplate_launchTemplate_Version; requestLaunchTemplateIsNull = false; } // determine if request.LaunchTemplate should be set to null if (requestLaunchTemplateIsNull) { request.LaunchTemplate = null; } if (cmdletContext.LifecycleHookSpecificationList != null) { request.LifecycleHookSpecificationList = cmdletContext.LifecycleHookSpecificationList; } if (cmdletContext.LoadBalancerName != null) { request.LoadBalancerNames = cmdletContext.LoadBalancerName; } if (cmdletContext.MaxInstanceLifetime != null) { request.MaxInstanceLifetime = cmdletContext.MaxInstanceLifetime.Value; } if (cmdletContext.MaxSize != null) { request.MaxSize = cmdletContext.MaxSize.Value; } if (cmdletContext.MinSize != null) { request.MinSize = cmdletContext.MinSize.Value; } if (cmdletContext.MixedInstancesPolicy != null) { request.MixedInstancesPolicy = cmdletContext.MixedInstancesPolicy; } if (cmdletContext.NewInstancesProtectedFromScaleIn != null) { request.NewInstancesProtectedFromScaleIn = cmdletContext.NewInstancesProtectedFromScaleIn.Value; } if (cmdletContext.PlacementGroup != null) { request.PlacementGroup = cmdletContext.PlacementGroup; } if (cmdletContext.ServiceLinkedRoleARN != null) { request.ServiceLinkedRoleARN = cmdletContext.ServiceLinkedRoleARN; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.TargetGroupARNs != null) { request.TargetGroupARNs = cmdletContext.TargetGroupARNs; } if (cmdletContext.TerminationPolicy != null) { request.TerminationPolicies = cmdletContext.TerminationPolicy; } if (cmdletContext.VPCZoneIdentifier != null) { request.VPCZoneIdentifier = cmdletContext.VPCZoneIdentifier; } 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); }
/// <summary> /// <para> Creates a new Auto Scaling group with the specified name and other attributes. When the creation request is completed, the Auto /// Scaling group is ready to be used in other calls. </para> <para><b>NOTE:</b> The Auto Scaling group name must be unique within the scope of /// your AWS account, and under the quota of Auto Scaling groups allowed for your account. </para> /// </summary> /// /// <param name="createAutoScalingGroupRequest">Container for the necessary parameters to execute the CreateAutoScalingGroup service method on /// AmazonAutoScaling.</param> /// /// <exception cref="LimitExceededException"/> /// <exception cref="AlreadyExistsException"/> public CreateAutoScalingGroupResponse CreateAutoScalingGroup(CreateAutoScalingGroupRequest createAutoScalingGroupRequest) { IRequest<CreateAutoScalingGroupRequest> request = new CreateAutoScalingGroupRequestMarshaller().Marshall(createAutoScalingGroupRequest); CreateAutoScalingGroupResponse response = Invoke<CreateAutoScalingGroupRequest, CreateAutoScalingGroupResponse> (request, this.signer, CreateAutoScalingGroupResponseUnmarshaller.GetInstance()); return response; }
internal CreateAutoScalingGroupResponse CreateAutoScalingGroup(CreateAutoScalingGroupRequest request) { var task = CreateAutoScalingGroupAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
protected override void ProcessRecord() { AmazonAutoScaling client = base.GetClient(); Amazon.AutoScaling.Model.CreateAutoScalingGroupRequest request = new Amazon.AutoScaling.Model.CreateAutoScalingGroupRequest(); request.AutoScalingGroupName = this._AutoScalingGroupName; request.LaunchConfigurationName = this._LaunchConfigurationName; request.MinSize = this._MinSize; request.MaxSize = this._MaxSize; request.Cooldown = this._Cooldown; if (string.IsNullOrEmpty(this._AvailabilityZones)) { request.AvailabilityZones.Add(this._AvailabilityZones); } if (string.IsNullOrEmpty(this._LoadBalancerNames)) { request.LoadBalancerNames.Add(this._LoadBalancerNames); } Amazon.AutoScaling.Model.CreateAutoScalingGroupResponse response = client.CreateAutoScalingGroup(request); }
/// <summary> /// Initiates the asynchronous execution of the CreateAutoScalingGroup operation. /// <seealso cref="Amazon.AutoScaling.IAmazonAutoScaling.CreateAutoScalingGroup"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the CreateAutoScalingGroup operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public async Task<CreateAutoScalingGroupResponse> CreateAutoScalingGroupAsync(CreateAutoScalingGroupRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new CreateAutoScalingGroupRequestMarshaller(); var unmarshaller = CreateAutoScalingGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, CreateAutoScalingGroupRequest, CreateAutoScalingGroupResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }