internal virtual ListConfigurationsResponse ListConfigurations(ListConfigurationsRequest request) { var marshaller = ListConfigurationsRequestMarshaller.Instance; var unmarshaller = ListConfigurationsResponseUnmarshaller.Instance; return(Invoke <ListConfigurationsRequest, ListConfigurationsResponse>(request, marshaller, unmarshaller)); }
protected override void ProcessRecord() { base.ProcessRecord(); ListConfigurationsRequest request; try { request = new ListConfigurationsRequest { CompartmentId = CompartmentId, OpcRequestId = OpcRequestId, ConfigurationId = ConfigurationId, LifecycleState = LifecycleState, Type = Type, DisplayName = DisplayName, ShapeName = ShapeName, SortBy = SortBy, SortOrder = SortOrder, Limit = Limit, Page = Page }; IEnumerable<ListConfigurationsResponse> responses = GetRequestDelegate().Invoke(request); foreach (var item in responses) { response = item; WriteOutput(response, response.Items, true); } FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
/// <summary> /// Lists the Configurations available when creating a DB System. /// <br/> /// This may include DEFAULT configurations per Shape and CUSTOM configurations. /// <br/> /// The default sort order is a multi-part sort by: /// - shapeName, ascending /// - DEFAULT-before-CUSTOM /// - displayName ascending /// /// </summary> /// <param name="request">The request object containing the details to send. Required.</param> /// <param name="retryConfiguration">The retry configuration that will be used by to send this request. Optional.</param> /// <param name="cancellationToken">The cancellation token to cancel this operation. Optional.</param> /// <returns>A response object containing details about the completed operation</returns> /// <example>Click <a href="https://docs.cloud.oracle.com/en-us/iaas/tools/dot-net-examples/latest/mysql/ListConfigurations.cs.html">here</a> to see an example of how to use ListConfigurations API.</example> public async Task <ListConfigurationsResponse> ListConfigurations(ListConfigurationsRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default) { logger.Trace("Called listConfigurations"); Uri uri = new Uri(this.restClient.GetEndpoint(), System.IO.Path.Combine(basePathWithoutHost, "/configurations".Trim('/'))); HttpMethod method = new HttpMethod("GET"); HttpRequestMessage requestMessage = Converter.ToHttpRequestMessage(uri, method, request); requestMessage.Headers.Add("Accept", "application/json"); GenericRetrier retryingClient = Retrier.GetPreferredRetrier(retryConfiguration, this.retryConfiguration); HttpResponseMessage responseMessage; try { if (retryingClient != null) { responseMessage = await retryingClient.MakeRetryingCall(this.restClient.HttpSend, requestMessage, cancellationToken).ConfigureAwait(false); } else { responseMessage = await this.restClient.HttpSend(requestMessage).ConfigureAwait(false); } this.restClient.CheckHttpResponseMessage(requestMessage, responseMessage); return(Converter.FromHttpResponseMessage <ListConfigurationsResponse>(responseMessage)); } catch (Exception e) { logger.Error($"ListConfigurations failed with error: {e.Message}"); throw; } }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonKafkaConfig config = new AmazonKafkaConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonKafkaClient client = new AmazonKafkaClient(creds, config); ListConfigurationsResponse resp = new ListConfigurationsResponse(); do { ListConfigurationsRequest req = new ListConfigurationsRequest { NextToken = resp.NextToken, MaxResults = maxItems }; resp = client.ListConfigurations(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Configurations) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
/// <summary> /// Initiates the asynchronous execution of the ListConfigurations operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListConfigurations 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/mq-2017-11-27/ListConfigurations">REST API Reference for ListConfigurations Operation</seealso> public virtual Task <ListConfigurationsResponse> ListConfigurationsAsync(ListConfigurationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = ListConfigurationsRequestMarshaller.Instance; var unmarshaller = ListConfigurationsResponseUnmarshaller.Instance; return(InvokeAsync <ListConfigurationsRequest, ListConfigurationsResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// 获取参数模板列表 /// </summary> public async Task <ListConfigurationsResponse> ListConfigurationsAsync(ListConfigurationsRequest listConfigurationsRequest) { Dictionary <string, string> urlParam = new Dictionary <string, string>(); string urlPath = HttpUtils.AddUrlPath("/v3/{project_id}/configurations", urlParam); SdkRequest request = HttpUtils.InitSdkRequest(urlPath, "application/json", listConfigurationsRequest); HttpResponseMessage response = await DoHttpRequestAsync("GET", request); return(JsonUtils.DeSerialize <ListConfigurationsResponse>(response)); }
/// <summary> /// Initiates the asynchronous execution of the ListConfigurations operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ListConfigurations 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/kafka-2018-11-14/ListConfigurations">REST API Reference for ListConfigurations Operation</seealso> public virtual Task <ListConfigurationsResponse> ListConfigurationsAsync(ListConfigurationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = ListConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListConfigurationsResponseUnmarshaller.Instance; return(InvokeAsync <ListConfigurationsResponse>(request, options, cancellationToken)); }
/// <summary> /// Returns a list of all the MSK configurations in this Region for this account. /// </summary> /// <param name="request">Container for the necessary parameters to execute the ListConfigurations service method.</param> /// /// <returns>The response from the ListConfigurations service method, as returned by Kafka.</returns> /// <exception cref="Amazon.Kafka.Model.BadRequestException"> /// Returns information about an error. /// </exception> /// <exception cref="Amazon.Kafka.Model.ForbiddenException"> /// Returns information about an error. /// </exception> /// <exception cref="Amazon.Kafka.Model.InternalServerErrorException"> /// Returns information about an error. /// </exception> /// <exception cref="Amazon.Kafka.Model.ServiceUnavailableException"> /// Returns information about an error. /// </exception> /// <exception cref="Amazon.Kafka.Model.UnauthorizedException"> /// Returns information about an error. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListConfigurations">REST API Reference for ListConfigurations Operation</seealso> public virtual ListConfigurationsResponse ListConfigurations(ListConfigurationsRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = ListConfigurationsRequestMarshaller.Instance; options.ResponseUnmarshaller = ListConfigurationsResponseUnmarshaller.Instance; return(Invoke <ListConfigurationsResponse>(request, options)); }
/// <summary> /// 查询实例配置参数 /// </summary> public async Task <ListConfigurationsResponse> ListConfigurationsAsync(ListConfigurationsRequest listConfigurationsRequest) { Dictionary <string, string> urlParam = new Dictionary <string, string>(); urlParam.Add("instance_id", listConfigurationsRequest.InstanceId.ToString()); string urlPath = HttpUtils.AddUrlPath("/v2/{project_id}/instances/{instance_id}/configs", urlParam); SdkRequest request = HttpUtils.InitSdkRequest(urlPath, listConfigurationsRequest); HttpResponseMessage response = await DoHttpRequestAsync("GET", request); return(JsonUtils.DeSerialize <ListConfigurationsResponse>(response)); }
public void TestListConfigurations() { IAmazonApplicationDiscoveryService client = new AmazonApplicationDiscoveryServiceClient(RegionEndpoint.USWest2); ListConfigurationsRequest request = new ListConfigurationsRequest { ConfigurationType = ConfigurationItemType.PROCESS }; ListConfigurationsResponse response = client.ListConfigurations(request); Assert.IsNotNull(response.ResponseMetadata.RequestId); }
/// <summary> /// Creates a new enumerable which will iterate over the ConfigurationSummary objects /// contained in responses from the ListConfigurations 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 <ConfigurationSummary> ListConfigurationsRecordEnumerator(ListConfigurationsRequest request, Common.Retry.RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default) { return(new Common.Utils.ResponseRecordEnumerable <ListConfigurationsRequest, ListConfigurationsResponse, ConfigurationSummary>( response => response.OpcNextPage, input => { if (!string.IsNullOrEmpty(input)) { request.Page = input; } return request; }, request => client.ListConfigurations(request, retryConfiguration, cancellationToken), response => response.Items )); }
public void TestListConfigurations() { IAmazonApplicationDiscoveryService client = new AmazonApplicationDiscoveryServiceClient(RegionEndpoint.USWest2); try { ListConfigurationsRequest request = new ListConfigurationsRequest { ConfigurationType = ConfigurationItemType.PROCESS }; ListConfigurationsResponse response = client.ListConfigurations(request); Assert.IsNotNull(response.ResponseMetadata.RequestId); } catch (AmazonApplicationDiscoveryServiceException e) { // We're really just making sure we can contact this service. // So an error from the service that the account isn't whitelisted is acceptable. if (!e.Message.Contains("is not whitelisted to access")) { throw; } } }
protected override void ProcessRecord() { base.ProcessRecord(); ListConfigurationsRequest request; try { request = new ListConfigurationsRequest { CompartmentId = CompartmentId, OpcRequestId = OpcRequestId, ConfigurationId = ConfigurationId, LifecycleState = LifecycleState, Type = Type, DisplayName = DisplayName, ShapeName = ShapeName, SortBy = SortBy, SortOrder = SortOrder, Limit = Limit, Page = Page }; IEnumerable <ListConfigurationsResponse> responses = GetRequestDelegate().Invoke(request); foreach (var item in responses) { response = item; WriteOutput(response, response.Items, 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); } }