コード例 #1
0
        internal virtual ListNamespacesResponse ListNamespaces(ListNamespacesRequest request)
        {
            var marshaller   = ListNamespacesRequestMarshaller.Instance;
            var unmarshaller = ListNamespacesResponseUnmarshaller.Instance;

            return(Invoke <ListNamespacesRequest, ListNamespacesResponse>(request, marshaller, unmarshaller));
        }
コード例 #2
0
        public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonServiceDiscoveryConfig config = new AmazonServiceDiscoveryConfig();

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

            ListNamespacesResponse resp = new ListNamespacesResponse();

            do
            {
                ListNamespacesRequest req = new ListNamespacesRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

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

                foreach (var obj in resp.Namespaces)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
コード例 #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListNamespaces operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListNamespaces 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/servicediscovery-2017-03-14/ListNamespaces">REST API Reference for ListNamespaces Operation</seealso>
        public virtual Task <ListNamespacesResponse> ListNamespacesAsync(ListNamespacesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = ListNamespacesRequestMarshaller.Instance;
            var unmarshaller = ListNamespacesResponseUnmarshaller.Instance;

            return(InvokeAsync <ListNamespacesRequest, ListNamespacesResponse>(request, marshaller,
                                                                               unmarshaller, cancellationToken));
        }
コード例 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListNamespaces operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListNamespaces 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/servicediscovery-2017-03-14/ListNamespaces">REST API Reference for ListNamespaces Operation</seealso>
        public virtual Task <ListNamespacesResponse> ListNamespacesAsync(ListNamespacesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListNamespacesRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListNamespacesResponseUnmarshaller.Instance;

            return(InvokeAsync <ListNamespacesResponse>(request, options, cancellationToken));
        }
コード例 #5
0
        internal virtual ListNamespacesResponse ListNamespaces(ListNamespacesRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListNamespacesRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListNamespacesResponseUnmarshaller.Instance;

            return(Invoke <ListNamespacesResponse>(request, options));
        }
コード例 #6
0
ファイル: ScfClient.cs プロジェクト: OryxLib/Oryx.FastAdmin
        /// <summary>
        /// ListNamespaces接口的同步版本,列出命名空间列表
        /// </summary>
        /// <param name="req">参考<see cref="ListNamespacesRequest"/></param>
        /// <returns>参考<see cref="ListNamespacesResponse"/>实例</returns>
        public ListNamespacesResponse ListNamespacesSync(ListNamespacesRequest req)
        {
            JsonResponseModel <ListNamespacesResponse> rsp = null;

            try
            {
                var strResp = this.InternalRequestSync(req, "ListNamespaces");
                rsp = JsonConvert.DeserializeObject <JsonResponseModel <ListNamespacesResponse> >(strResp);
            }
            catch (JsonSerializationException e)
            {
                throw new TencentCloudSDKException(e.Message);
            }
            return(rsp.Response);
        }
コード例 #7
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListNamespacesRequest request;

            try
            {
                request = new ListNamespacesRequest
                {
                    CatalogId           = CatalogId,
                    DisplayName         = DisplayName,
                    DisplayNameContains = DisplayNameContains,
                    LifecycleState      = LifecycleState,
                    TimeCreated         = TimeCreated,
                    TimeUpdated         = TimeUpdated,
                    CreatedById         = CreatedById,
                    UpdatedById         = UpdatedById,
                    SortBy       = SortBy,
                    SortOrder    = SortOrder,
                    Fields       = Fields,
                    Limit        = Limit,
                    Page         = Page,
                    OpcRequestId = OpcRequestId
                };
                IEnumerable <ListNamespacesResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.NamespaceCollection, true);
                }
                if (!ParameterSetName.Equals(AllPageSet) && !ParameterSetName.Equals(LimitSet) && response.OpcNextPage != null)
                {
                    WriteWarning("This operation supports pagination and not all resources were returned. Re-run using the -All option to auto paginate and list all resources.");
                }
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
コード例 #8
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListNamespacesRequest request;

            try
            {
                request = new ListNamespacesRequest
                {
                    CompartmentId = CompartmentId,
                    OpcRequestId  = OpcRequestId
                };

                response = client.ListNamespaces(request).GetAwaiter().GetResult();
                WriteOutput(response, response.NamespaceCollection);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }