/// <summary> /// Provides information about the cluster instances that Amazon EMR provisions on behalf /// of a user when it creates the cluster. For example, this operation indicates when /// the EC2 instances reach the Ready state, when instances become available to Amazon /// EMR to use for jobs, and the IP addresses for cluster instances, etc. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListInstances service method.</param> /// /// <returns>The response from the ListInstances service method, as returned by ElasticMapReduce.</returns> /// <exception cref="Amazon.ElasticMapReduce.Model.InternalServerException"> /// This exception occurs when there is an internal failure in the EMR service. /// </exception> /// <exception cref="Amazon.ElasticMapReduce.Model.InvalidRequestException"> /// This exception occurs when there is something wrong with user input. /// </exception> public ListInstancesResponse ListInstances(ListInstancesRequest request) { var marshaller = new ListInstancesRequestMarshaller(); var unmarshaller = ListInstancesResponseUnmarshaller.Instance; return Invoke<ListInstancesRequest,ListInstancesResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ListInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListInstances 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<ListInstancesResponse> ListInstancesAsync(ListInstancesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListInstancesRequestMarshaller(); var unmarshaller = ListInstancesResponseUnmarshaller.Instance; return InvokeAsync<ListInstancesRequest,ListInstancesResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the ListInstances operation. /// <seealso cref="Amazon.ElasticMapReduce.IAmazonElasticMapReduce.ListInstances"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListInstances 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<ListInstancesResponse> ListInstancesAsync(ListInstancesRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListInstancesRequestMarshaller(); var unmarshaller = ListInstancesResponseUnmarshaller.GetInstance(); return Invoke<IRequest, ListInstancesRequest, ListInstancesResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Provides information about the cluster instances that Amazon EMR provisions on behalf /// of a user when it creates the cluster. For example, this operation indicates /// when the EC2 instances reach the Ready state, when instances become available to Amazon /// EMR to use for jobs, and the IP addresses for cluster instances, etc. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListInstances service method.</param> /// /// <returns>The response from the ListInstances service method, as returned by ElasticMapReduce.</returns> /// <exception cref="InternalServerException"> /// This exception occurs when there is an internal failure in the EMR service. /// </exception> /// <exception cref="InvalidRequestException"> /// This exception occurs when there is something wrong with user input. /// </exception> public ListInstancesResponse ListInstances(ListInstancesRequest request) { var task = ListInstancesAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the ListInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListInstances operation on AmazonElasticMapReduceClient.</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 EndListInstances /// operation.</returns> public IAsyncResult BeginListInstances(ListInstancesRequest request, AsyncCallback callback, object state) { var marshaller = new ListInstancesRequestMarshaller(); var unmarshaller = ListInstancesResponseUnmarshaller.Instance; return BeginInvoke<ListInstancesRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>Provides information about the cluster instances that Amazon EMR provisions on behalf of a user when it creates the cluster. For /// example, this operation indicates when the EC2 instances reach the Ready state, when instances become available to Amazon EMR to use for /// jobs, and the IP addresses for cluster instances, etc. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListInstances service method on /// AmazonElasticMapReduce.</param> /// /// <returns>The response from the ListInstances service method, as returned by AmazonElasticMapReduce.</returns> /// /// <exception cref="T:Amazon.ElasticMapReduce.Model.InternalServerException" /> /// <exception cref="T:Amazon.ElasticMapReduce.Model.InvalidRequestException" /> public ListInstancesResponse ListInstances(ListInstancesRequest request) { var task = ListInstancesAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the ListInstances operation. /// <seealso cref="Amazon.ElasticMapReduce.IAmazonElasticMapReduce.ListInstances"/> /// </summary> /// /// <param name="listInstancesRequest">Container for the necessary parameters to execute the ListInstances operation on /// AmazonElasticMapReduce.</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 EndListInstances /// operation.</returns> public IAsyncResult BeginListInstances(ListInstancesRequest listInstancesRequest, AsyncCallback callback, object state) { return invokeListInstances(listInstancesRequest, callback, state, false); }
IAsyncResult invokeListInstances(ListInstancesRequest listInstancesRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new ListInstancesRequestMarshaller().Marshall(listInstancesRequest); var unmarshaller = ListInstancesResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Paginator for ListInstances operation ///</summary> public IListInstancesPaginator ListInstances(ListInstancesRequest request) { return(new ListInstancesPaginator(this.client, request)); }
/// <summary> /// <para>Provides information about the cluster instances that Amazon EMR provisions on behalf of a user when it creates the cluster. For /// example, this operation indicates when the EC2 instances reach the Ready state, when instances become available to Amazon EMR to use for /// jobs, and the IP addresses for cluster instances, etc. </para> /// </summary> /// /// <param name="listInstancesRequest">Container for the necessary parameters to execute the ListInstances service method on /// AmazonElasticMapReduce.</param> /// /// <returns>The response from the ListInstances service method, as returned by AmazonElasticMapReduce.</returns> /// /// <exception cref="InternalServerException"/> /// <exception cref="InvalidRequestException"/> public ListInstancesResponse ListInstances(ListInstancesRequest listInstancesRequest) { IAsyncResult asyncResult = invokeListInstances(listInstancesRequest, null, null, true); return EndListInstances(asyncResult); }
internal ListInstancesPaginator(IAmazonElasticMapReduce client, ListInstancesRequest request) { this._client = client; this._request = request; }
/// <summary> /// <para>Provides information about the cluster instances that Amazon EMR provisions on behalf of a user when it creates the cluster. For /// example, this operation indicates when the EC2 instances reach the Ready state, when instances become available to Amazon EMR to use for /// jobs, and the IP addresses for cluster instances, etc. </para> /// </summary> /// /// <param name="listInstancesRequest">Container for the necessary parameters to execute the ListInstances service method on /// AmazonElasticMapReduce.</param> /// /// <returns>The response from the ListInstances service method, as returned by AmazonElasticMapReduce.</returns> /// /// <exception cref="T:Amazon.ElasticMapReduce.Model.InternalServerException" /> /// <exception cref="T:Amazon.ElasticMapReduce.Model.InvalidRequestException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<ListInstancesResponse> ListInstancesAsync(ListInstancesRequest listInstancesRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ListInstancesRequestMarshaller(); var unmarshaller = ListInstancesResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, ListInstancesRequest, ListInstancesResponse>(listInstancesRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
private Amazon.ElasticMapReduce.Model.ListInstancesResponse CallAWSServiceOperation(IAmazonElasticMapReduce client, Amazon.ElasticMapReduce.Model.ListInstancesRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Elastic MapReduce", "ListInstances"); try { #if DESKTOP return(client.ListInstances(request)); #elif CORECLR return(client.ListInstancesAsync(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; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute // create request and set iteration invariants var request = new Amazon.ElasticMapReduce.Model.ListInstancesRequest(); if (cmdletContext.ClusterId != null) { request.ClusterId = cmdletContext.ClusterId; } if (cmdletContext.InstanceFleetId != null) { request.InstanceFleetId = cmdletContext.InstanceFleetId; } if (cmdletContext.InstanceFleetType != null) { request.InstanceFleetType = cmdletContext.InstanceFleetType; } if (cmdletContext.InstanceGroupId != null) { request.InstanceGroupId = cmdletContext.InstanceGroupId; } if (cmdletContext.InstanceGroupType != null) { request.InstanceGroupTypes = cmdletContext.InstanceGroupType; } if (cmdletContext.InstanceState != null) { request.InstanceStates = cmdletContext.InstanceState; } // Initialize loop variant and commence piping var _nextToken = cmdletContext.Marker; var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.Marker)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.Marker = _nextToken; CmdletOutput output; try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; if (!useParameterSelect) { pipelineOutput = cmdletContext.Select(response, this); } output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; _nextToken = response.Marker; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
IAsyncResult invokeListInstances(ListInstancesRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new ListInstancesRequestMarshaller(); var unmarshaller = ListInstancesResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }