/// <summary>
        /// <para>Returns the descriptions of existing applications.</para>
        /// </summary>
        ///
        /// <param name="describeApplicationsRequest">Container for the necessary parameters to execute the DescribeApplications service method on
        ///           AmazonElasticBeanstalk.</param>
        ///
        /// <returns>The response from the DescribeApplications service method, as returned by AmazonElasticBeanstalk.</returns>
        ///
        public DescribeApplicationsResponse DescribeApplications(DescribeApplicationsRequest describeApplicationsRequest)
        {
            IRequest <DescribeApplicationsRequest> request  = new DescribeApplicationsRequestMarshaller().Marshall(describeApplicationsRequest);
            DescribeApplicationsResponse           response = Invoke <DescribeApplicationsRequest, DescribeApplicationsResponse> (request, this.signer, DescribeApplicationsResponseUnmarshaller.GetInstance());

            return(response);
        }
Beispiel #2
0
        private async Task <bool> DoesApplicationExist(string applicationName)
        {
            var request = new DescribeApplicationsRequest();

            request.ApplicationNames.Add(applicationName);
            var response = await this.EBClient.DescribeApplicationsAsync(request);

            return(response.Applications.Count == 1);
        }
Beispiel #3
0
        public async Task <bool> IsExists()
        {
            var request = new DescribeApplicationsRequest
            {
                ApplicationNames = new List <string> {
                    APPLICATION_NAME
                }
            };
            var response = await client.DescribeApplicationsAsync(request);

            return(response.Applications.Count > 0);
        }
Beispiel #4
0
        /// <summary>
        /// 获取应用列表
        /// </summary>
        /// <param name="req">参考<see cref="DescribeApplicationsRequest"/></param>
        /// <returns>参考<see cref="DescribeApplicationsResponse"/>实例</returns>
        public async Task <DescribeApplicationsResponse> DescribeApplications(DescribeApplicationsRequest req)
        {
            JsonResponseModel <DescribeApplicationsResponse> rsp = null;

            try
            {
                var strResp = await this.InternalRequest(req, "DescribeApplications");

                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DescribeApplicationsResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonElasticBeanstalkConfig config = new AmazonElasticBeanstalkConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonElasticBeanstalkClient client = new AmazonElasticBeanstalkClient(creds, config);

            DescribeApplicationsResponse resp = new DescribeApplicationsResponse();
            DescribeApplicationsRequest  req  = new DescribeApplicationsRequest
            {
            };

            resp = client.DescribeApplications(req);
            CheckError(resp.HttpStatusCode, "200");

            foreach (var obj in resp.Applications)
            {
                AddObject(obj);
            }
        }