private void DescribeConfigurationOptions() { using (var client = Amazon.AWSClientFactory.CreateAmazonElasticBeanstalkClient(GetConf())) { Amazon.ElasticBeanstalk.Model.DescribeEnvironmentsRequest req = new Amazon.ElasticBeanstalk.Model.DescribeEnvironmentsRequest(); req.ApplicationName = "vielgi"; var response = client.DescribeEnvironments(req); string envName = response.Environments[0].EnvironmentName; string envId = response.Environments[0].EnvironmentId; string health = response.Environments[0].Health.Value; lblHealth.Text = Server.HtmlEncode(health); string status = response.Environments[0].Status.Value; lblStatus.Text = Server.HtmlEncode(status); if (Options == null) { Amazon.ElasticBeanstalk.Model.DescribeConfigurationOptionsRequest optReq = new Amazon.ElasticBeanstalk.Model.DescribeConfigurationOptionsRequest(); optReq.EnvironmentName = envName; optReq.ApplicationName = req.ApplicationName; var optResp = client.DescribeConfigurationOptions(optReq); Options = optResp.Options; } Amazon.ElasticBeanstalk.Model.DescribeConfigurationSettingsRequest setReq = new Amazon.ElasticBeanstalk.Model.DescribeConfigurationSettingsRequest(); setReq.ApplicationName = req.ApplicationName; setReq.EnvironmentName = envName; var setResp = client.DescribeConfigurationSettings(setReq); gvOptions.DataSource = setResp.ConfigurationSettings[0].OptionSettings.Where(x => x.OptionName == "MinSize" || x.OptionName == "MaxSize"); gvOptions.DataBind(); #region buttons if (status.ToLower() != "ready") { btnSet1.Visible = btnSet2.Visible = false; } else { int currentMinSize = Convert.ToInt32(setResp.ConfigurationSettings[0].OptionSettings.Where(x => x.OptionName == "MinSize").Single().Value); btnSet2.Visible = currentMinSize == 1; btnSet1.Visible = !btnSet2.Visible; } #endregion lblGenerated.Text = string.Format("Generated on {0: H:mm:ss}", DateTime.Now); } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElasticBeanstalk.Model.DescribeConfigurationOptionsRequest(); if (cmdletContext.ApplicationName != null) { request.ApplicationName = cmdletContext.ApplicationName; } if (cmdletContext.EnvironmentName != null) { request.EnvironmentName = cmdletContext.EnvironmentName; } if (cmdletContext.Option != null) { request.Options = cmdletContext.Option; } if (cmdletContext.PlatformArn != null) { request.PlatformArn = cmdletContext.PlatformArn; } if (cmdletContext.SolutionStackName != null) { request.SolutionStackName = cmdletContext.SolutionStackName; } if (cmdletContext.TemplateName != null) { request.TemplateName = cmdletContext.TemplateName; } 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> Describes the configuration options that are used in a particular configuration template or environment, or that a specified solution /// stack defines. The description includes the values the options, their default values, and an indication of the required action on a running /// environment if an option value is changed. </para> /// </summary> /// /// <param name="describeConfigurationOptionsRequest">Container for the necessary parameters to execute the DescribeConfigurationOptions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeConfigurationOptions service method, as returned by AmazonElasticBeanstalk.</returns> /// public DescribeConfigurationOptionsResponse DescribeConfigurationOptions(DescribeConfigurationOptionsRequest describeConfigurationOptionsRequest) { IAsyncResult asyncResult = invokeDescribeConfigurationOptions(describeConfigurationOptionsRequest, null, null, true); return EndDescribeConfigurationOptions(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DescribeConfigurationOptions operation. /// <seealso cref="Amazon.ElasticBeanstalk.AmazonElasticBeanstalk.DescribeConfigurationOptions"/> /// </summary> /// /// <param name="describeConfigurationOptionsRequest">Container for the necessary parameters to execute the DescribeConfigurationOptions /// 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 /// EndDescribeConfigurationOptions operation.</returns> public IAsyncResult BeginDescribeConfigurationOptions(DescribeConfigurationOptionsRequest describeConfigurationOptionsRequest, AsyncCallback callback, object state) { return invokeDescribeConfigurationOptions(describeConfigurationOptionsRequest, callback, state, false); }
IAsyncResult invokeDescribeConfigurationOptions(DescribeConfigurationOptionsRequest describeConfigurationOptionsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DescribeConfigurationOptionsRequestMarshaller().Marshall(describeConfigurationOptionsRequest); var unmarshaller = DescribeConfigurationOptionsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DescribeConfigurationOptions operation. /// <seealso cref="Amazon.ElasticBeanstalk.IAmazonElasticBeanstalk"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConfigurationOptions 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<DescribeConfigurationOptionsResponse> DescribeConfigurationOptionsAsync(DescribeConfigurationOptionsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeConfigurationOptionsRequestMarshaller(); var unmarshaller = DescribeConfigurationOptionsResponseUnmarshaller.Instance; return InvokeAsync<DescribeConfigurationOptionsRequest,DescribeConfigurationOptionsResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal DescribeConfigurationOptionsResponse DescribeConfigurationOptions(DescribeConfigurationOptionsRequest request) { var marshaller = new DescribeConfigurationOptionsRequestMarshaller(); var unmarshaller = DescribeConfigurationOptionsResponseUnmarshaller.Instance; return Invoke<DescribeConfigurationOptionsRequest,DescribeConfigurationOptionsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para> Describes the configuration options that are used in a particular configuration template or environment, or that a specified solution /// stack defines. The description includes the values the options, their default values, and an indication of the required action on a running /// environment if an option value is changed. </para> /// </summary> /// /// <param name="describeConfigurationOptionsRequest">Container for the necessary parameters to execute the DescribeConfigurationOptions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeConfigurationOptions service method, as returned by AmazonElasticBeanstalk.</returns> /// public DescribeConfigurationOptionsResponse DescribeConfigurationOptions(DescribeConfigurationOptionsRequest describeConfigurationOptionsRequest) { IRequest<DescribeConfigurationOptionsRequest> request = new DescribeConfigurationOptionsRequestMarshaller().Marshall(describeConfigurationOptionsRequest); DescribeConfigurationOptionsResponse response = Invoke<DescribeConfigurationOptionsRequest, DescribeConfigurationOptionsResponse> (request, this.signer, DescribeConfigurationOptionsResponseUnmarshaller.GetInstance()); return response; }
/// <summary> /// <para> Describes the configuration options that are used in a particular configuration template or environment, or that a specified solution /// stack defines. The description includes the values the options, their default values, and an indication of the required action on a running /// environment if an option value is changed. </para> /// </summary> /// /// <param name="describeConfigurationOptionsRequest">Container for the necessary parameters to execute the DescribeConfigurationOptions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeConfigurationOptions 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<DescribeConfigurationOptionsResponse> DescribeConfigurationOptionsAsync(DescribeConfigurationOptionsRequest describeConfigurationOptionsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeConfigurationOptionsRequestMarshaller(); var unmarshaller = DescribeConfigurationOptionsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DescribeConfigurationOptionsRequest, DescribeConfigurationOptionsResponse>(describeConfigurationOptionsRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DescribeConfigurationOptionsResponse DescribeConfigurationOptions(DescribeConfigurationOptionsRequest request) { var task = DescribeConfigurationOptionsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the DescribeConfigurationOptions operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConfigurationOptions 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 EndDescribeConfigurationOptions /// operation.</returns> public IAsyncResult BeginDescribeConfigurationOptions(DescribeConfigurationOptionsRequest request, AsyncCallback callback, object state) { var marshaller = new DescribeConfigurationOptionsRequestMarshaller(); var unmarshaller = DescribeConfigurationOptionsResponseUnmarshaller.Instance; return BeginInvoke<DescribeConfigurationOptionsRequest>(request, marshaller, unmarshaller, callback, state); }
IAsyncResult invokeDescribeConfigurationOptions(DescribeConfigurationOptionsRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DescribeConfigurationOptionsRequestMarshaller(); var unmarshaller = DescribeConfigurationOptionsResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
/// <summary> /// <para> Describes the configuration options that are used in a particular configuration template or environment, or that a specified solution /// stack defines. The description includes the values the options, their default values, and an indication of the required action on a running /// environment if an option value is changed. </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DescribeConfigurationOptions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeConfigurationOptions service method, as returned by AmazonElasticBeanstalk.</returns> public DescribeConfigurationOptionsResponse DescribeConfigurationOptions(DescribeConfigurationOptionsRequest request) { var task = DescribeConfigurationOptionsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.ElasticBeanstalk.Model.DescribeConfigurationOptionsResponse CallAWSServiceOperation(IAmazonElasticBeanstalk client, Amazon.ElasticBeanstalk.Model.DescribeConfigurationOptionsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elastic Beanstalk", "DescribeConfigurationOptions"); try { #if DESKTOP return(client.DescribeConfigurationOptions(request)); #elif CORECLR return(client.DescribeConfigurationOptionsAsync(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> /// <para> Describes the configuration options that are used in a particular configuration template or environment, or that a specified solution /// stack defines. The description includes the values the options, their default values, and an indication of the required action on a running /// environment if an option value is changed. </para> /// </summary> /// /// <param name="describeConfigurationOptionsRequest">Container for the necessary parameters to execute the DescribeConfigurationOptions service /// method on AmazonElasticBeanstalk.</param> /// /// <returns>The response from the DescribeConfigurationOptions 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<DescribeConfigurationOptionsResponse> DescribeConfigurationOptionsAsync(DescribeConfigurationOptionsRequest describeConfigurationOptionsRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DescribeConfigurationOptionsRequestMarshaller(); var unmarshaller = DescribeConfigurationOptionsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DescribeConfigurationOptionsRequest, DescribeConfigurationOptionsResponse>(describeConfigurationOptionsRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }