Exemplo n.º 1
0
        internal virtual ListListenersResponse ListListeners(ListListenersRequest request)
        {
            var marshaller   = ListListenersRequestMarshaller.Instance;
            var unmarshaller = ListListenersResponseUnmarshaller.Instance;

            return(Invoke <ListListenersRequest, ListListenersResponse>(request, marshaller, unmarshaller));
        }
Exemplo n.º 2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            ListListenersRequest request;

            try
            {
                request = new ListListenersRequest
                {
                    NetworkLoadBalancerId = NetworkLoadBalancerId,
                    OpcRequestId          = OpcRequestId,
                    IfNoneMatch           = IfNoneMatch,
                    Limit     = Limit,
                    Page      = Page,
                    SortOrder = SortOrder
                };
                IEnumerable <ListListenersResponse> responses = GetRequestDelegate().Invoke(request);
                foreach (var item in responses)
                {
                    response = item;
                    WriteOutput(response, response.ListenerCollection, 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);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListListeners operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListListeners 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/globalaccelerator-2018-08-08/ListListeners">REST API Reference for ListListeners Operation</seealso>
        public virtual Task <ListListenersResponse> ListListenersAsync(ListListenersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = ListListenersRequestMarshaller.Instance;
            var unmarshaller = ListListenersResponseUnmarshaller.Instance;

            return(InvokeAsync <ListListenersRequest, ListListenersResponse>(request, marshaller,
                                                                             unmarshaller, cancellationToken));
        }
Exemplo n.º 4
0
        /// <summary>
        /// 查询监听器列表
        /// </summary>
        public ListListenersResponse ListListeners(ListListenersRequest listListenersRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();
            string              urlPath          = HttpUtils.AddUrlPath("/v3/{project_id}/elb/listeners", urlParam);
            SdkRequest          request          = HttpUtils.InitSdkRequest(urlPath, "application/json", listListenersRequest);
            HttpResponseMessage response         = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ListListenersResponse>(response));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initiates the asynchronous execution of the ListListeners operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ListListeners 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/globalaccelerator-2018-08-08/ListListeners">REST API Reference for ListListeners Operation</seealso>
        public virtual Task <ListListenersResponse> ListListenersAsync(ListListenersRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListListenersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListListenersResponseUnmarshaller.Instance;

            return(InvokeAsync <ListListenersResponse>(request, options, cancellationToken));
        }
Exemplo n.º 6
0
        internal virtual ListListenersResponse ListListeners(ListListenersRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListListenersRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListListenersResponseUnmarshaller.Instance;

            return(Invoke <ListListenersResponse>(request, options));
        }
 /// <summary>
 /// Creates a new enumerable which will iterate over the responses received from the ListListeners operation. This enumerable
 /// will fetch more data from the server as needed.
 /// </summary>
 /// <param name="request">The request object containing the details to send</param>
 /// <param name="retryConfiguration">The configuration for retrying, may be null</param>
 /// <param name="cancellationToken">The cancellation token object</param>
 /// <returns>The enumerator, which supports a simple iteration over a collection of a specified type</returns>
 public IEnumerable <ListListenersResponse> ListListenersResponseEnumerator(ListListenersRequest request, Common.Retry.RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default)
 {
     return(new Common.Utils.ResponseEnumerable <ListListenersRequest, ListListenersResponse>(
                response => response.OpcNextPage,
                input =>
     {
         if (!string.IsNullOrEmpty(input))
         {
             request.Page = input;
         }
         return request;
     },
                request => client.ListListeners(request, retryConfiguration, cancellationToken)
                ));
 }