public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.OpsWorks.Model.DescribeInstancesRequest(); if (cmdletContext.InstanceId != null) { request.InstanceIds = cmdletContext.InstanceId; } if (cmdletContext.LayerId != null) { request.LayerId = cmdletContext.LayerId; } if (cmdletContext.StackId != null) { request.StackId = cmdletContext.StackId; } 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> /// Initiates the asynchronous execution of the DescribeInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeInstances 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<DescribeInstancesResponse> DescribeInstancesAsync(DescribeInstancesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeInstancesRequestMarshaller(); var unmarshaller = DescribeInstancesResponseUnmarshaller.Instance; return InvokeAsync<DescribeInstancesRequest,DescribeInstancesResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal DescribeInstancesResponse DescribeInstances(DescribeInstancesRequest request) { var marshaller = new DescribeInstancesRequestMarshaller(); var unmarshaller = DescribeInstancesResponseUnmarshaller.Instance; return Invoke<DescribeInstancesRequest,DescribeInstancesResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para>Requests a description of a set of instances.</para> <para><b>NOTE:</b>You must specify at least one of the parameters.</para> <para> /// <b>Required Permissions</b> : To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an /// attached policy that explicitly grants permissions. For more information on user permissions, see <a href="http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html">Managing User Permissions</a> .</para> /// </summary> /// /// <param name="describeInstancesRequest">Container for the necessary parameters to execute the DescribeInstances service method on /// AmazonOpsWorks.</param> /// /// <returns>The response from the DescribeInstances service method, as returned by AmazonOpsWorks.</returns> /// /// <exception cref="T:Amazon.OpsWorks.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.OpsWorks.Model.ValidationException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DescribeInstancesResponse> DescribeInstancesAsync(DescribeInstancesRequest describeInstancesRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeInstancesRequestMarshaller(); var unmarshaller = DescribeInstancesResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DescribeInstancesRequest, DescribeInstancesResponse>(describeInstancesRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DescribeInstancesResponse DescribeInstances(DescribeInstancesRequest request) { var task = DescribeInstancesAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the DescribeInstances operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeInstances operation on AmazonOpsWorksClient.</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 EndDescribeInstances /// operation.</returns> public IAsyncResult BeginDescribeInstances(DescribeInstancesRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeInstancesRequestMarshaller(); var unmarshaller = DescribeInstancesResponseUnmarshaller.Instance; return BeginInvoke<DescribeInstancesRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeDescribeInstances(DescribeInstancesRequest describeInstancesRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DescribeInstancesRequestMarshaller().Marshall(describeInstancesRequest); var unmarshaller = DescribeInstancesResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DescribeInstances operation. /// <seealso cref="Amazon.OpsWorks.IAmazonOpsWorks.DescribeInstances"/> /// </summary> /// /// <param name="describeInstancesRequest">Container for the necessary parameters to execute the DescribeInstances operation on /// AmazonOpsWorks.</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 EndDescribeInstances /// operation.</returns> public IAsyncResult BeginDescribeInstances(DescribeInstancesRequest describeInstancesRequest, AsyncCallback callback, object state) { return invokeDescribeInstances(describeInstancesRequest, callback, state, false); }
/// <summary> /// <para>Requests a description of a set of instances.</para> <para><b>NOTE:</b>You must specify at least one of the parameters.</para> <para> /// <b>Required Permissions</b> : To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an /// attached policy that explicitly grants permissions. For more information on user permissions, see <a /// href="http://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html" >Managing User Permissions</a> .</para> /// </summary> /// /// <param name="describeInstancesRequest">Container for the necessary parameters to execute the DescribeInstances service method on /// AmazonOpsWorks.</param> /// /// <returns>The response from the DescribeInstances service method, as returned by AmazonOpsWorks.</returns> /// /// <exception cref="ResourceNotFoundException"/> /// <exception cref="ValidationException"/> public DescribeInstancesResponse DescribeInstances(DescribeInstancesRequest describeInstancesRequest) { IAsyncResult asyncResult = invokeDescribeInstances(describeInstancesRequest, null, null, true); return EndDescribeInstances(asyncResult); }
IAsyncResult invokeDescribeInstances(DescribeInstancesRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DescribeInstancesRequestMarshaller(); var unmarshaller = DescribeInstancesResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the DescribeInstances operation. /// <seealso cref="Amazon.OpsWorks.IAmazonOpsWorks.DescribeInstances"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeInstances 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<DescribeInstancesResponse> DescribeInstancesAsync(DescribeInstancesRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeInstancesRequestMarshaller(); var unmarshaller = DescribeInstancesResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DescribeInstancesRequest, DescribeInstancesResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
/// <summary> /// <para>Requests a description of a set of instances.</para> <para><b>NOTE:</b>You must specify at least one of the parameters.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeInstances service method on /// AmazonOpsWorks.</param> /// /// <returns>The response from the DescribeInstances service method, as returned by AmazonOpsWorks.</returns> /// /// <exception cref="T:Amazon.OpsWorks.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.OpsWorks.Model.ValidationException" /> public DescribeInstancesResponse DescribeInstances(DescribeInstancesRequest request) { var task = DescribeInstancesAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.OpsWorks.Model.DescribeInstancesResponse CallAWSServiceOperation(IAmazonOpsWorks client, Amazon.OpsWorks.Model.DescribeInstancesRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS OpsWorks", "DescribeInstances"); try { #if DESKTOP return(client.DescribeInstances(request)); #elif CORECLR return(client.DescribeInstancesAsync(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; } }