public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.GameLift.Model.DescribeEC2InstanceLimitsRequest(); if (cmdletContext.EC2InstanceType != null) { request.EC2InstanceType = cmdletContext.EC2InstanceType; } if (cmdletContext.Location != null) { request.Location = cmdletContext.Location; } 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); }
private Amazon.GameLift.Model.DescribeEC2InstanceLimitsResponse CallAWSServiceOperation(IAmazonGameLift client, Amazon.GameLift.Model.DescribeEC2InstanceLimitsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon GameLift Service", "DescribeEC2InstanceLimits"); try { #if DESKTOP return(client.DescribeEC2InstanceLimits(request)); #elif CORECLR return(client.DescribeEC2InstanceLimitsAsync(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 DescribeEC2InstanceLimits operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeEC2InstanceLimits operation on AmazonGameLiftClient.</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 EndDescribeEC2InstanceLimits /// operation.</returns> public IAsyncResult BeginDescribeEC2InstanceLimits(DescribeEC2InstanceLimitsRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeEC2InstanceLimitsRequestMarshaller(); var unmarshaller = DescribeEC2InstanceLimitsResponseUnmarshaller.Instance; return BeginInvoke<DescribeEC2InstanceLimitsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Retrieves the maximum number of instances allowed, per AWS account, for each specified /// EC2 instance type. The current usage level for the AWS account is also retrieved. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DescribeEC2InstanceLimits service method.</param> /// /// <returns>The response from the DescribeEC2InstanceLimits service method, as returned by GameLift.</returns> /// <exception cref="Amazon.GameLift.Model.InternalServiceException"> /// The service encountered an unrecoverable internal failure while processing the request. /// Such requests can be retried by clients, either immediately or after a back-off period. /// </exception> /// <exception cref="Amazon.GameLift.Model.InvalidRequestException"> /// One or more parameters specified as part of the request are invalid. Please correct /// the invalid parameters before retrying. /// </exception> /// <exception cref="Amazon.GameLift.Model.UnauthorizedException"> /// The client failed authentication. Such requests should not be retried without valid /// authentication credentials. /// </exception> public DescribeEC2InstanceLimitsResponse DescribeEC2InstanceLimits(DescribeEC2InstanceLimitsRequest request) { var marshaller = new DescribeEC2InstanceLimitsRequestMarshaller(); var unmarshaller = DescribeEC2InstanceLimitsResponseUnmarshaller.Instance; return Invoke<DescribeEC2InstanceLimitsRequest,DescribeEC2InstanceLimitsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Retrieves the maximum number of instances allowed, per AWS account, for each specified /// EC2 instance type. The current usage level for the AWS account is also retrieved. /// </summary> /// <param name="ec2InstanceType">Type of EC2 instances used in the fleet. EC2 instance types define the CPU, memory, storage, and networking capacity of the fleetaposs hosts. Amazon GameLift supports the EC2 instance types listed below. See <a href="https://aws.amazon.com/ec2/instance-types/">Amazon EC2 Instance Types</a> for detailed descriptions of each. Leave this parameter blank to retrieve limits for all types.</param> /// /// <returns>The response from the DescribeEC2InstanceLimits service method, as returned by GameLift.</returns> /// <exception cref="Amazon.GameLift.Model.InternalServiceException"> /// The service encountered an unrecoverable internal failure while processing the request. /// Such requests can be retried by clients, either immediately or after a back-off period. /// </exception> /// <exception cref="Amazon.GameLift.Model.InvalidRequestException"> /// One or more parameters specified as part of the request are invalid. Please correct /// the invalid parameters before retrying. /// </exception> /// <exception cref="Amazon.GameLift.Model.UnauthorizedException"> /// The client failed authentication. Such requests should not be retried without valid /// authentication credentials. /// </exception> public DescribeEC2InstanceLimitsResponse DescribeEC2InstanceLimits(EC2InstanceType ec2InstanceType) { var request = new DescribeEC2InstanceLimitsRequest(); request.EC2InstanceType = ec2InstanceType; return DescribeEC2InstanceLimits(request); }
/// <summary> /// Initiates the asynchronous execution of the DescribeEC2InstanceLimits operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeEC2InstanceLimits 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<DescribeEC2InstanceLimitsResponse> DescribeEC2InstanceLimitsAsync(DescribeEC2InstanceLimitsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeEC2InstanceLimitsRequestMarshaller(); var unmarshaller = DescribeEC2InstanceLimitsResponseUnmarshaller.Instance; return InvokeAsync<DescribeEC2InstanceLimitsRequest,DescribeEC2InstanceLimitsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Retrieves the following information for the specified EC2 instance type: /// /// <ul> <li> /// <para> /// maximum number of instances allowed per AWS account (service limit) /// </para> /// </li> <li> /// <para> /// current usage level for the AWS account /// </para> /// </li> </ul> /// <para> /// Service limits vary depending on region. Available regions for GameLift can be found /// in the AWS Management Console for GameLift (see the drop-down list in the upper right /// corner). /// </para> /// </summary> /// <param name="ec2InstanceType">Name of an EC2 instance type that is supported in Amazon GameLift. A fleet instance type determines the computing resources of each instance in the fleet, including CPU, memory, storage, and networking capacity. GameLift supports the following EC2 instance types. See <a href="http://aws.amazon.com/ec2/instance-types/">Amazon EC2 Instance Types</a> for detailed descriptions. Leave this parameter blank to retrieve limits for all types.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DescribeEC2InstanceLimits service method, as returned by GameLift.</returns> /// <exception cref="Amazon.GameLift.Model.InternalServiceException"> /// The service encountered an unrecoverable internal failure while processing the request. /// Clients can retry such requests immediately or after a waiting period. /// </exception> /// <exception cref="Amazon.GameLift.Model.InvalidRequestException"> /// One or more parameter values in the request are invalid. Correct the invalid parameter /// values before retrying. /// </exception> /// <exception cref="Amazon.GameLift.Model.UnauthorizedException"> /// The client failed authentication. Clients should not retry such requests. /// </exception> public Task<DescribeEC2InstanceLimitsResponse> DescribeEC2InstanceLimitsAsync(EC2InstanceType ec2InstanceType, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DescribeEC2InstanceLimitsRequest(); request.EC2InstanceType = ec2InstanceType; return DescribeEC2InstanceLimitsAsync(request, cancellationToken); }