/* * Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.osis; import org.w3c.dom.*; import java.net.*; import java.util.*; import javax.annotation.Generated; import org.apache.commons.logging.*; import com.amazonaws.*; import com.amazonaws.annotation.SdkInternalApi; import com.amazonaws.auth.*; import com.amazonaws.handlers.*; import com.amazonaws.http.*; import com.amazonaws.internal.*; import com.amazonaws.internal.auth.*; import com.amazonaws.metrics.*; import com.amazonaws.regions.*; import com.amazonaws.transform.*; import com.amazonaws.util.*; import com.amazonaws.protocol.json.*; import com.amazonaws.util.AWSRequestMetrics.Field; import com.amazonaws.annotation.ThreadSafe; import com.amazonaws.client.AwsSyncClientParams; import com.amazonaws.client.builder.AdvancedConfig; import com.amazonaws.services.osis.AmazonOSISClientBuilder; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.osis.model.*; import com.amazonaws.services.osis.model.transform.*; /** * Client for accessing Amazon OpenSearch Ingestion. All service calls made using this client are blocking, and will not * return until the service call completes. *
*
* Use the Amazon OpenSearch Ingestion API to create and manage ingestion pipelines. OpenSearch Ingestion is a fully * managed data collector that delivers real-time log and trace data to OpenSearch Service domains. For more * information, see Getting data into your * cluster using OpenSearch Ingestion. *
*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonOSISClient extends AmazonWebServiceClient implements AmazonOSIS { /** Provider for AWS credentials. */ private final AWSCredentialsProvider awsCredentialsProvider; private static final Log log = LogFactory.getLog(AmazonOSIS.class); /** Default signing name for the service. */ private static final String DEFAULT_SIGNING_NAME = "osis"; /** Client configuration factory providing ClientConfigurations tailored to this client */ protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory(); private final AdvancedConfig advancedConfig; private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory( new JsonClientMetadata() .withProtocolVersion("1.1") .withSupportsCbor(false) .withSupportsIon(false) .withContentTypeOverride("application/json") .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller( com.amazonaws.services.osis.model.transform.AccessDeniedExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ConflictException").withExceptionUnmarshaller( com.amazonaws.services.osis.model.transform.ConflictExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller( com.amazonaws.services.osis.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller( com.amazonaws.services.osis.model.transform.ValidationExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("ResourceAlreadyExistsException").withExceptionUnmarshaller( com.amazonaws.services.osis.model.transform.ResourceAlreadyExistsExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InternalException").withExceptionUnmarshaller( com.amazonaws.services.osis.model.transform.InternalExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("InvalidPaginationTokenException").withExceptionUnmarshaller( com.amazonaws.services.osis.model.transform.InvalidPaginationTokenExceptionUnmarshaller.getInstance())) .addErrorMetadata( new JsonErrorShapeMetadata().withErrorCode("LimitExceededException").withExceptionUnmarshaller( com.amazonaws.services.osis.model.transform.LimitExceededExceptionUnmarshaller.getInstance())) .withBaseServiceExceptionClass(com.amazonaws.services.osis.model.AmazonOSISException.class)); public static AmazonOSISClientBuilder builder() { return AmazonOSISClientBuilder.standard(); } /** * Constructs a new client to invoke service methods on Amazon OpenSearch Ingestion using the specified parameters. * ** All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AmazonOSISClient(AwsSyncClientParams clientParams) { this(clientParams, false); } /** * Constructs a new client to invoke service methods on Amazon OpenSearch Ingestion using the specified parameters. * *
* All service calls made using this new client object are blocking, and will not return until the service call * completes. * * @param clientParams * Object providing client parameters. */ AmazonOSISClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) { super(clientParams); this.awsCredentialsProvider = clientParams.getCredentialsProvider(); this.advancedConfig = clientParams.getAdvancedConfig(); init(); } private void init() { setServiceNameIntern(DEFAULT_SIGNING_NAME); setEndpointPrefix(ENDPOINT_PREFIX); // calling this.setEndPoint(...) will also modify the signer accordingly setEndpoint("osis.us-east-1.amazonaws.com"); HandlerChainFactory chainFactory = new HandlerChainFactory(); requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/osis/request.handlers")); requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/osis/request.handler2s")); requestHandler2s.addAll(chainFactory.getGlobalHandlers()); } /** *
* Creates an OpenSearch Ingestion pipeline. For more information, see Creating * Amazon OpenSearch Ingestion pipelines. *
* * @param createPipelineRequest * @return Result of the CreatePipeline operation returned by the service. * @throws LimitExceededException * You attempted to create more than the allowed number of tags. * @throws ValidationException * An exception for missing or invalid input fields. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws ResourceAlreadyExistsException * You attempted to create a resource that already exists. * @sample AmazonOSIS.CreatePipeline * @see AWS API * Documentation */ @Override public CreatePipelineResult createPipeline(CreatePipelineRequest request) { request = beforeClientExecution(request); return executeCreatePipeline(request); } @SdkInternalApi final CreatePipelineResult executeCreatePipeline(CreatePipelineRequest createPipelineRequest) { ExecutionContext executionContext = createExecutionContext(createPipelineRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Deletes an OpenSearch Ingestion pipeline. For more information, see Deleting Amazon * OpenSearch Ingestion pipelines. *
* * @param deletePipelineRequest * @return Result of the DeletePipeline operation returned by the service. * @throws ValidationException * An exception for missing or invalid input fields. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws ResourceNotFoundException * You attempted to access or delete a resource that does not exist. * @throws ConflictException * The client attempted to remove a resource that is currently in use. * @sample AmazonOSIS.DeletePipeline * @see AWS API * Documentation */ @Override public DeletePipelineResult deletePipeline(DeletePipelineRequest request) { request = beforeClientExecution(request); return executeDeletePipeline(request); } @SdkInternalApi final DeletePipelineResult executeDeletePipeline(DeletePipelineRequest deletePipelineRequest) { ExecutionContext executionContext = createExecutionContext(deletePipelineRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Retrieves information about an OpenSearch Ingestion pipeline. *
* * @param getPipelineRequest * @return Result of the GetPipeline operation returned by the service. * @throws ValidationException * An exception for missing or invalid input fields. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws ResourceNotFoundException * You attempted to access or delete a resource that does not exist. * @sample AmazonOSIS.GetPipeline * @see AWS API * Documentation */ @Override public GetPipelineResult getPipeline(GetPipelineRequest request) { request = beforeClientExecution(request); return executeGetPipeline(request); } @SdkInternalApi final GetPipelineResult executeGetPipeline(GetPipelineRequest getPipelineRequest) { ExecutionContext executionContext = createExecutionContext(getPipelineRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request
* Retrieves information about a specific blueprint for OpenSearch Ingestion. Blueprints are templates for the
* configuration needed for a CreatePipeline
request. For more information, see Using blueprints to create a pipeline.
*
* Returns progress information for the current change happening on an OpenSearch Ingestion pipeline. Currently, * this operation only returns information when a pipeline is being created. *
** For more information, see Tracking the status of pipeline creation. *
* * @param getPipelineChangeProgressRequest * @return Result of the GetPipelineChangeProgress operation returned by the service. * @throws ValidationException * An exception for missing or invalid input fields. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws ResourceNotFoundException * You attempted to access or delete a resource that does not exist. * @sample AmazonOSIS.GetPipelineChangeProgress * @see AWS * API Documentation */ @Override public GetPipelineChangeProgressResult getPipelineChangeProgress(GetPipelineChangeProgressRequest request) { request = beforeClientExecution(request); return executeGetPipelineChangeProgress(request); } @SdkInternalApi final GetPipelineChangeProgressResult executeGetPipelineChangeProgress(GetPipelineChangeProgressRequest getPipelineChangeProgressRequest) { ExecutionContext executionContext = createExecutionContext(getPipelineChangeProgressRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Retrieves a list of all available blueprints for Data Prepper. For more information, see Using blueprints to create a pipeline. *
* * @param listPipelineBlueprintsRequest * @return Result of the ListPipelineBlueprints operation returned by the service. * @throws ValidationException * An exception for missing or invalid input fields. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws InvalidPaginationTokenException * An invalid pagination token provided in the request. * @sample AmazonOSIS.ListPipelineBlueprints * @see AWS * API Documentation */ @Override public ListPipelineBlueprintsResult listPipelineBlueprints(ListPipelineBlueprintsRequest request) { request = beforeClientExecution(request); return executeListPipelineBlueprints(request); } @SdkInternalApi final ListPipelineBlueprintsResult executeListPipelineBlueprints(ListPipelineBlueprintsRequest listPipelineBlueprintsRequest) { ExecutionContext executionContext = createExecutionContext(listPipelineBlueprintsRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists all OpenSearch Ingestion pipelines in the current Amazon Web Services account and Region. For more * information, see Viewing Amazon * OpenSearch Ingestion pipelines. *
* * @param listPipelinesRequest * @return Result of the ListPipelines operation returned by the service. * @throws ValidationException * An exception for missing or invalid input fields. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws InvalidPaginationTokenException * An invalid pagination token provided in the request. * @sample AmazonOSIS.ListPipelines * @see AWS API * Documentation */ @Override public ListPipelinesResult listPipelines(ListPipelinesRequest request) { request = beforeClientExecution(request); return executeListPipelines(request); } @SdkInternalApi final ListPipelinesResult executeListPipelines(ListPipelinesRequest listPipelinesRequest) { ExecutionContext executionContext = createExecutionContext(listPipelinesRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Lists all resource tags associated with an OpenSearch Ingestion pipeline. For more information, see Tagging Amazon * OpenSearch Ingestion pipelines. *
* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws ValidationException * An exception for missing or invalid input fields. * @throws ResourceNotFoundException * You attempted to access or delete a resource that does not exist. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @sample AmazonOSIS.ListTagsForResource * @see AWS API * Documentation */ @Override public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) { request = beforeClientExecution(request); return executeListTagsForResource(request); } @SdkInternalApi final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) { ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Starts an OpenSearch Ingestion pipeline. For more information, see Starting an OpenSearch Ingestion pipeline. *
* * @param startPipelineRequest * @return Result of the StartPipeline operation returned by the service. * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws ConflictException * The client attempted to remove a resource that is currently in use. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws ResourceNotFoundException * You attempted to access or delete a resource that does not exist. * @throws ValidationException * An exception for missing or invalid input fields. * @sample AmazonOSIS.StartPipeline * @see AWS API * Documentation */ @Override public StartPipelineResult startPipeline(StartPipelineRequest request) { request = beforeClientExecution(request); return executeStartPipeline(request); } @SdkInternalApi final StartPipelineResult executeStartPipeline(StartPipelineRequest startPipelineRequest) { ExecutionContext executionContext = createExecutionContext(startPipelineRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Stops an OpenSearch Ingestion pipeline. For more information, see Stopping an OpenSearch Ingestion pipeline. *
* * @param stopPipelineRequest * @return Result of the StopPipeline operation returned by the service. * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws ConflictException * The client attempted to remove a resource that is currently in use. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws ResourceNotFoundException * You attempted to access or delete a resource that does not exist. * @throws ValidationException * An exception for missing or invalid input fields. * @sample AmazonOSIS.StopPipeline * @see AWS API * Documentation */ @Override public StopPipelineResult stopPipeline(StopPipelineRequest request) { request = beforeClientExecution(request); return executeStopPipeline(request); } @SdkInternalApi final StopPipelineResult executeStopPipeline(StopPipelineRequest stopPipelineRequest) { ExecutionContext executionContext = createExecutionContext(stopPipelineRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Tags an OpenSearch Ingestion pipeline. For more information, see Tagging Amazon * OpenSearch Ingestion pipelines. *
* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws LimitExceededException * You attempted to create more than the allowed number of tags. * @throws ValidationException * An exception for missing or invalid input fields. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws ResourceNotFoundException * You attempted to access or delete a resource that does not exist. * @sample AmazonOSIS.TagResource * @see AWS API * Documentation */ @Override public TagResourceResult tagResource(TagResourceRequest request) { request = beforeClientExecution(request); return executeTagResource(request); } @SdkInternalApi final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) { ExecutionContext executionContext = createExecutionContext(tagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Removes one or more tags from an OpenSearch Ingestion pipeline. For more information, see Tagging Amazon * OpenSearch Ingestion pipelines. *
* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws ValidationException * An exception for missing or invalid input fields. * @throws ResourceNotFoundException * You attempted to access or delete a resource that does not exist. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @sample AmazonOSIS.UntagResource * @see AWS API * Documentation */ @Override public UntagResourceResult untagResource(UntagResourceRequest request) { request = beforeClientExecution(request); return executeUntagResource(request); } @SdkInternalApi final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) { ExecutionContext executionContext = createExecutionContext(untagResourceRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Updates an OpenSearch Ingestion pipeline. For more information, see Updating Amazon * OpenSearch Ingestion pipelines. *
* * @param updatePipelineRequest * @return Result of the UpdatePipeline operation returned by the service. * @throws ValidationException * An exception for missing or invalid input fields. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws ResourceNotFoundException * You attempted to access or delete a resource that does not exist. * @throws ConflictException * The client attempted to remove a resource that is currently in use. * @sample AmazonOSIS.UpdatePipeline * @see AWS API * Documentation */ @Override public UpdatePipelineResult updatePipeline(UpdatePipelineRequest request) { request = beforeClientExecution(request); return executeUpdatePipeline(request); } @SdkInternalApi final UpdatePipelineResult executeUpdatePipeline(UpdatePipelineRequest updatePipelineRequest) { ExecutionContext executionContext = createExecutionContext(updatePipelineRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request* Checks whether an OpenSearch Ingestion pipeline configuration is valid prior to creation. For more information, * see Creating * Amazon OpenSearch Ingestion pipelines. *
* * @param validatePipelineRequest * @return Result of the ValidatePipeline operation returned by the service. * @throws AccessDeniedException * You don't have permissions to access the resource. * @throws InternalException * The request failed because of an unknown error, exception, or failure (the failure is internal to the * service). * @throws ValidationException * An exception for missing or invalid input fields. * @sample AmazonOSIS.ValidatePipeline * @see AWS API * Documentation */ @Override public ValidatePipelineResult validatePipeline(ValidatePipelineRequest request) { request = beforeClientExecution(request); return executeValidatePipeline(request); } @SdkInternalApi final ValidatePipelineResult executeValidatePipeline(ValidatePipelineRequest validatePipelineRequest) { ExecutionContext executionContext = createExecutionContext(validatePipelineRequest); AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); awsRequestMetrics.startEvent(Field.ClientExecuteTime); Request
* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
* information for an executed request, you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private