software.amazon.awssdk.services.opensearch.DefaultOpenSearchClient Maven / Gradle / Ivy
Show all versions of opensearch Show documentation
/*
* Copyright 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 software.amazon.awssdk.services.opensearch;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.opensearch.model.AcceptInboundConnectionRequest;
import software.amazon.awssdk.services.opensearch.model.AcceptInboundConnectionResponse;
import software.amazon.awssdk.services.opensearch.model.AccessDeniedException;
import software.amazon.awssdk.services.opensearch.model.AddTagsRequest;
import software.amazon.awssdk.services.opensearch.model.AddTagsResponse;
import software.amazon.awssdk.services.opensearch.model.AssociatePackageRequest;
import software.amazon.awssdk.services.opensearch.model.AssociatePackageResponse;
import software.amazon.awssdk.services.opensearch.model.BaseException;
import software.amazon.awssdk.services.opensearch.model.CancelServiceSoftwareUpdateRequest;
import software.amazon.awssdk.services.opensearch.model.CancelServiceSoftwareUpdateResponse;
import software.amazon.awssdk.services.opensearch.model.ConflictException;
import software.amazon.awssdk.services.opensearch.model.CreateDomainRequest;
import software.amazon.awssdk.services.opensearch.model.CreateDomainResponse;
import software.amazon.awssdk.services.opensearch.model.CreateOutboundConnectionRequest;
import software.amazon.awssdk.services.opensearch.model.CreateOutboundConnectionResponse;
import software.amazon.awssdk.services.opensearch.model.CreatePackageRequest;
import software.amazon.awssdk.services.opensearch.model.CreatePackageResponse;
import software.amazon.awssdk.services.opensearch.model.DeleteDomainRequest;
import software.amazon.awssdk.services.opensearch.model.DeleteDomainResponse;
import software.amazon.awssdk.services.opensearch.model.DeleteInboundConnectionRequest;
import software.amazon.awssdk.services.opensearch.model.DeleteInboundConnectionResponse;
import software.amazon.awssdk.services.opensearch.model.DeleteOutboundConnectionRequest;
import software.amazon.awssdk.services.opensearch.model.DeleteOutboundConnectionResponse;
import software.amazon.awssdk.services.opensearch.model.DeletePackageRequest;
import software.amazon.awssdk.services.opensearch.model.DeletePackageResponse;
import software.amazon.awssdk.services.opensearch.model.DescribeDomainAutoTunesRequest;
import software.amazon.awssdk.services.opensearch.model.DescribeDomainAutoTunesResponse;
import software.amazon.awssdk.services.opensearch.model.DescribeDomainConfigRequest;
import software.amazon.awssdk.services.opensearch.model.DescribeDomainConfigResponse;
import software.amazon.awssdk.services.opensearch.model.DescribeDomainRequest;
import software.amazon.awssdk.services.opensearch.model.DescribeDomainResponse;
import software.amazon.awssdk.services.opensearch.model.DescribeDomainsRequest;
import software.amazon.awssdk.services.opensearch.model.DescribeDomainsResponse;
import software.amazon.awssdk.services.opensearch.model.DescribeInboundConnectionsRequest;
import software.amazon.awssdk.services.opensearch.model.DescribeInboundConnectionsResponse;
import software.amazon.awssdk.services.opensearch.model.DescribeInstanceTypeLimitsRequest;
import software.amazon.awssdk.services.opensearch.model.DescribeInstanceTypeLimitsResponse;
import software.amazon.awssdk.services.opensearch.model.DescribeOutboundConnectionsRequest;
import software.amazon.awssdk.services.opensearch.model.DescribeOutboundConnectionsResponse;
import software.amazon.awssdk.services.opensearch.model.DescribePackagesRequest;
import software.amazon.awssdk.services.opensearch.model.DescribePackagesResponse;
import software.amazon.awssdk.services.opensearch.model.DescribeReservedInstanceOfferingsRequest;
import software.amazon.awssdk.services.opensearch.model.DescribeReservedInstanceOfferingsResponse;
import software.amazon.awssdk.services.opensearch.model.DescribeReservedInstancesRequest;
import software.amazon.awssdk.services.opensearch.model.DescribeReservedInstancesResponse;
import software.amazon.awssdk.services.opensearch.model.DisabledOperationException;
import software.amazon.awssdk.services.opensearch.model.DissociatePackageRequest;
import software.amazon.awssdk.services.opensearch.model.DissociatePackageResponse;
import software.amazon.awssdk.services.opensearch.model.GetCompatibleVersionsRequest;
import software.amazon.awssdk.services.opensearch.model.GetCompatibleVersionsResponse;
import software.amazon.awssdk.services.opensearch.model.GetPackageVersionHistoryRequest;
import software.amazon.awssdk.services.opensearch.model.GetPackageVersionHistoryResponse;
import software.amazon.awssdk.services.opensearch.model.GetUpgradeHistoryRequest;
import software.amazon.awssdk.services.opensearch.model.GetUpgradeHistoryResponse;
import software.amazon.awssdk.services.opensearch.model.GetUpgradeStatusRequest;
import software.amazon.awssdk.services.opensearch.model.GetUpgradeStatusResponse;
import software.amazon.awssdk.services.opensearch.model.InternalException;
import software.amazon.awssdk.services.opensearch.model.InvalidPaginationTokenException;
import software.amazon.awssdk.services.opensearch.model.InvalidTypeException;
import software.amazon.awssdk.services.opensearch.model.LimitExceededException;
import software.amazon.awssdk.services.opensearch.model.ListDomainNamesRequest;
import software.amazon.awssdk.services.opensearch.model.ListDomainNamesResponse;
import software.amazon.awssdk.services.opensearch.model.ListDomainsForPackageRequest;
import software.amazon.awssdk.services.opensearch.model.ListDomainsForPackageResponse;
import software.amazon.awssdk.services.opensearch.model.ListInstanceTypeDetailsRequest;
import software.amazon.awssdk.services.opensearch.model.ListInstanceTypeDetailsResponse;
import software.amazon.awssdk.services.opensearch.model.ListPackagesForDomainRequest;
import software.amazon.awssdk.services.opensearch.model.ListPackagesForDomainResponse;
import software.amazon.awssdk.services.opensearch.model.ListTagsRequest;
import software.amazon.awssdk.services.opensearch.model.ListTagsResponse;
import software.amazon.awssdk.services.opensearch.model.ListVersionsRequest;
import software.amazon.awssdk.services.opensearch.model.ListVersionsResponse;
import software.amazon.awssdk.services.opensearch.model.OpenSearchException;
import software.amazon.awssdk.services.opensearch.model.OpenSearchRequest;
import software.amazon.awssdk.services.opensearch.model.PurchaseReservedInstanceOfferingRequest;
import software.amazon.awssdk.services.opensearch.model.PurchaseReservedInstanceOfferingResponse;
import software.amazon.awssdk.services.opensearch.model.RejectInboundConnectionRequest;
import software.amazon.awssdk.services.opensearch.model.RejectInboundConnectionResponse;
import software.amazon.awssdk.services.opensearch.model.RemoveTagsRequest;
import software.amazon.awssdk.services.opensearch.model.RemoveTagsResponse;
import software.amazon.awssdk.services.opensearch.model.ResourceAlreadyExistsException;
import software.amazon.awssdk.services.opensearch.model.ResourceNotFoundException;
import software.amazon.awssdk.services.opensearch.model.StartServiceSoftwareUpdateRequest;
import software.amazon.awssdk.services.opensearch.model.StartServiceSoftwareUpdateResponse;
import software.amazon.awssdk.services.opensearch.model.UpdateDomainConfigRequest;
import software.amazon.awssdk.services.opensearch.model.UpdateDomainConfigResponse;
import software.amazon.awssdk.services.opensearch.model.UpdatePackageRequest;
import software.amazon.awssdk.services.opensearch.model.UpdatePackageResponse;
import software.amazon.awssdk.services.opensearch.model.UpgradeDomainRequest;
import software.amazon.awssdk.services.opensearch.model.UpgradeDomainResponse;
import software.amazon.awssdk.services.opensearch.model.ValidationException;
import software.amazon.awssdk.services.opensearch.paginators.DescribeDomainAutoTunesIterable;
import software.amazon.awssdk.services.opensearch.paginators.DescribeInboundConnectionsIterable;
import software.amazon.awssdk.services.opensearch.paginators.DescribeOutboundConnectionsIterable;
import software.amazon.awssdk.services.opensearch.paginators.DescribePackagesIterable;
import software.amazon.awssdk.services.opensearch.paginators.DescribeReservedInstanceOfferingsIterable;
import software.amazon.awssdk.services.opensearch.paginators.DescribeReservedInstancesIterable;
import software.amazon.awssdk.services.opensearch.paginators.GetPackageVersionHistoryIterable;
import software.amazon.awssdk.services.opensearch.paginators.GetUpgradeHistoryIterable;
import software.amazon.awssdk.services.opensearch.paginators.ListDomainsForPackageIterable;
import software.amazon.awssdk.services.opensearch.paginators.ListInstanceTypeDetailsIterable;
import software.amazon.awssdk.services.opensearch.paginators.ListPackagesForDomainIterable;
import software.amazon.awssdk.services.opensearch.paginators.ListVersionsIterable;
import software.amazon.awssdk.services.opensearch.transform.AcceptInboundConnectionRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.AddTagsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.AssociatePackageRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.CancelServiceSoftwareUpdateRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.CreateDomainRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.CreateOutboundConnectionRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.CreatePackageRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DeleteDomainRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DeleteInboundConnectionRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DeleteOutboundConnectionRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DeletePackageRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribeDomainAutoTunesRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribeDomainConfigRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribeDomainRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribeDomainsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribeInboundConnectionsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribeInstanceTypeLimitsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribeOutboundConnectionsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribePackagesRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribeReservedInstanceOfferingsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DescribeReservedInstancesRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.DissociatePackageRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.GetCompatibleVersionsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.GetPackageVersionHistoryRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.GetUpgradeHistoryRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.GetUpgradeStatusRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.ListDomainNamesRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.ListDomainsForPackageRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.ListInstanceTypeDetailsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.ListPackagesForDomainRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.ListTagsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.ListVersionsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.PurchaseReservedInstanceOfferingRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.RejectInboundConnectionRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.RemoveTagsRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.StartServiceSoftwareUpdateRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.UpdateDomainConfigRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.UpdatePackageRequestMarshaller;
import software.amazon.awssdk.services.opensearch.transform.UpgradeDomainRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link OpenSearchClient}.
*
* @see OpenSearchClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultOpenSearchClient implements OpenSearchClient {
private static final Logger log = Logger.loggerFor(DefaultOpenSearchClient.class);
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultOpenSearchClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Allows the remote domain owner to accept an inbound cross-cluster connection request.
*
*
* @param acceptInboundConnectionRequest
* Container for the parameters to the AcceptInboundConnection
operation.
* @return Result of the AcceptInboundConnection operation returned by the service.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws LimitExceededException
* An exception for trying to create more than allowed resources or sub-resources. Gives http status code of
* 409.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.AcceptInboundConnection
*/
@Override
public AcceptInboundConnectionResponse acceptInboundConnection(AcceptInboundConnectionRequest acceptInboundConnectionRequest)
throws ResourceNotFoundException, LimitExceededException, DisabledOperationException, AwsServiceException,
SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AcceptInboundConnectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, acceptInboundConnectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AcceptInboundConnection");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AcceptInboundConnection").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(acceptInboundConnectionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AcceptInboundConnectionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Attaches tags to an existing domain. Tags are a set of case-sensitive key value pairs. An domain can have up to
* 10 tags. See Tagging Amazon OpenSearch Service domains for more information.
*
*
* @param addTagsRequest
* Container for the parameters to the AddTags
operation. Specifies the tags to attach
* to the domain.
* @return Result of the AddTags operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws LimitExceededException
* An exception for trying to create more than allowed resources or sub-resources. Gives http status code of
* 409.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.AddTags
*/
@Override
public AddTagsResponse addTags(AddTagsRequest addTagsRequest) throws BaseException, LimitExceededException,
ValidationException, InternalException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AddTagsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, addTagsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddTags");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AddTags").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(addTagsRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new AddTagsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Associates a package with an Amazon OpenSearch Service domain.
*
*
* @param associatePackageRequest
* Container for the request parameters to the AssociatePackage
operation.
* @return Result of the AssociatePackage operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws ConflictException
* An error occurred because the client attempts to remove a resource that is currently in use. Returns HTTP
* status code 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.AssociatePackage
*/
@Override
public AssociatePackageResponse associatePackage(AssociatePackageRequest associatePackageRequest) throws BaseException,
InternalException, ResourceNotFoundException, AccessDeniedException, ValidationException, ConflictException,
AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AssociatePackageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, associatePackageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociatePackage");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AssociatePackage").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(associatePackageRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AssociatePackageRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Cancels a scheduled service software update for an Amazon OpenSearch Service domain. You can only perform this
* operation before the AutomatedUpdateDate
and when the UpdateStatus
is in the
* PENDING_UPDATE
state.
*
*
* @param cancelServiceSoftwareUpdateRequest
* Container for the parameters to the CancelServiceSoftwareUpdate
operation. Specifies
* the name of the domain that you wish to cancel a service software update on.
* @return Result of the CancelServiceSoftwareUpdate operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.CancelServiceSoftwareUpdate
*/
@Override
public CancelServiceSoftwareUpdateResponse cancelServiceSoftwareUpdate(
CancelServiceSoftwareUpdateRequest cancelServiceSoftwareUpdateRequest) throws BaseException, InternalException,
ResourceNotFoundException, ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CancelServiceSoftwareUpdateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelServiceSoftwareUpdateRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelServiceSoftwareUpdate");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CancelServiceSoftwareUpdate").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(cancelServiceSoftwareUpdateRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CancelServiceSoftwareUpdateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a new Amazon OpenSearch Service domain. For more information, see Creating and managing Amazon OpenSearch Service domains in the Amazon OpenSearch Service
* Developer Guide.
*
*
* @param createDomainRequest
* @return Result of the CreateDomain operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws InvalidTypeException
* An exception for trying to create or access sub-resource that is either invalid or not supported. Gives
* http status code of 409.
* @throws LimitExceededException
* An exception for trying to create more than allowed resources or sub-resources. Gives http status code of
* 409.
* @throws ResourceAlreadyExistsException
* An exception for creating a resource that already exists. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.CreateDomain
*/
@Override
public CreateDomainResponse createDomain(CreateDomainRequest createDomainRequest) throws BaseException,
DisabledOperationException, InternalException, InvalidTypeException, LimitExceededException,
ResourceAlreadyExistsException, ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateDomainResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createDomainRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDomain");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateDomain").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createDomainRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDomainRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a new cross-cluster connection from a local OpenSearch domain to a remote OpenSearch domain.
*
*
* @param createOutboundConnectionRequest
* Container for the parameters to the CreateOutboundConnection
operation.
* @return Result of the CreateOutboundConnection operation returned by the service.
* @throws LimitExceededException
* An exception for trying to create more than allowed resources or sub-resources. Gives http status code of
* 409.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceAlreadyExistsException
* An exception for creating a resource that already exists. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.CreateOutboundConnection
*/
@Override
public CreateOutboundConnectionResponse createOutboundConnection(
CreateOutboundConnectionRequest createOutboundConnectionRequest) throws LimitExceededException, InternalException,
ResourceAlreadyExistsException, DisabledOperationException, AwsServiceException, SdkClientException,
OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateOutboundConnectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createOutboundConnectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateOutboundConnection");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateOutboundConnection").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createOutboundConnectionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateOutboundConnectionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Create a package for use with Amazon OpenSearch Service domains.
*
*
* @param createPackageRequest
* Container for request parameters to the CreatePackage
operation.
* @return Result of the CreatePackage operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws LimitExceededException
* An exception for trying to create more than allowed resources or sub-resources. Gives http status code of
* 409.
* @throws InvalidTypeException
* An exception for trying to create or access sub-resource that is either invalid or not supported. Gives
* http status code of 409.
* @throws ResourceAlreadyExistsException
* An exception for creating a resource that already exists. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.CreatePackage
*/
@Override
public CreatePackageResponse createPackage(CreatePackageRequest createPackageRequest) throws BaseException,
InternalException, LimitExceededException, InvalidTypeException, ResourceAlreadyExistsException,
AccessDeniedException, ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreatePackageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createPackageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreatePackage");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreatePackage").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createPackageRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreatePackageRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Permanently deletes the specified domain and all of its data. Once a domain is deleted, it cannot be recovered.
*
*
* @param deleteDomainRequest
* Container for the parameters to the DeleteDomain
operation. Specifies the name of
* the domain you want to delete.
* @return Result of the DeleteDomain operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DeleteDomain
*/
@Override
public DeleteDomainResponse deleteDomain(DeleteDomainRequest deleteDomainRequest) throws BaseException, InternalException,
ResourceNotFoundException, ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteDomainResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDomainRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDomain");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteDomain").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteDomainRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteDomainRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Allows the remote domain owner to delete an existing inbound cross-cluster connection.
*
*
* @param deleteInboundConnectionRequest
* Container for the parameters to the DeleteInboundConnection
operation.
* @return Result of the DeleteInboundConnection operation returned by the service.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DeleteInboundConnection
*/
@Override
public DeleteInboundConnectionResponse deleteInboundConnection(DeleteInboundConnectionRequest deleteInboundConnectionRequest)
throws ResourceNotFoundException, DisabledOperationException, AwsServiceException, SdkClientException,
OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteInboundConnectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteInboundConnectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteInboundConnection");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteInboundConnection").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteInboundConnectionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteInboundConnectionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Allows the local domain owner to delete an existing outbound cross-cluster connection.
*
*
* @param deleteOutboundConnectionRequest
* Container for the parameters to the DeleteOutboundConnection
operation.
* @return Result of the DeleteOutboundConnection operation returned by the service.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DeleteOutboundConnection
*/
@Override
public DeleteOutboundConnectionResponse deleteOutboundConnection(
DeleteOutboundConnectionRequest deleteOutboundConnectionRequest) throws ResourceNotFoundException,
DisabledOperationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteOutboundConnectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteOutboundConnectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteOutboundConnection");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteOutboundConnection").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteOutboundConnectionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteOutboundConnectionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the package.
*
*
* @param deletePackageRequest
* Container for the request parameters to the DeletePackage
operation.
* @return Result of the DeletePackage operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws ConflictException
* An error occurred because the client attempts to remove a resource that is currently in use. Returns HTTP
* status code 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DeletePackage
*/
@Override
public DeletePackageResponse deletePackage(DeletePackageRequest deletePackageRequest) throws BaseException,
InternalException, ResourceNotFoundException, AccessDeniedException, ValidationException, ConflictException,
AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeletePackageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePackageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePackage");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeletePackage").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deletePackageRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeletePackageRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns domain configuration information about the specified domain, including the domain ID, domain endpoint,
* and domain ARN.
*
*
* @param describeDomainRequest
* Container for the parameters to the DescribeDomain
operation.
* @return Result of the DescribeDomain operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeDomain
*/
@Override
public DescribeDomainResponse describeDomain(DescribeDomainRequest describeDomainRequest) throws BaseException,
InternalException, ResourceNotFoundException, ValidationException, AwsServiceException, SdkClientException,
OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeDomainResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDomainRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDomain");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeDomain").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeDomainRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDomainRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Provides scheduled Auto-Tune action details for the domain, such as Auto-Tune action type, description, severity,
* and scheduled date.
*
*
* @param describeDomainAutoTunesRequest
* Container for the parameters to the DescribeDomainAutoTunes
operation.
* @return Result of the DescribeDomainAutoTunes operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeDomainAutoTunes
*/
@Override
public DescribeDomainAutoTunesResponse describeDomainAutoTunes(DescribeDomainAutoTunesRequest describeDomainAutoTunesRequest)
throws BaseException, InternalException, ResourceNotFoundException, ValidationException, AwsServiceException,
SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeDomainAutoTunesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDomainAutoTunesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDomainAutoTunes");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeDomainAutoTunes").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeDomainAutoTunesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDomainAutoTunesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Provides scheduled Auto-Tune action details for the domain, such as Auto-Tune action type, description, severity,
* and scheduled date.
*
*
*
* This is a variant of
* {@link #describeDomainAutoTunes(software.amazon.awssdk.services.opensearch.model.DescribeDomainAutoTunesRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeDomainAutoTunesIterable responses = client.describeDomainAutoTunesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.DescribeDomainAutoTunesIterable responses = client
* .describeDomainAutoTunesPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.DescribeDomainAutoTunesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeDomainAutoTunesIterable responses = client.describeDomainAutoTunesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeDomainAutoTunes(software.amazon.awssdk.services.opensearch.model.DescribeDomainAutoTunesRequest)}
* operation.
*
*
* @param describeDomainAutoTunesRequest
* Container for the parameters to the DescribeDomainAutoTunes
operation.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeDomainAutoTunes
*/
@Override
public DescribeDomainAutoTunesIterable describeDomainAutoTunesPaginator(
DescribeDomainAutoTunesRequest describeDomainAutoTunesRequest) throws BaseException, InternalException,
ResourceNotFoundException, ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
return new DescribeDomainAutoTunesIterable(this, applyPaginatorUserAgent(describeDomainAutoTunesRequest));
}
/**
*
* Provides cluster configuration information about the specified domain, such as the state, creation date, update
* version, and update date for cluster options.
*
*
* @param describeDomainConfigRequest
* Container for the parameters to the DescribeDomainConfig
operation. Specifies the domain name
* for which you want configuration information.
* @return Result of the DescribeDomainConfig operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeDomainConfig
*/
@Override
public DescribeDomainConfigResponse describeDomainConfig(DescribeDomainConfigRequest describeDomainConfigRequest)
throws BaseException, InternalException, ResourceNotFoundException, ValidationException, AwsServiceException,
SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeDomainConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDomainConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDomainConfig");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeDomainConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeDomainConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDomainConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns domain configuration information about the specified domains, including the domain ID, domain endpoint,
* and domain ARN.
*
*
* @param describeDomainsRequest
* Container for the parameters to the DescribeDomains
operation. By default, the API
* returns the status of all domains.
* @return Result of the DescribeDomains operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeDomains
*/
@Override
public DescribeDomainsResponse describeDomains(DescribeDomainsRequest describeDomainsRequest) throws BaseException,
InternalException, ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeDomainsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDomainsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDomains");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeDomains").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeDomainsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDomainsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all the inbound cross-cluster connections for a remote domain.
*
*
* @param describeInboundConnectionsRequest
* Container for the parameters to the DescribeInboundConnections
operation.
* @return Result of the DescribeInboundConnections operation returned by the service.
* @throws InvalidPaginationTokenException
* The request processing has failed because of invalid pagination token provided by customer. Returns an
* HTTP status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeInboundConnections
*/
@Override
public DescribeInboundConnectionsResponse describeInboundConnections(
DescribeInboundConnectionsRequest describeInboundConnectionsRequest) throws InvalidPaginationTokenException,
DisabledOperationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeInboundConnectionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeInboundConnectionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeInboundConnections");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeInboundConnections").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeInboundConnectionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeInboundConnectionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all the inbound cross-cluster connections for a remote domain.
*
*
*
* This is a variant of
* {@link #describeInboundConnections(software.amazon.awssdk.services.opensearch.model.DescribeInboundConnectionsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeInboundConnectionsIterable responses = client.describeInboundConnectionsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.DescribeInboundConnectionsIterable responses = client
* .describeInboundConnectionsPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.DescribeInboundConnectionsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeInboundConnectionsIterable responses = client.describeInboundConnectionsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeInboundConnections(software.amazon.awssdk.services.opensearch.model.DescribeInboundConnectionsRequest)}
* operation.
*
*
* @param describeInboundConnectionsRequest
* Container for the parameters to the DescribeInboundConnections
operation.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws InvalidPaginationTokenException
* The request processing has failed because of invalid pagination token provided by customer. Returns an
* HTTP status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeInboundConnections
*/
@Override
public DescribeInboundConnectionsIterable describeInboundConnectionsPaginator(
DescribeInboundConnectionsRequest describeInboundConnectionsRequest) throws InvalidPaginationTokenException,
DisabledOperationException, AwsServiceException, SdkClientException, OpenSearchException {
return new DescribeInboundConnectionsIterable(this, applyPaginatorUserAgent(describeInboundConnectionsRequest));
}
/**
*
* Describe the limits for a given instance type and OpenSearch or Elasticsearch version. When modifying an existing
* domain, specify the DomainName
to see which limits you can modify.
*
*
* @param describeInstanceTypeLimitsRequest
* Container for the parameters to the DescribeInstanceTypeLimits
operation.
* @return Result of the DescribeInstanceTypeLimits operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws InvalidTypeException
* An exception for trying to create or access sub-resource that is either invalid or not supported. Gives
* http status code of 409.
* @throws LimitExceededException
* An exception for trying to create more than allowed resources or sub-resources. Gives http status code of
* 409.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeInstanceTypeLimits
*/
@Override
public DescribeInstanceTypeLimitsResponse describeInstanceTypeLimits(
DescribeInstanceTypeLimitsRequest describeInstanceTypeLimitsRequest) throws BaseException, InternalException,
InvalidTypeException, LimitExceededException, ResourceNotFoundException, ValidationException, AwsServiceException,
SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeInstanceTypeLimitsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeInstanceTypeLimitsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeInstanceTypeLimits");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeInstanceTypeLimits").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeInstanceTypeLimitsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeInstanceTypeLimitsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all the outbound cross-cluster connections for a local domain.
*
*
* @param describeOutboundConnectionsRequest
* Container for the parameters to the DescribeOutboundConnections
operation.
* @return Result of the DescribeOutboundConnections operation returned by the service.
* @throws InvalidPaginationTokenException
* The request processing has failed because of invalid pagination token provided by customer. Returns an
* HTTP status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeOutboundConnections
*/
@Override
public DescribeOutboundConnectionsResponse describeOutboundConnections(
DescribeOutboundConnectionsRequest describeOutboundConnectionsRequest) throws InvalidPaginationTokenException,
DisabledOperationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeOutboundConnectionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeOutboundConnectionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeOutboundConnections");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeOutboundConnections").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeOutboundConnectionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeOutboundConnectionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all the outbound cross-cluster connections for a local domain.
*
*
*
* This is a variant of
* {@link #describeOutboundConnections(software.amazon.awssdk.services.opensearch.model.DescribeOutboundConnectionsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeOutboundConnectionsIterable responses = client.describeOutboundConnectionsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.DescribeOutboundConnectionsIterable responses = client
* .describeOutboundConnectionsPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.DescribeOutboundConnectionsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeOutboundConnectionsIterable responses = client.describeOutboundConnectionsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeOutboundConnections(software.amazon.awssdk.services.opensearch.model.DescribeOutboundConnectionsRequest)}
* operation.
*
*
* @param describeOutboundConnectionsRequest
* Container for the parameters to the DescribeOutboundConnections
operation.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws InvalidPaginationTokenException
* The request processing has failed because of invalid pagination token provided by customer. Returns an
* HTTP status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeOutboundConnections
*/
@Override
public DescribeOutboundConnectionsIterable describeOutboundConnectionsPaginator(
DescribeOutboundConnectionsRequest describeOutboundConnectionsRequest) throws InvalidPaginationTokenException,
DisabledOperationException, AwsServiceException, SdkClientException, OpenSearchException {
return new DescribeOutboundConnectionsIterable(this, applyPaginatorUserAgent(describeOutboundConnectionsRequest));
}
/**
*
* Describes all packages available to Amazon OpenSearch Service domains. Includes options for filtering, limiting
* the number of results, and pagination.
*
*
* @param describePackagesRequest
* Container for the request parameters to the DescribePackage
operation.
* @return Result of the DescribePackages operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribePackages
*/
@Override
public DescribePackagesResponse describePackages(DescribePackagesRequest describePackagesRequest) throws BaseException,
InternalException, ResourceNotFoundException, AccessDeniedException, ValidationException, AwsServiceException,
SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribePackagesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describePackagesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribePackages");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribePackages").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describePackagesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribePackagesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes all packages available to Amazon OpenSearch Service domains. Includes options for filtering, limiting
* the number of results, and pagination.
*
*
*
* This is a variant of
* {@link #describePackages(software.amazon.awssdk.services.opensearch.model.DescribePackagesRequest)} operation.
* The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally
* handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribePackagesIterable responses = client.describePackagesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.DescribePackagesIterable responses = client
* .describePackagesPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.DescribePackagesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribePackagesIterable responses = client.describePackagesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describePackages(software.amazon.awssdk.services.opensearch.model.DescribePackagesRequest)}
* operation.
*
*
* @param describePackagesRequest
* Container for the request parameters to the DescribePackage
operation.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribePackages
*/
@Override
public DescribePackagesIterable describePackagesPaginator(DescribePackagesRequest describePackagesRequest)
throws BaseException, InternalException, ResourceNotFoundException, AccessDeniedException, ValidationException,
AwsServiceException, SdkClientException, OpenSearchException {
return new DescribePackagesIterable(this, applyPaginatorUserAgent(describePackagesRequest));
}
/**
*
* Lists available reserved OpenSearch instance offerings.
*
*
* @param describeReservedInstanceOfferingsRequest
* Container for parameters to DescribeReservedInstanceOfferings
* @return Result of the DescribeReservedInstanceOfferings operation returned by the service.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeReservedInstanceOfferings
*/
@Override
public DescribeReservedInstanceOfferingsResponse describeReservedInstanceOfferings(
DescribeReservedInstanceOfferingsRequest describeReservedInstanceOfferingsRequest) throws ResourceNotFoundException,
ValidationException, DisabledOperationException, InternalException, AwsServiceException, SdkClientException,
OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeReservedInstanceOfferingsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeReservedInstanceOfferingsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeReservedInstanceOfferings");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeReservedInstanceOfferings").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeReservedInstanceOfferingsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeReservedInstanceOfferingsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists available reserved OpenSearch instance offerings.
*
*
*
* This is a variant of
* {@link #describeReservedInstanceOfferings(software.amazon.awssdk.services.opensearch.model.DescribeReservedInstanceOfferingsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeReservedInstanceOfferingsIterable responses = client.describeReservedInstanceOfferingsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.DescribeReservedInstanceOfferingsIterable responses = client
* .describeReservedInstanceOfferingsPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.DescribeReservedInstanceOfferingsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeReservedInstanceOfferingsIterable responses = client.describeReservedInstanceOfferingsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeReservedInstanceOfferings(software.amazon.awssdk.services.opensearch.model.DescribeReservedInstanceOfferingsRequest)}
* operation.
*
*
* @param describeReservedInstanceOfferingsRequest
* Container for parameters to DescribeReservedInstanceOfferings
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeReservedInstanceOfferings
*/
@Override
public DescribeReservedInstanceOfferingsIterable describeReservedInstanceOfferingsPaginator(
DescribeReservedInstanceOfferingsRequest describeReservedInstanceOfferingsRequest) throws ResourceNotFoundException,
ValidationException, DisabledOperationException, InternalException, AwsServiceException, SdkClientException,
OpenSearchException {
return new DescribeReservedInstanceOfferingsIterable(this,
applyPaginatorUserAgent(describeReservedInstanceOfferingsRequest));
}
/**
*
* Returns information about reserved OpenSearch instances for this account.
*
*
* @param describeReservedInstancesRequest
* Container for parameters to DescribeReservedInstances
* @return Result of the DescribeReservedInstances operation returned by the service.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeReservedInstances
*/
@Override
public DescribeReservedInstancesResponse describeReservedInstances(
DescribeReservedInstancesRequest describeReservedInstancesRequest) throws ResourceNotFoundException,
InternalException, ValidationException, DisabledOperationException, AwsServiceException, SdkClientException,
OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeReservedInstancesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeReservedInstancesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeReservedInstances");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeReservedInstances").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeReservedInstancesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeReservedInstancesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns information about reserved OpenSearch instances for this account.
*
*
*
* This is a variant of
* {@link #describeReservedInstances(software.amazon.awssdk.services.opensearch.model.DescribeReservedInstancesRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeReservedInstancesIterable responses = client.describeReservedInstancesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.DescribeReservedInstancesIterable responses = client
* .describeReservedInstancesPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.DescribeReservedInstancesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.DescribeReservedInstancesIterable responses = client.describeReservedInstancesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeReservedInstances(software.amazon.awssdk.services.opensearch.model.DescribeReservedInstancesRequest)}
* operation.
*
*
* @param describeReservedInstancesRequest
* Container for parameters to DescribeReservedInstances
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DescribeReservedInstances
*/
@Override
public DescribeReservedInstancesIterable describeReservedInstancesPaginator(
DescribeReservedInstancesRequest describeReservedInstancesRequest) throws ResourceNotFoundException,
InternalException, ValidationException, DisabledOperationException, AwsServiceException, SdkClientException,
OpenSearchException {
return new DescribeReservedInstancesIterable(this, applyPaginatorUserAgent(describeReservedInstancesRequest));
}
/**
*
* Dissociates a package from the Amazon OpenSearch Service domain.
*
*
* @param dissociatePackageRequest
* Container for the request parameters to the DissociatePackage
operation.
* @return Result of the DissociatePackage operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws ConflictException
* An error occurred because the client attempts to remove a resource that is currently in use. Returns HTTP
* status code 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.DissociatePackage
*/
@Override
public DissociatePackageResponse dissociatePackage(DissociatePackageRequest dissociatePackageRequest) throws BaseException,
InternalException, ResourceNotFoundException, AccessDeniedException, ValidationException, ConflictException,
AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DissociatePackageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, dissociatePackageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DissociatePackage");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DissociatePackage").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(dissociatePackageRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DissociatePackageRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of upgrade-compatible versions of OpenSearch/Elasticsearch. You can optionally pass a
* DomainName
to get all upgrade-compatible versions of OpenSearch/Elasticsearch for that
* specific domain.
*
*
* @param getCompatibleVersionsRequest
* Container for the request parameters to GetCompatibleVersions
operation.
* @return Result of the GetCompatibleVersions operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.GetCompatibleVersions
*/
@Override
public GetCompatibleVersionsResponse getCompatibleVersions(GetCompatibleVersionsRequest getCompatibleVersionsRequest)
throws BaseException, ResourceNotFoundException, DisabledOperationException, ValidationException, InternalException,
AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetCompatibleVersionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getCompatibleVersionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCompatibleVersions");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetCompatibleVersions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getCompatibleVersionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetCompatibleVersionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of package versions, along with their creation time and commit message.
*
*
* @param getPackageVersionHistoryRequest
* Container for the request parameters to the GetPackageVersionHistory
operation.
* @return Result of the GetPackageVersionHistory operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.GetPackageVersionHistory
*/
@Override
public GetPackageVersionHistoryResponse getPackageVersionHistory(
GetPackageVersionHistoryRequest getPackageVersionHistoryRequest) throws BaseException, InternalException,
ResourceNotFoundException, AccessDeniedException, ValidationException, AwsServiceException, SdkClientException,
OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetPackageVersionHistoryResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getPackageVersionHistoryRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPackageVersionHistory");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetPackageVersionHistory").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getPackageVersionHistoryRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetPackageVersionHistoryRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of package versions, along with their creation time and commit message.
*
*
*
* This is a variant of
* {@link #getPackageVersionHistory(software.amazon.awssdk.services.opensearch.model.GetPackageVersionHistoryRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.GetPackageVersionHistoryIterable responses = client.getPackageVersionHistoryPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.GetPackageVersionHistoryIterable responses = client
* .getPackageVersionHistoryPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.GetPackageVersionHistoryResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.GetPackageVersionHistoryIterable responses = client.getPackageVersionHistoryPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #getPackageVersionHistory(software.amazon.awssdk.services.opensearch.model.GetPackageVersionHistoryRequest)}
* operation.
*
*
* @param getPackageVersionHistoryRequest
* Container for the request parameters to the GetPackageVersionHistory
operation.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.GetPackageVersionHistory
*/
@Override
public GetPackageVersionHistoryIterable getPackageVersionHistoryPaginator(
GetPackageVersionHistoryRequest getPackageVersionHistoryRequest) throws BaseException, InternalException,
ResourceNotFoundException, AccessDeniedException, ValidationException, AwsServiceException, SdkClientException,
OpenSearchException {
return new GetPackageVersionHistoryIterable(this, applyPaginatorUserAgent(getPackageVersionHistoryRequest));
}
/**
*
* Retrieves the complete history of the last 10 upgrades performed on the domain.
*
*
* @param getUpgradeHistoryRequest
* Container for the request parameters to the GetUpgradeHistory
operation.
* @return Result of the GetUpgradeHistory operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.GetUpgradeHistory
*/
@Override
public GetUpgradeHistoryResponse getUpgradeHistory(GetUpgradeHistoryRequest getUpgradeHistoryRequest) throws BaseException,
ResourceNotFoundException, DisabledOperationException, ValidationException, InternalException, AwsServiceException,
SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetUpgradeHistoryResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getUpgradeHistoryRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUpgradeHistory");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetUpgradeHistory").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getUpgradeHistoryRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetUpgradeHistoryRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the complete history of the last 10 upgrades performed on the domain.
*
*
*
* This is a variant of
* {@link #getUpgradeHistory(software.amazon.awssdk.services.opensearch.model.GetUpgradeHistoryRequest)} operation.
* The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally
* handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.GetUpgradeHistoryIterable responses = client.getUpgradeHistoryPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.GetUpgradeHistoryIterable responses = client
* .getUpgradeHistoryPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.GetUpgradeHistoryResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.GetUpgradeHistoryIterable responses = client.getUpgradeHistoryPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #getUpgradeHistory(software.amazon.awssdk.services.opensearch.model.GetUpgradeHistoryRequest)}
* operation.
*
*
* @param getUpgradeHistoryRequest
* Container for the request parameters to the GetUpgradeHistory
operation.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws BaseException
* An error occurred while processing the request.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.GetUpgradeHistory
*/
@Override
public GetUpgradeHistoryIterable getUpgradeHistoryPaginator(GetUpgradeHistoryRequest getUpgradeHistoryRequest)
throws BaseException, ResourceNotFoundException, DisabledOperationException, ValidationException, InternalException,
AwsServiceException, SdkClientException, OpenSearchException {
return new GetUpgradeHistoryIterable(this, applyPaginatorUserAgent(getUpgradeHistoryRequest));
}
/**
*
* Retrieves the latest status of the last upgrade or upgrade eligibility check performed on the domain.
*
*
* @param getUpgradeStatusRequest
* Container for the request parameters to the GetUpgradeStatus
operation.
* @return Result of the GetUpgradeStatus operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.GetUpgradeStatus
*/
@Override
public GetUpgradeStatusResponse getUpgradeStatus(GetUpgradeStatusRequest getUpgradeStatusRequest) throws BaseException,
ResourceNotFoundException, DisabledOperationException, ValidationException, InternalException, AwsServiceException,
SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetUpgradeStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getUpgradeStatusRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUpgradeStatus");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetUpgradeStatus").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getUpgradeStatusRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetUpgradeStatusRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns the names of all domains owned by the current user's account.
*
*
* @param listDomainNamesRequest
* Container for the parameters to the ListDomainNames
operation.
* @return Result of the ListDomainNames operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListDomainNames
*/
@Override
public ListDomainNamesResponse listDomainNames(ListDomainNamesRequest listDomainNamesRequest) throws BaseException,
ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListDomainNamesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDomainNamesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDomainNames");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListDomainNames").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listDomainNamesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDomainNamesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all Amazon OpenSearch Service domains associated with the package.
*
*
* @param listDomainsForPackageRequest
* Container for the request parameters to the ListDomainsForPackage
operation.
* @return Result of the ListDomainsForPackage operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListDomainsForPackage
*/
@Override
public ListDomainsForPackageResponse listDomainsForPackage(ListDomainsForPackageRequest listDomainsForPackageRequest)
throws BaseException, InternalException, ResourceNotFoundException, AccessDeniedException, ValidationException,
AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListDomainsForPackageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listDomainsForPackageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListDomainsForPackage");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListDomainsForPackage").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listDomainsForPackageRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListDomainsForPackageRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all Amazon OpenSearch Service domains associated with the package.
*
*
*
* This is a variant of
* {@link #listDomainsForPackage(software.amazon.awssdk.services.opensearch.model.ListDomainsForPackageRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.ListDomainsForPackageIterable responses = client.listDomainsForPackagePaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.ListDomainsForPackageIterable responses = client
* .listDomainsForPackagePaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.ListDomainsForPackageResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.ListDomainsForPackageIterable responses = client.listDomainsForPackagePaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listDomainsForPackage(software.amazon.awssdk.services.opensearch.model.ListDomainsForPackageRequest)}
* operation.
*
*
* @param listDomainsForPackageRequest
* Container for the request parameters to the ListDomainsForPackage
operation.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListDomainsForPackage
*/
@Override
public ListDomainsForPackageIterable listDomainsForPackagePaginator(ListDomainsForPackageRequest listDomainsForPackageRequest)
throws BaseException, InternalException, ResourceNotFoundException, AccessDeniedException, ValidationException,
AwsServiceException, SdkClientException, OpenSearchException {
return new ListDomainsForPackageIterable(this, applyPaginatorUserAgent(listDomainsForPackageRequest));
}
/**
* Invokes the ListInstanceTypeDetails operation.
*
* @param listInstanceTypeDetailsRequest
* @return Result of the ListInstanceTypeDetails operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListInstanceTypeDetails
*/
@Override
public ListInstanceTypeDetailsResponse listInstanceTypeDetails(ListInstanceTypeDetailsRequest listInstanceTypeDetailsRequest)
throws BaseException, InternalException, ResourceNotFoundException, ValidationException, AwsServiceException,
SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListInstanceTypeDetailsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listInstanceTypeDetailsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListInstanceTypeDetails");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListInstanceTypeDetails").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listInstanceTypeDetailsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListInstanceTypeDetailsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
* Invokes the ListInstanceTypeDetails operation.
*
* This is a variant of
* {@link #listInstanceTypeDetails(software.amazon.awssdk.services.opensearch.model.ListInstanceTypeDetailsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.ListInstanceTypeDetailsIterable responses = client.listInstanceTypeDetailsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.ListInstanceTypeDetailsIterable responses = client
* .listInstanceTypeDetailsPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.ListInstanceTypeDetailsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.ListInstanceTypeDetailsIterable responses = client.listInstanceTypeDetailsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listInstanceTypeDetails(software.amazon.awssdk.services.opensearch.model.ListInstanceTypeDetailsRequest)}
* operation.
*
*
* @param listInstanceTypeDetailsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListInstanceTypeDetails
*/
@Override
public ListInstanceTypeDetailsIterable listInstanceTypeDetailsPaginator(
ListInstanceTypeDetailsRequest listInstanceTypeDetailsRequest) throws BaseException, InternalException,
ResourceNotFoundException, ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
return new ListInstanceTypeDetailsIterable(this, applyPaginatorUserAgent(listInstanceTypeDetailsRequest));
}
/**
*
* Lists all packages associated with the Amazon OpenSearch Service domain.
*
*
* @param listPackagesForDomainRequest
* Container for the request parameters to the ListPackagesForDomain
operation.
* @return Result of the ListPackagesForDomain operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListPackagesForDomain
*/
@Override
public ListPackagesForDomainResponse listPackagesForDomain(ListPackagesForDomainRequest listPackagesForDomainRequest)
throws BaseException, InternalException, ResourceNotFoundException, AccessDeniedException, ValidationException,
AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListPackagesForDomainResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listPackagesForDomainRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListPackagesForDomain");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListPackagesForDomain").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listPackagesForDomainRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListPackagesForDomainRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all packages associated with the Amazon OpenSearch Service domain.
*
*
*
* This is a variant of
* {@link #listPackagesForDomain(software.amazon.awssdk.services.opensearch.model.ListPackagesForDomainRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.ListPackagesForDomainIterable responses = client.listPackagesForDomainPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.ListPackagesForDomainIterable responses = client
* .listPackagesForDomainPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.ListPackagesForDomainResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.ListPackagesForDomainIterable responses = client.listPackagesForDomainPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listPackagesForDomain(software.amazon.awssdk.services.opensearch.model.ListPackagesForDomainRequest)}
* operation.
*
*
* @param listPackagesForDomainRequest
* Container for the request parameters to the ListPackagesForDomain
operation.
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListPackagesForDomain
*/
@Override
public ListPackagesForDomainIterable listPackagesForDomainPaginator(ListPackagesForDomainRequest listPackagesForDomainRequest)
throws BaseException, InternalException, ResourceNotFoundException, AccessDeniedException, ValidationException,
AwsServiceException, SdkClientException, OpenSearchException {
return new ListPackagesForDomainIterable(this, applyPaginatorUserAgent(listPackagesForDomainRequest));
}
/**
*
* Returns all tags for the given domain.
*
*
* @param listTagsRequest
* Container for the parameters to the ListTags
operation. Specify the ARN
* of the domain that the tags you want to view are attached to.
* @return Result of the ListTags operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListTags
*/
@Override
public ListTagsResponse listTags(ListTagsRequest listTagsRequest) throws BaseException, ResourceNotFoundException,
ValidationException, InternalException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListTagsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTags");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTags").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listTagsRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new ListTagsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* List all supported versions of OpenSearch and Elasticsearch.
*
*
* @param listVersionsRequest
* Container for the parameters to the ListVersions
operation.
*
* Use MaxResults
to control the maximum number of results to retrieve in a single
* call.
*
*
* Use NextToken
in response to retrieve more results. If the received response does
* not contain a NextToken, there are no more results to retrieve.
*
* @return Result of the ListVersions operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListVersions
*/
@Override
public ListVersionsResponse listVersions(ListVersionsRequest listVersionsRequest) throws BaseException, InternalException,
ResourceNotFoundException, ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListVersionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listVersionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListVersions");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListVersions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listVersionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListVersionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* List all supported versions of OpenSearch and Elasticsearch.
*
*
*
* This is a variant of {@link #listVersions(software.amazon.awssdk.services.opensearch.model.ListVersionsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.ListVersionsIterable responses = client.listVersionsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.opensearch.paginators.ListVersionsIterable responses = client.listVersionsPaginator(request);
* for (software.amazon.awssdk.services.opensearch.model.ListVersionsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.opensearch.paginators.ListVersionsIterable responses = client.listVersionsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listVersions(software.amazon.awssdk.services.opensearch.model.ListVersionsRequest)} operation.
*
*
* @param listVersionsRequest
* Container for the parameters to the ListVersions
operation.
*
* Use MaxResults
to control the maximum number of results to retrieve in a single
* call.
*
*
* Use NextToken
in response to retrieve more results. If the received response does
* not contain a NextToken, there are no more results to retrieve.
*
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.ListVersions
*/
@Override
public ListVersionsIterable listVersionsPaginator(ListVersionsRequest listVersionsRequest) throws BaseException,
InternalException, ResourceNotFoundException, ValidationException, AwsServiceException, SdkClientException,
OpenSearchException {
return new ListVersionsIterable(this, applyPaginatorUserAgent(listVersionsRequest));
}
/**
*
* Allows you to purchase reserved OpenSearch instances.
*
*
* @param purchaseReservedInstanceOfferingRequest
* Container for parameters to PurchaseReservedInstanceOffering
* @return Result of the PurchaseReservedInstanceOffering operation returned by the service.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ResourceAlreadyExistsException
* An exception for creating a resource that already exists. Gives http status code of 400.
* @throws LimitExceededException
* An exception for trying to create more than allowed resources or sub-resources. Gives http status code of
* 409.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.PurchaseReservedInstanceOffering
*/
@Override
public PurchaseReservedInstanceOfferingResponse purchaseReservedInstanceOffering(
PurchaseReservedInstanceOfferingRequest purchaseReservedInstanceOfferingRequest) throws ResourceNotFoundException,
ResourceAlreadyExistsException, LimitExceededException, DisabledOperationException, ValidationException,
InternalException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PurchaseReservedInstanceOfferingResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
purchaseReservedInstanceOfferingRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PurchaseReservedInstanceOffering");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PurchaseReservedInstanceOffering").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(purchaseReservedInstanceOfferingRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PurchaseReservedInstanceOfferingRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Allows the remote domain owner to reject an inbound cross-cluster connection request.
*
*
* @param rejectInboundConnectionRequest
* Container for the parameters to the RejectInboundConnection
operation.
* @return Result of the RejectInboundConnection operation returned by the service.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.RejectInboundConnection
*/
@Override
public RejectInboundConnectionResponse rejectInboundConnection(RejectInboundConnectionRequest rejectInboundConnectionRequest)
throws ResourceNotFoundException, DisabledOperationException, AwsServiceException, SdkClientException,
OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, RejectInboundConnectionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, rejectInboundConnectionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RejectInboundConnection");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("RejectInboundConnection").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(rejectInboundConnectionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new RejectInboundConnectionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes the specified set of tags from the given domain.
*
*
* @param removeTagsRequest
* Container for the parameters to the RemoveTags
operation. Specify the
* ARN
for the domain from which you want to remove the specified TagKey
.
* @return Result of the RemoveTags operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.RemoveTags
*/
@Override
public RemoveTagsResponse removeTags(RemoveTagsRequest removeTagsRequest) throws BaseException, ValidationException,
InternalException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
RemoveTagsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, removeTagsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RemoveTags");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("RemoveTags")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(removeTagsRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new RemoveTagsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Schedules a service software update for an Amazon OpenSearch Service domain.
*
*
* @param startServiceSoftwareUpdateRequest
* Container for the parameters to the StartServiceSoftwareUpdate
operation. Specifies
* the name of the domain to schedule a service software update for.
* @return Result of the StartServiceSoftwareUpdate operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.StartServiceSoftwareUpdate
*/
@Override
public StartServiceSoftwareUpdateResponse startServiceSoftwareUpdate(
StartServiceSoftwareUpdateRequest startServiceSoftwareUpdateRequest) throws BaseException, InternalException,
ResourceNotFoundException, ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StartServiceSoftwareUpdateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startServiceSoftwareUpdateRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartServiceSoftwareUpdate");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("StartServiceSoftwareUpdate").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(startServiceSoftwareUpdateRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartServiceSoftwareUpdateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Modifies the cluster configuration of the specified domain, such as setting the instance type and the number of
* instances.
*
*
* @param updateDomainConfigRequest
* Container for the parameters to the UpdateDomain
operation. Specifies the type and
* number of instances in the domain cluster.
* @return Result of the UpdateDomainConfig operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws InvalidTypeException
* An exception for trying to create or access sub-resource that is either invalid or not supported. Gives
* http status code of 409.
* @throws LimitExceededException
* An exception for trying to create more than allowed resources or sub-resources. Gives http status code of
* 409.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.UpdateDomainConfig
*/
@Override
public UpdateDomainConfigResponse updateDomainConfig(UpdateDomainConfigRequest updateDomainConfigRequest)
throws BaseException, InternalException, InvalidTypeException, LimitExceededException, ResourceNotFoundException,
ValidationException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateDomainConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDomainConfigRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDomainConfig");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateDomainConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateDomainConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateDomainConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates a package for use with Amazon OpenSearch Service domains.
*
*
* @param updatePackageRequest
* Container for request parameters to the UpdatePackage
operation.
* @return Result of the UpdatePackage operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws LimitExceededException
* An exception for trying to create more than allowed resources or sub-resources. Gives http status code of
* 409.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws AccessDeniedException
* An error occurred because user does not have permissions to access the resource. Returns HTTP status code
* 403.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.UpdatePackage
*/
@Override
public UpdatePackageResponse updatePackage(UpdatePackageRequest updatePackageRequest) throws BaseException,
InternalException, LimitExceededException, ResourceNotFoundException, AccessDeniedException, ValidationException,
AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdatePackageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updatePackageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdatePackage");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdatePackage").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updatePackageRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdatePackageRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Allows you to either upgrade your domain or perform an upgrade eligibility check to a compatible version of
* OpenSearch or Elasticsearch.
*
*
* @param upgradeDomainRequest
* Container for the request parameters to UpgradeDomain
operation.
* @return Result of the UpgradeDomain operation returned by the service.
* @throws BaseException
* An error occurred while processing the request.
* @throws ResourceNotFoundException
* An exception for accessing or deleting a resource that does not exist. Gives http status code of 400.
* @throws ResourceAlreadyExistsException
* An exception for creating a resource that already exists. Gives http status code of 400.
* @throws DisabledOperationException
* An error occured because the client wanted to access a not supported operation. Gives http status code of
* 409.
* @throws ValidationException
* An exception for missing / invalid input fields. Gives http status code of 400.
* @throws InternalException
* The request processing has failed because of an unknown error, exception or failure (the failure is
* internal to the service) . Gives http status code of 500.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws OpenSearchException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample OpenSearchClient.UpgradeDomain
*/
@Override
public UpgradeDomainResponse upgradeDomain(UpgradeDomainRequest upgradeDomainRequest) throws BaseException,
ResourceNotFoundException, ResourceAlreadyExistsException, DisabledOperationException, ValidationException,
InternalException, AwsServiceException, SdkClientException, OpenSearchException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpgradeDomainResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, upgradeDomainRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "OpenSearch");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpgradeDomain");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpgradeDomain").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(upgradeDomainRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpgradeDomainRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
RequestOverrideConfiguration requestOverrideConfiguration) {
List publishers = null;
if (requestOverrideConfiguration != null) {
publishers = requestOverrideConfiguration.metricPublishers();
}
if (publishers == null || publishers.isEmpty()) {
publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS);
}
if (publishers == null) {
publishers = Collections.emptyList();
}
return publishers;
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(OpenSearchException::builder)
.protocol(AwsJsonProtocol.REST_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("DisabledOperationException")
.exceptionBuilderSupplier(DisabledOperationException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("LimitExceededException")
.exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidTypeException")
.exceptionBuilderSupplier(InvalidTypeException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AccessDeniedException")
.exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ConflictException")
.exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ValidationException")
.exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("BaseException").exceptionBuilderSupplier(BaseException::builder)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceAlreadyExistsException")
.exceptionBuilderSupplier(ResourceAlreadyExistsException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InternalException")
.exceptionBuilderSupplier(InternalException::builder).httpStatusCode(500).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidPaginationTokenException")
.exceptionBuilderSupplier(InvalidPaginationTokenException::builder).httpStatusCode(400).build());
}
@Override
public void close() {
clientHandler.close();
}
private T applyPaginatorUserAgent(T request) {
Consumer userAgentApplier = b -> b.addApiName(ApiName.builder()
.version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
}