コード例 #1
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonRedshiftConfig config = new AmazonRedshiftConfig();

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

            DescribeClustersResponse resp = new DescribeClustersResponse();

            do
            {
                DescribeClustersRequest req = new DescribeClustersRequest
                {
                    Marker = resp.Marker
                    ,
                    MaxRecords = maxItems
                };

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

                foreach (var obj in resp.Clusters)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.Marker));
        }
コード例 #2
0
        internal virtual DescribeClustersResponse DescribeClusters(DescribeClustersRequest request)
        {
            var marshaller   = DescribeClustersRequestMarshaller.Instance;
            var unmarshaller = DescribeClustersResponseUnmarshaller.Instance;

            return(Invoke <DescribeClustersRequest, DescribeClustersResponse>(request, marshaller, unmarshaller));
        }
コード例 #3
0
        /// <summary>
        /// Gets information about AWS CloudHSM clusters.
        ///
        ///
        /// <para>
        /// This is a paginated operation, which means that each response might contain only a
        /// subset of all the clusters. When the response contains only a subset of clusters,
        /// it includes a <code>NextToken</code> value. Use this value in a subsequent <code>DescribeClusters</code>
        /// request to get more clusters. When you receive a response with no <code>NextToken</code>
        /// (or an empty or null value), that means there are no more clusters to get.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DescribeClusters service method.</param>
        ///
        /// <returns>The response from the DescribeClusters service method, as returned by CloudHSMV2.</returns>
        /// <exception cref="Amazon.CloudHSMV2.Model.CloudHsmAccessDeniedException">
        /// The request was rejected because the requester does not have permission to perform
        /// the requested operation.
        /// </exception>
        /// <exception cref="Amazon.CloudHSMV2.Model.CloudHsmInternalFailureException">
        /// The request was rejected because of an AWS CloudHSM internal failure. The request
        /// can be retried.
        /// </exception>
        /// <exception cref="Amazon.CloudHSMV2.Model.CloudHsmInvalidRequestException">
        /// The request was rejected because it is not a valid request.
        /// </exception>
        /// <exception cref="Amazon.CloudHSMV2.Model.CloudHsmServiceException">
        /// The request was rejected because an error occurred.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeClusters">REST API Reference for DescribeClusters Operation</seealso>
        public DescribeClustersResponse DescribeClusters(DescribeClustersRequest request)
        {
            var marshaller   = new DescribeClustersRequestMarshaller();
            var unmarshaller = DescribeClustersResponseUnmarshaller.Instance;

            return(Invoke <DescribeClustersRequest, DescribeClustersResponse>(request, marshaller, unmarshaller));
        }
コード例 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeClusters operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeClusters 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DescribeClusters">REST API Reference for DescribeClusters Operation</seealso>
        public virtual Task <DescribeClustersResponse> DescribeClustersAsync(DescribeClustersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = DescribeClustersRequestMarshaller.Instance;
            var unmarshaller = DescribeClustersResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeClustersRequest, DescribeClustersResponse>(request, marshaller,
                                                                                   unmarshaller, cancellationToken));
        }
コード例 #5
0
        /// <summary>
        /// Initiates the asynchronous execution of the DescribeClusters operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DescribeClusters 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeClusters">REST API Reference for DescribeClusters Operation</seealso>
        public virtual Task <DescribeClustersResponse> DescribeClustersAsync(DescribeClustersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeClustersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeClustersResponseUnmarshaller.Instance;

            return(InvokeAsync <DescribeClustersResponse>(request, options, cancellationToken));
        }
コード例 #6
0
        internal virtual DescribeClustersResponse DescribeClusters(DescribeClustersRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DescribeClustersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DescribeClustersResponseUnmarshaller.Instance;

            return(Invoke <DescribeClustersResponse>(request, options));
        }
コード例 #7
0
        public async Task <Cluster> GetCluster(string clusterName)
        {
            var request = new DescribeClustersRequest
            {
                Clusters = new List <string>
                {
                    clusterName
                }
            };
            var response = await _client.DescribeClustersAsync(request);

            return(response.Clusters.First());
        }
コード例 #8
0
        /// <summary>
        /// 查询TcaplusDB集群列表,包含集群详细信息。
        /// </summary>
        /// <param name="req"><see cref="DescribeClustersRequest"/></param>
        /// <returns><see cref="DescribeClustersResponse"/></returns>
        public DescribeClustersResponse DescribeClustersSync(DescribeClustersRequest req)
        {
            JsonResponseModel <DescribeClustersResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "DescribeClusters");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <DescribeClustersResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
コード例 #9
0
 /// <summary>
 ///  查询集群列表
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public async Task <DescribeClustersResponse> DescribeClusters(DescribeClustersRequest request)
 {
     return(await new DescribeClustersExecutor().Client(this).Execute <DescribeClustersResponse, DescribeClustersResult, DescribeClustersRequest>(request).ConfigureAwait(false));
 }
コード例 #10
0
 /// <summary>
 ///  查询集群列表
 /// </summary>
 /// <param name="request">请求参数信息</param>
 /// <returns>请求结果信息</returns>
 public DescribeClustersResponse DescribeClusters(DescribeClustersRequest request)
 {
     return(new DescribeClustersExecutor().Client(this).Execute <DescribeClustersResponse, DescribeClustersResult, DescribeClustersRequest>(request));
 }