Returns descriptions for existing application versions.
/// <summary> /// <para>Returns descriptions for existing application versions.</para> /// </summary> /// /// <param name="describeApplicationVersionsRequest">Container for the necessary parameters to execute the DescribeApplicationVersions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeApplicationVersions service method, as returned by AmazonElasticBeanstalk.</returns> /// public DescribeApplicationVersionsResponse DescribeApplicationVersions(DescribeApplicationVersionsRequest describeApplicationVersionsRequest) { IAsyncResult asyncResult = invokeDescribeApplicationVersions(describeApplicationVersionsRequest, null, null, true); return EndDescribeApplicationVersions(asyncResult); }
IAsyncResult invokeDescribeApplicationVersions(DescribeApplicationVersionsRequest describeApplicationVersionsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DescribeApplicationVersionsRequestMarshaller().Marshall(describeApplicationVersionsRequest); var unmarshaller = DescribeApplicationVersionsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DescribeApplicationVersions operation. /// <seealso cref="Amazon.ElasticBeanstalk.AmazonElasticBeanstalk.DescribeApplicationVersions"/> /// </summary> /// /// <param name="describeApplicationVersionsRequest">Container for the necessary parameters to execute the DescribeApplicationVersions operation /// on AmazonElasticBeanstalk.</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 /// EndDescribeApplicationVersions operation.</returns> public IAsyncResult BeginDescribeApplicationVersions(DescribeApplicationVersionsRequest describeApplicationVersionsRequest, AsyncCallback callback, object state) { return invokeDescribeApplicationVersions(describeApplicationVersionsRequest, callback, state, false); }
internal DescribeApplicationVersionsResponse DescribeApplicationVersions(DescribeApplicationVersionsRequest request) { var marshaller = new DescribeApplicationVersionsRequestMarshaller(); var unmarshaller = DescribeApplicationVersionsResponseUnmarshaller.Instance; return Invoke<DescribeApplicationVersionsRequest,DescribeApplicationVersionsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DescribeApplicationVersions operation. /// <seealso cref="Amazon.ElasticBeanstalk.IAmazonElasticBeanstalk"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeApplicationVersions 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<DescribeApplicationVersionsResponse> DescribeApplicationVersionsAsync(DescribeApplicationVersionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeApplicationVersionsRequestMarshaller(); var unmarshaller = DescribeApplicationVersionsResponseUnmarshaller.Instance; return InvokeAsync<DescribeApplicationVersionsRequest,DescribeApplicationVersionsResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// <para>Returns descriptions for existing application versions.</para> /// </summary> /// /// <param name="describeApplicationVersionsRequest">Container for the necessary parameters to execute the DescribeApplicationVersions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeApplicationVersions service method, as returned by AmazonElasticBeanstalk.</returns> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DescribeApplicationVersionsResponse> DescribeApplicationVersionsAsync(DescribeApplicationVersionsRequest describeApplicationVersionsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeApplicationVersionsRequestMarshaller(); var unmarshaller = DescribeApplicationVersionsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DescribeApplicationVersionsRequest, DescribeApplicationVersionsResponse>(describeApplicationVersionsRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>Returns descriptions for existing application versions.</para> /// </summary> /// /// <param name="describeApplicationVersionsRequest">Container for the necessary parameters to execute the DescribeApplicationVersions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeApplicationVersions service method, as returned by AmazonElasticBeanstalk.</returns> /// public DescribeApplicationVersionsResponse DescribeApplicationVersions(DescribeApplicationVersionsRequest describeApplicationVersionsRequest) { IRequest<DescribeApplicationVersionsRequest> request = new DescribeApplicationVersionsRequestMarshaller().Marshall(describeApplicationVersionsRequest); DescribeApplicationVersionsResponse response = Invoke<DescribeApplicationVersionsRequest, DescribeApplicationVersionsResponse> (request, this.signer, DescribeApplicationVersionsResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// /// </summary> /// <param name="createApplicationVersionRequest"></param> /// <returns></returns> public async Task CreateOrUpdateApplicationAsync(CreateApplicationVersionRequest createApplicationVersionRequest) { using (var ebClient = new AmazonElasticBeanstalkClient(creds, configurationProvider.RegionEndpoint)) { if (await IsNewApplicationAsync(ebClient)) { loggerProvider.GetLogger().Debug("New application - creating..."); var createApplicationRequest = new CreateApplicationRequest { ApplicationName = configurationProvider.LongApplicationName }; var createApplicationResponse = await ebClient.CreateApplicationAsync(createApplicationRequest); loggerProvider.GetLogger().Debug($"Created application: {createApplicationResponse}"); } var describeApplicationsRequest = new DescribeApplicationVersionsRequest { ApplicationName = configurationProvider.LongApplicationName, VersionLabels = new List<string> { configurationProvider.Version } }; var apps = await ebClient.DescribeApplicationVersionsAsync(describeApplicationsRequest); if (apps.ApplicationVersions.Any()) { loggerProvider.GetLogger().Debug("Application Version already exists"); return; } loggerProvider.GetLogger().Debug("Creating application version..."); var createApplicationVersionResponse = await ebClient.CreateApplicationVersionAsync(createApplicationVersionRequest); loggerProvider.GetLogger().Debug($"Created application version: {createApplicationVersionResponse}"); } }
internal DescribeApplicationVersionsResponse DescribeApplicationVersions(DescribeApplicationVersionsRequest request) { var task = DescribeApplicationVersionsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeDescribeApplicationVersions(DescribeApplicationVersionsRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DescribeApplicationVersionsRequestMarshaller(); var unmarshaller = DescribeApplicationVersionsResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// Initiates the asynchronous execution of the DescribeApplicationVersions operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeApplicationVersions operation on AmazonElasticBeanstalkClient.</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 EndDescribeApplicationVersions /// operation.</returns> public IAsyncResult BeginDescribeApplicationVersions(DescribeApplicationVersionsRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeApplicationVersionsRequestMarshaller(); var unmarshaller = DescribeApplicationVersionsResponseUnmarshaller.Instance; return BeginInvoke<DescribeApplicationVersionsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para>Returns descriptions for existing application versions.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeApplicationVersions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeApplicationVersions service method, as returned by AmazonElasticBeanstalk.</returns> public DescribeApplicationVersionsResponse DescribeApplicationVersions(DescribeApplicationVersionsRequest request) { var task = DescribeApplicationVersionsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.ElasticBeanstalk.Model.DescribeApplicationVersionsResponse CallAWSServiceOperation(IAmazonElasticBeanstalk client, Amazon.ElasticBeanstalk.Model.DescribeApplicationVersionsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elastic Beanstalk", "DescribeApplicationVersions"); try { #if DESKTOP return(client.DescribeApplicationVersions(request)); #elif CORECLR return(client.DescribeApplicationVersionsAsync(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; var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent; // create request and set iteration invariants var request = new Amazon.ElasticBeanstalk.Model.DescribeApplicationVersionsRequest(); if (cmdletContext.ApplicationName != null) { request.ApplicationName = cmdletContext.ApplicationName; } if (cmdletContext.VersionLabel != null) { request.VersionLabels = cmdletContext.VersionLabel; } // Initialize loop variants and commence piping System.String _nextToken = null; int? _emitLimit = null; int _retrievedSoFar = 0; if (AutoIterationHelpers.HasValue(cmdletContext.NextToken)) { _nextToken = cmdletContext.NextToken; } if (AutoIterationHelpers.HasValue(cmdletContext.MaxRecord)) { // The service has a maximum page size of 1000. If the user has // asked for more items than page max, and there is no page size // configured, we rely on the service ignoring the set maximum // and giving us 1000 items back. If a page size is set, that will // be used to configure the pagination. // We'll make further calls to satisfy the user's request. _emitLimit = cmdletContext.MaxRecord; } var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _nextToken; if (_emitLimit.HasValue) { int correctPageSize = AutoIterationHelpers.Min(1000, _emitLimit.Value); request.MaxRecords = AutoIterationHelpers.ConvertEmitLimitToInt32(correctPageSize); } else { request.MaxRecords = AutoIterationHelpers.ConvertEmitLimitToInt32(1000); } 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 }; int _receivedThisCall = response.ApplicationVersions.Count; _nextToken = response.NextToken; _retrievedSoFar += _receivedThisCall; if (_emitLimit.HasValue) { _emitLimit -= _receivedThisCall; } } catch (Exception e) { if (_retrievedSoFar == 0 || !_emitLimit.HasValue) { output = new CmdletOutput { ErrorResponse = e }; } else { break; } } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken) && (!_emitLimit.HasValue || _emitLimit.Value >= 1)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
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.ElasticBeanstalk.Model.DescribeApplicationVersionsRequest(); if (cmdletContext.ApplicationName != null) { request.ApplicationName = cmdletContext.ApplicationName; } if (cmdletContext.MaxRecord != null) { request.MaxRecords = AutoIterationHelpers.ConvertEmitLimitToServiceTypeInt32(cmdletContext.MaxRecord.Value); } if (cmdletContext.VersionLabel != null) { request.VersionLabels = cmdletContext.VersionLabel; } // Initialize loop variant and commence piping var _nextToken = cmdletContext.NextToken; var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.NextToken)); var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); do { request.NextToken = _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.NextToken; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } ProcessOutput(output); } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken)); if (useParameterSelect) { WriteObject(cmdletContext.Select(null, this)); } return(null); }
/// <summary> /// <para>Returns descriptions for existing application versions.</para> /// </summary> /// /// <param name="describeApplicationVersionsRequest">Container for the necessary parameters to execute the DescribeApplicationVersions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeApplicationVersions service method, as returned by AmazonElasticBeanstalk.</returns> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<DescribeApplicationVersionsResponse> DescribeApplicationVersionsAsync(DescribeApplicationVersionsRequest describeApplicationVersionsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeApplicationVersionsRequestMarshaller(); var unmarshaller = DescribeApplicationVersionsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DescribeApplicationVersionsRequest, DescribeApplicationVersionsResponse>(describeApplicationVersionsRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }