software.amazon.awssdk.services.vpclattice.DefaultVpcLatticeClient Maven / Gradle / Ivy
Show all versions of vpclattice 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.vpclattice;
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.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
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.retry.RetryMode;
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.retries.api.RetryStrategy;
import software.amazon.awssdk.services.vpclattice.internal.VpcLatticeServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.vpclattice.model.AccessDeniedException;
import software.amazon.awssdk.services.vpclattice.model.BatchUpdateRuleRequest;
import software.amazon.awssdk.services.vpclattice.model.BatchUpdateRuleResponse;
import software.amazon.awssdk.services.vpclattice.model.ConflictException;
import software.amazon.awssdk.services.vpclattice.model.CreateAccessLogSubscriptionRequest;
import software.amazon.awssdk.services.vpclattice.model.CreateAccessLogSubscriptionResponse;
import software.amazon.awssdk.services.vpclattice.model.CreateListenerRequest;
import software.amazon.awssdk.services.vpclattice.model.CreateListenerResponse;
import software.amazon.awssdk.services.vpclattice.model.CreateRuleRequest;
import software.amazon.awssdk.services.vpclattice.model.CreateRuleResponse;
import software.amazon.awssdk.services.vpclattice.model.CreateServiceNetworkRequest;
import software.amazon.awssdk.services.vpclattice.model.CreateServiceNetworkResponse;
import software.amazon.awssdk.services.vpclattice.model.CreateServiceNetworkServiceAssociationRequest;
import software.amazon.awssdk.services.vpclattice.model.CreateServiceNetworkServiceAssociationResponse;
import software.amazon.awssdk.services.vpclattice.model.CreateServiceNetworkVpcAssociationRequest;
import software.amazon.awssdk.services.vpclattice.model.CreateServiceNetworkVpcAssociationResponse;
import software.amazon.awssdk.services.vpclattice.model.CreateServiceRequest;
import software.amazon.awssdk.services.vpclattice.model.CreateServiceResponse;
import software.amazon.awssdk.services.vpclattice.model.CreateTargetGroupRequest;
import software.amazon.awssdk.services.vpclattice.model.CreateTargetGroupResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteAccessLogSubscriptionRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteAccessLogSubscriptionResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteAuthPolicyRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteAuthPolicyResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteListenerRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteListenerResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteResourcePolicyRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteResourcePolicyResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteRuleRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteRuleResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteServiceNetworkRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteServiceNetworkResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteServiceNetworkServiceAssociationRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteServiceNetworkServiceAssociationResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteServiceNetworkVpcAssociationRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteServiceNetworkVpcAssociationResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteServiceRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteServiceResponse;
import software.amazon.awssdk.services.vpclattice.model.DeleteTargetGroupRequest;
import software.amazon.awssdk.services.vpclattice.model.DeleteTargetGroupResponse;
import software.amazon.awssdk.services.vpclattice.model.DeregisterTargetsRequest;
import software.amazon.awssdk.services.vpclattice.model.DeregisterTargetsResponse;
import software.amazon.awssdk.services.vpclattice.model.GetAccessLogSubscriptionRequest;
import software.amazon.awssdk.services.vpclattice.model.GetAccessLogSubscriptionResponse;
import software.amazon.awssdk.services.vpclattice.model.GetAuthPolicyRequest;
import software.amazon.awssdk.services.vpclattice.model.GetAuthPolicyResponse;
import software.amazon.awssdk.services.vpclattice.model.GetListenerRequest;
import software.amazon.awssdk.services.vpclattice.model.GetListenerResponse;
import software.amazon.awssdk.services.vpclattice.model.GetResourcePolicyRequest;
import software.amazon.awssdk.services.vpclattice.model.GetResourcePolicyResponse;
import software.amazon.awssdk.services.vpclattice.model.GetRuleRequest;
import software.amazon.awssdk.services.vpclattice.model.GetRuleResponse;
import software.amazon.awssdk.services.vpclattice.model.GetServiceNetworkRequest;
import software.amazon.awssdk.services.vpclattice.model.GetServiceNetworkResponse;
import software.amazon.awssdk.services.vpclattice.model.GetServiceNetworkServiceAssociationRequest;
import software.amazon.awssdk.services.vpclattice.model.GetServiceNetworkServiceAssociationResponse;
import software.amazon.awssdk.services.vpclattice.model.GetServiceNetworkVpcAssociationRequest;
import software.amazon.awssdk.services.vpclattice.model.GetServiceNetworkVpcAssociationResponse;
import software.amazon.awssdk.services.vpclattice.model.GetServiceRequest;
import software.amazon.awssdk.services.vpclattice.model.GetServiceResponse;
import software.amazon.awssdk.services.vpclattice.model.GetTargetGroupRequest;
import software.amazon.awssdk.services.vpclattice.model.GetTargetGroupResponse;
import software.amazon.awssdk.services.vpclattice.model.InternalServerException;
import software.amazon.awssdk.services.vpclattice.model.ListAccessLogSubscriptionsRequest;
import software.amazon.awssdk.services.vpclattice.model.ListAccessLogSubscriptionsResponse;
import software.amazon.awssdk.services.vpclattice.model.ListListenersRequest;
import software.amazon.awssdk.services.vpclattice.model.ListListenersResponse;
import software.amazon.awssdk.services.vpclattice.model.ListRulesRequest;
import software.amazon.awssdk.services.vpclattice.model.ListRulesResponse;
import software.amazon.awssdk.services.vpclattice.model.ListServiceNetworkServiceAssociationsRequest;
import software.amazon.awssdk.services.vpclattice.model.ListServiceNetworkServiceAssociationsResponse;
import software.amazon.awssdk.services.vpclattice.model.ListServiceNetworkVpcAssociationsRequest;
import software.amazon.awssdk.services.vpclattice.model.ListServiceNetworkVpcAssociationsResponse;
import software.amazon.awssdk.services.vpclattice.model.ListServiceNetworksRequest;
import software.amazon.awssdk.services.vpclattice.model.ListServiceNetworksResponse;
import software.amazon.awssdk.services.vpclattice.model.ListServicesRequest;
import software.amazon.awssdk.services.vpclattice.model.ListServicesResponse;
import software.amazon.awssdk.services.vpclattice.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.vpclattice.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.vpclattice.model.ListTargetGroupsRequest;
import software.amazon.awssdk.services.vpclattice.model.ListTargetGroupsResponse;
import software.amazon.awssdk.services.vpclattice.model.ListTargetsRequest;
import software.amazon.awssdk.services.vpclattice.model.ListTargetsResponse;
import software.amazon.awssdk.services.vpclattice.model.PutAuthPolicyRequest;
import software.amazon.awssdk.services.vpclattice.model.PutAuthPolicyResponse;
import software.amazon.awssdk.services.vpclattice.model.PutResourcePolicyRequest;
import software.amazon.awssdk.services.vpclattice.model.PutResourcePolicyResponse;
import software.amazon.awssdk.services.vpclattice.model.RegisterTargetsRequest;
import software.amazon.awssdk.services.vpclattice.model.RegisterTargetsResponse;
import software.amazon.awssdk.services.vpclattice.model.ResourceNotFoundException;
import software.amazon.awssdk.services.vpclattice.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.vpclattice.model.TagResourceRequest;
import software.amazon.awssdk.services.vpclattice.model.TagResourceResponse;
import software.amazon.awssdk.services.vpclattice.model.ThrottlingException;
import software.amazon.awssdk.services.vpclattice.model.UntagResourceRequest;
import software.amazon.awssdk.services.vpclattice.model.UntagResourceResponse;
import software.amazon.awssdk.services.vpclattice.model.UpdateAccessLogSubscriptionRequest;
import software.amazon.awssdk.services.vpclattice.model.UpdateAccessLogSubscriptionResponse;
import software.amazon.awssdk.services.vpclattice.model.UpdateListenerRequest;
import software.amazon.awssdk.services.vpclattice.model.UpdateListenerResponse;
import software.amazon.awssdk.services.vpclattice.model.UpdateRuleRequest;
import software.amazon.awssdk.services.vpclattice.model.UpdateRuleResponse;
import software.amazon.awssdk.services.vpclattice.model.UpdateServiceNetworkRequest;
import software.amazon.awssdk.services.vpclattice.model.UpdateServiceNetworkResponse;
import software.amazon.awssdk.services.vpclattice.model.UpdateServiceNetworkVpcAssociationRequest;
import software.amazon.awssdk.services.vpclattice.model.UpdateServiceNetworkVpcAssociationResponse;
import software.amazon.awssdk.services.vpclattice.model.UpdateServiceRequest;
import software.amazon.awssdk.services.vpclattice.model.UpdateServiceResponse;
import software.amazon.awssdk.services.vpclattice.model.UpdateTargetGroupRequest;
import software.amazon.awssdk.services.vpclattice.model.UpdateTargetGroupResponse;
import software.amazon.awssdk.services.vpclattice.model.ValidationException;
import software.amazon.awssdk.services.vpclattice.model.VpcLatticeException;
import software.amazon.awssdk.services.vpclattice.transform.BatchUpdateRuleRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.CreateAccessLogSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.CreateListenerRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.CreateRuleRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.CreateServiceNetworkRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.CreateServiceNetworkServiceAssociationRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.CreateServiceNetworkVpcAssociationRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.CreateServiceRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.CreateTargetGroupRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteAccessLogSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteAuthPolicyRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteListenerRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteRuleRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteServiceNetworkRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteServiceNetworkServiceAssociationRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteServiceNetworkVpcAssociationRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteServiceRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeleteTargetGroupRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.DeregisterTargetsRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetAccessLogSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetAuthPolicyRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetListenerRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetRuleRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetServiceNetworkRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetServiceNetworkServiceAssociationRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetServiceNetworkVpcAssociationRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetServiceRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.GetTargetGroupRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListAccessLogSubscriptionsRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListListenersRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListRulesRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListServiceNetworkServiceAssociationsRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListServiceNetworkVpcAssociationsRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListServiceNetworksRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListServicesRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListTargetGroupsRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.ListTargetsRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.PutAuthPolicyRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.PutResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.RegisterTargetsRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.UpdateAccessLogSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.UpdateListenerRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.UpdateRuleRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.UpdateServiceNetworkRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.UpdateServiceNetworkVpcAssociationRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.UpdateServiceRequestMarshaller;
import software.amazon.awssdk.services.vpclattice.transform.UpdateTargetGroupRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link VpcLatticeClient}.
*
* @see VpcLatticeClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultVpcLatticeClient implements VpcLatticeClient {
private static final Logger log = Logger.loggerFor(DefaultVpcLatticeClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.REST_JSON).build();
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultVpcLatticeClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Updates the listener rules in a batch. You can use this operation to change the priority of listener rules. This
* can be useful when bulk updating or swapping rule priority.
*
*
* Required permissions: vpc-lattice:UpdateRule
*
*
* For more information, see How Amazon VPC
* Lattice works with IAM in the Amazon VPC Lattice User Guide.
*
*
* @param batchUpdateRuleRequest
* @return Result of the BatchUpdateRule operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.BatchUpdateRule
* @see AWS
* API Documentation
*/
@Override
public BatchUpdateRuleResponse batchUpdateRule(BatchUpdateRuleRequest batchUpdateRuleRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
BatchUpdateRuleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchUpdateRuleRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchUpdateRuleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchUpdateRule");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("BatchUpdateRule").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(batchUpdateRuleRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new BatchUpdateRuleRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Enables access logs to be sent to Amazon CloudWatch, Amazon S3, and Amazon Kinesis Data Firehose. The service
* network owner can use the access logs to audit the services in the network. The service network owner can only
* see access logs from clients and services that are associated with their service network. Access log entries
* represent traffic originated from VPCs associated with that network. For more information, see Access logs in the
* Amazon VPC Lattice User Guide.
*
*
* @param createAccessLogSubscriptionRequest
* @return Result of the CreateAccessLogSubscription operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.CreateAccessLogSubscription
* @see AWS API Documentation
*/
@Override
public CreateAccessLogSubscriptionResponse createAccessLogSubscription(
CreateAccessLogSubscriptionRequest createAccessLogSubscriptionRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateAccessLogSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAccessLogSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createAccessLogSubscriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAccessLogSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateAccessLogSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createAccessLogSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateAccessLogSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a listener for a service. Before you start using your Amazon VPC Lattice service, you must add one or
* more listeners. A listener is a process that checks for connection requests to your services. For more
* information, see Listeners in the
* Amazon VPC Lattice User Guide.
*
*
* @param createListenerRequest
* @return Result of the CreateListener operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws ServiceQuotaExceededException
* The request would cause a service quota to be exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.CreateListener
* @see AWS
* API Documentation
*/
@Override
public CreateListenerResponse createListener(CreateListenerRequest createListenerRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateListenerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createListenerRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createListenerRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateListener");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateListener").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createListenerRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateListenerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a listener rule. Each listener has a default rule for checking connection requests, but you can define
* additional rules. Each rule consists of a priority, one or more actions, and one or more conditions. For more
* information, see Listener rules in the
* Amazon VPC Lattice User Guide.
*
*
* @param createRuleRequest
* @return Result of the CreateRule operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws ServiceQuotaExceededException
* The request would cause a service quota to be exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.CreateRule
* @see AWS API
* Documentation
*/
@Override
public CreateRuleResponse createRule(CreateRuleRequest createRuleRequest) throws ValidationException, AccessDeniedException,
ThrottlingException, ResourceNotFoundException, ConflictException, ServiceQuotaExceededException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateRuleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createRuleRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createRuleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRule");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateRule").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(createRuleRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateRuleRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a service. A service is any software application that can run on instances containers, or serverless
* functions within an account or virtual private cloud (VPC).
*
*
* For more information, see Services
* in the Amazon VPC Lattice User Guide.
*
*
* @param createServiceRequest
* @return Result of the CreateService operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws ServiceQuotaExceededException
* The request would cause a service quota to be exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.CreateService
* @see AWS API
* Documentation
*/
@Override
public CreateServiceResponse createService(CreateServiceRequest createServiceRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateServiceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createServiceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createServiceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateService");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateService").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createServiceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateServiceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a service network. A service network is a logical boundary for a collection of services. You can
* associate services and VPCs with a service network.
*
*
* For more information, see Service networks in the
* Amazon VPC Lattice User Guide.
*
*
* @param createServiceNetworkRequest
* @return Result of the CreateServiceNetwork operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws ServiceQuotaExceededException
* The request would cause a service quota to be exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.CreateServiceNetwork
* @see AWS API Documentation
*/
@Override
public CreateServiceNetworkResponse createServiceNetwork(CreateServiceNetworkRequest createServiceNetworkRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateServiceNetworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createServiceNetworkRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createServiceNetworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateServiceNetwork");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateServiceNetwork").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createServiceNetworkRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateServiceNetworkRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Associates a service with a service network. For more information, see Manage service associations in the Amazon VPC Lattice User Guide.
*
*
* You can't use this operation if the service and service network are already associated or if there is a
* disassociation or deletion in progress. If the association fails, you can retry the operation by deleting the
* association and recreating it.
*
*
* You cannot associate a service and service network that are shared with a caller. The caller must own either the
* service or the service network.
*
*
* As a result of this operation, the association is created in the service network account and the association
* owner account.
*
*
* @param createServiceNetworkServiceAssociationRequest
* @return Result of the CreateServiceNetworkServiceAssociation operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws ServiceQuotaExceededException
* The request would cause a service quota to be exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.CreateServiceNetworkServiceAssociation
* @see AWS API Documentation
*/
@Override
public CreateServiceNetworkServiceAssociationResponse createServiceNetworkServiceAssociation(
CreateServiceNetworkServiceAssociationRequest createServiceNetworkServiceAssociationRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CreateServiceNetworkServiceAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createServiceNetworkServiceAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createServiceNetworkServiceAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateServiceNetworkServiceAssociation");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateServiceNetworkServiceAssociation").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(createServiceNetworkServiceAssociationRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateServiceNetworkServiceAssociationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Associates a VPC with a service network. When you associate a VPC with the service network, it enables all the
* resources within that VPC to be clients and communicate with other services in the service network. For more
* information, see Manage VPC associations in the Amazon VPC Lattice User Guide.
*
*
* You can't use this operation if there is a disassociation in progress. If the association fails, retry by
* deleting the association and recreating it.
*
*
* As a result of this operation, the association gets created in the service network account and the VPC owner
* account.
*
*
* If you add a security group to the service network and VPC association, the association must continue to always
* have at least one security group. You can add or edit security groups at any time. However, to remove all
* security groups, you must first delete the association and recreate it without security groups.
*
*
* @param createServiceNetworkVpcAssociationRequest
* @return Result of the CreateServiceNetworkVpcAssociation operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws ServiceQuotaExceededException
* The request would cause a service quota to be exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.CreateServiceNetworkVpcAssociation
* @see AWS API Documentation
*/
@Override
public CreateServiceNetworkVpcAssociationResponse createServiceNetworkVpcAssociation(
CreateServiceNetworkVpcAssociationRequest createServiceNetworkVpcAssociationRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateServiceNetworkVpcAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createServiceNetworkVpcAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createServiceNetworkVpcAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateServiceNetworkVpcAssociation");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateServiceNetworkVpcAssociation").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createServiceNetworkVpcAssociationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateServiceNetworkVpcAssociationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a target group. A target group is a collection of targets, or compute resources, that run your
* application or service. A target group can only be used by a single service.
*
*
* For more information, see Target
* groups in the Amazon VPC Lattice User Guide.
*
*
* @param createTargetGroupRequest
* @return Result of the CreateTargetGroup operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws ServiceQuotaExceededException
* The request would cause a service quota to be exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.CreateTargetGroup
* @see AWS
* API Documentation
*/
@Override
public CreateTargetGroupResponse createTargetGroup(CreateTargetGroupRequest createTargetGroupRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateTargetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createTargetGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createTargetGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTargetGroup");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateTargetGroup").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(createTargetGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateTargetGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified access log subscription.
*
*
* @param deleteAccessLogSubscriptionRequest
* @return Result of the DeleteAccessLogSubscription operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteAccessLogSubscription
* @see AWS API Documentation
*/
@Override
public DeleteAccessLogSubscriptionResponse deleteAccessLogSubscription(
DeleteAccessLogSubscriptionRequest deleteAccessLogSubscriptionRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteAccessLogSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAccessLogSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAccessLogSubscriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAccessLogSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteAccessLogSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteAccessLogSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteAccessLogSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified auth policy. If an auth is set to AWS_IAM
and the auth policy is deleted, all
* requests are denied. If you are trying to remove the auth policy completely, you must set the auth type to
* NONE
. If auth is enabled on the resource, but no auth policy is set, all requests are denied.
*
*
* @param deleteAuthPolicyRequest
* @return Result of the DeleteAuthPolicy operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteAuthPolicy
* @see AWS
* API Documentation
*/
@Override
public DeleteAuthPolicyResponse deleteAuthPolicy(DeleteAuthPolicyRequest deleteAuthPolicyRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteAuthPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAuthPolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAuthPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAuthPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteAuthPolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteAuthPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteAuthPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified listener.
*
*
* @param deleteListenerRequest
* @return Result of the DeleteListener operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteListener
* @see AWS
* API Documentation
*/
@Override
public DeleteListenerResponse deleteListener(DeleteListenerRequest deleteListenerRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteListenerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteListenerRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteListenerRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteListener");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteListener").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteListenerRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteListenerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified resource policy.
*
*
* @param deleteResourcePolicyRequest
* @return Result of the DeleteResourcePolicy operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteResourcePolicy
* @see AWS API Documentation
*/
@Override
public DeleteResourcePolicyResponse deleteResourcePolicy(DeleteResourcePolicyRequest deleteResourcePolicyRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteResourcePolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResourcePolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourcePolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourcePolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteResourcePolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteResourcePolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteResourcePolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a listener rule. Each listener has a default rule for checking connection requests, but you can define
* additional rules. Each rule consists of a priority, one or more actions, and one or more conditions. You can
* delete additional listener rules, but you cannot delete the default rule.
*
*
* For more information, see Listener rules in the
* Amazon VPC Lattice User Guide.
*
*
* @param deleteRuleRequest
* @return Result of the DeleteRule operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteRule
* @see AWS API
* Documentation
*/
@Override
public DeleteRuleResponse deleteRule(DeleteRuleRequest deleteRuleRequest) throws ValidationException, AccessDeniedException,
ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteRuleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteRuleRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRuleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRule");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteRule").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(deleteRuleRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteRuleRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a service. A service can't be deleted if it's associated with a service network. If you delete a service,
* all resources related to the service, such as the resource policy, auth policy, listeners, listener rules, and
* access log subscriptions, are also deleted. For more information, see Delete a service in the
* Amazon VPC Lattice User Guide.
*
*
* @param deleteServiceRequest
* @return Result of the DeleteService operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteService
* @see AWS API
* Documentation
*/
@Override
public DeleteServiceResponse deleteService(DeleteServiceRequest deleteServiceRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteServiceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteServiceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteServiceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteService");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteService").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteServiceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteServiceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a service network. You can only delete the service network if there is no service or VPC associated with
* it. If you delete a service network, all resources related to the service network, such as the resource policy,
* auth policy, and access log subscriptions, are also deleted. For more information, see Delete a
* service network in the Amazon VPC Lattice User Guide.
*
*
* @param deleteServiceNetworkRequest
* @return Result of the DeleteServiceNetwork operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteServiceNetwork
* @see AWS API Documentation
*/
@Override
public DeleteServiceNetworkResponse deleteServiceNetwork(DeleteServiceNetworkRequest deleteServiceNetworkRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteServiceNetworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteServiceNetworkRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteServiceNetworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteServiceNetwork");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteServiceNetwork").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteServiceNetworkRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteServiceNetworkRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the association between a specified service and the specific service network. This operation fails if an
* association is still in progress.
*
*
* @param deleteServiceNetworkServiceAssociationRequest
* @return Result of the DeleteServiceNetworkServiceAssociation operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteServiceNetworkServiceAssociation
* @see AWS API Documentation
*/
@Override
public DeleteServiceNetworkServiceAssociationResponse deleteServiceNetworkServiceAssociation(
DeleteServiceNetworkServiceAssociationRequest deleteServiceNetworkServiceAssociationRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteServiceNetworkServiceAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteServiceNetworkServiceAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteServiceNetworkServiceAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteServiceNetworkServiceAssociation");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteServiceNetworkServiceAssociation").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(deleteServiceNetworkServiceAssociationRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteServiceNetworkServiceAssociationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Disassociates the VPC from the service network. You can't disassociate the VPC if there is a create or update
* association in progress.
*
*
* @param deleteServiceNetworkVpcAssociationRequest
* @return Result of the DeleteServiceNetworkVpcAssociation operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteServiceNetworkVpcAssociation
* @see AWS API Documentation
*/
@Override
public DeleteServiceNetworkVpcAssociationResponse deleteServiceNetworkVpcAssociation(
DeleteServiceNetworkVpcAssociationRequest deleteServiceNetworkVpcAssociationRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteServiceNetworkVpcAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteServiceNetworkVpcAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteServiceNetworkVpcAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteServiceNetworkVpcAssociation");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteServiceNetworkVpcAssociation").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteServiceNetworkVpcAssociationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteServiceNetworkVpcAssociationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a target group. You can't delete a target group if it is used in a listener rule or if the target group
* creation is in progress.
*
*
* @param deleteTargetGroupRequest
* @return Result of the DeleteTargetGroup operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeleteTargetGroup
* @see AWS
* API Documentation
*/
@Override
public DeleteTargetGroupResponse deleteTargetGroup(DeleteTargetGroupRequest deleteTargetGroupRequest)
throws ValidationException, ThrottlingException, ResourceNotFoundException, ConflictException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteTargetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteTargetGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteTargetGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteTargetGroup");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteTargetGroup").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deleteTargetGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteTargetGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deregisters the specified targets from the specified target group.
*
*
* @param deregisterTargetsRequest
* @return Result of the DeregisterTargets operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.DeregisterTargets
* @see AWS
* API Documentation
*/
@Override
public DeregisterTargetsResponse deregisterTargets(DeregisterTargetsRequest deregisterTargetsRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeregisterTargetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deregisterTargetsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deregisterTargetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeregisterTargets");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeregisterTargets").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(deregisterTargetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeregisterTargetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the specified access log subscription.
*
*
* @param getAccessLogSubscriptionRequest
* @return Result of the GetAccessLogSubscription operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetAccessLogSubscription
* @see AWS API Documentation
*/
@Override
public GetAccessLogSubscriptionResponse getAccessLogSubscription(
GetAccessLogSubscriptionRequest getAccessLogSubscriptionRequest) throws ValidationException, AccessDeniedException,
ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException,
VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetAccessLogSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getAccessLogSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAccessLogSubscriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAccessLogSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetAccessLogSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getAccessLogSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAccessLogSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the auth policy for the specified service or service network.
*
*
* @param getAuthPolicyRequest
* @return Result of the GetAuthPolicy operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetAuthPolicy
* @see AWS API
* Documentation
*/
@Override
public GetAuthPolicyResponse getAuthPolicy(GetAuthPolicyRequest getAuthPolicyRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetAuthPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getAuthPolicyRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAuthPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAuthPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetAuthPolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getAuthPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAuthPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the specified listener for the specified service.
*
*
* @param getListenerRequest
* @return Result of the GetListener operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetListener
* @see AWS API
* Documentation
*/
@Override
public GetListenerResponse getListener(GetListenerRequest getListenerRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetListenerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getListenerRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getListenerRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetListener");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetListener").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getListenerRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetListenerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the resource policy. The resource policy is an IAM policy created on behalf of the
* resource owner when they share a resource.
*
*
* @param getResourcePolicyRequest
* @return Result of the GetResourcePolicy operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetResourcePolicy
* @see AWS
* API Documentation
*/
@Override
public GetResourcePolicyResponse getResourcePolicy(GetResourcePolicyRequest getResourcePolicyRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetResourcePolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getResourcePolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getResourcePolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResourcePolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetResourcePolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getResourcePolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetResourcePolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about listener rules. You can also retrieve information about the default listener rule.
* For more information, see Listener rules in the
* Amazon VPC Lattice User Guide.
*
*
* @param getRuleRequest
* @return Result of the GetRule operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetRule
* @see AWS API
* Documentation
*/
@Override
public GetRuleResponse getRule(GetRuleRequest getRuleRequest) throws ValidationException, AccessDeniedException,
ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException,
VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetRuleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRuleRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getRuleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRule");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetRule").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getRuleRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetRuleRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the specified service.
*
*
* @param getServiceRequest
* @return Result of the GetService operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetService
* @see AWS API
* Documentation
*/
@Override
public GetServiceResponse getService(GetServiceRequest getServiceRequest) throws ValidationException, AccessDeniedException,
ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException,
VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetServiceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getServiceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getServiceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetService");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetService").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getServiceRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetServiceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the specified service network.
*
*
* @param getServiceNetworkRequest
* @return Result of the GetServiceNetwork operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetServiceNetwork
* @see AWS
* API Documentation
*/
@Override
public GetServiceNetworkResponse getServiceNetwork(GetServiceNetworkRequest getServiceNetworkRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetServiceNetworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getServiceNetworkRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getServiceNetworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetServiceNetwork");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetServiceNetwork").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getServiceNetworkRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetServiceNetworkRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the specified association between a service network and a service.
*
*
* @param getServiceNetworkServiceAssociationRequest
* @return Result of the GetServiceNetworkServiceAssociation operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetServiceNetworkServiceAssociation
* @see AWS API Documentation
*/
@Override
public GetServiceNetworkServiceAssociationResponse getServiceNetworkServiceAssociation(
GetServiceNetworkServiceAssociationRequest getServiceNetworkServiceAssociationRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetServiceNetworkServiceAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getServiceNetworkServiceAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getServiceNetworkServiceAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetServiceNetworkServiceAssociation");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetServiceNetworkServiceAssociation").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getServiceNetworkServiceAssociationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetServiceNetworkServiceAssociationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the association between a service network and a VPC.
*
*
* @param getServiceNetworkVpcAssociationRequest
* @return Result of the GetServiceNetworkVpcAssociation operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetServiceNetworkVpcAssociation
* @see AWS API Documentation
*/
@Override
public GetServiceNetworkVpcAssociationResponse getServiceNetworkVpcAssociation(
GetServiceNetworkVpcAssociationRequest getServiceNetworkVpcAssociationRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetServiceNetworkVpcAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getServiceNetworkVpcAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getServiceNetworkVpcAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetServiceNetworkVpcAssociation");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetServiceNetworkVpcAssociation").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getServiceNetworkVpcAssociationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetServiceNetworkVpcAssociationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the specified target group.
*
*
* @param getTargetGroupRequest
* @return Result of the GetTargetGroup operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.GetTargetGroup
* @see AWS
* API Documentation
*/
@Override
public GetTargetGroupResponse getTargetGroup(GetTargetGroupRequest getTargetGroupRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetTargetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getTargetGroupRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getTargetGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetTargetGroup");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetTargetGroup").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getTargetGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetTargetGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all access log subscriptions for the specified service network or service.
*
*
* @param listAccessLogSubscriptionsRequest
* @return Result of the ListAccessLogSubscriptions operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListAccessLogSubscriptions
* @see AWS API Documentation
*/
@Override
public ListAccessLogSubscriptionsResponse listAccessLogSubscriptions(
ListAccessLogSubscriptionsRequest listAccessLogSubscriptionsRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException,
VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListAccessLogSubscriptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAccessLogSubscriptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listAccessLogSubscriptionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAccessLogSubscriptions");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListAccessLogSubscriptions").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listAccessLogSubscriptionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAccessLogSubscriptionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the listeners for the specified service.
*
*
* @param listListenersRequest
* @return Result of the ListListeners operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListListeners
* @see AWS API
* Documentation
*/
@Override
public ListListenersResponse listListeners(ListListenersRequest listListenersRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListListenersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listListenersRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listListenersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListListeners");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListListeners").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listListenersRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListListenersRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the rules for the listener.
*
*
* @param listRulesRequest
* @return Result of the ListRules operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListRules
* @see AWS API
* Documentation
*/
@Override
public ListRulesResponse listRules(ListRulesRequest listRulesRequest) throws ValidationException, AccessDeniedException,
ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException,
VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListRulesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRulesRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listRulesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRules");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListRules").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listRulesRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListRulesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the associations between the service network and the service. You can filter the list either by service or
* service network. You must provide either the service network identifier or the service identifier.
*
*
* Every association in Amazon VPC Lattice is given a unique Amazon Resource Name (ARN), such as when a service
* network is associated with a VPC or when a service is associated with a service network. If the association is
* for a resource that is shared with another account, the association includes the local account ID as the prefix
* in the ARN for each account the resource is shared with.
*
*
* @param listServiceNetworkServiceAssociationsRequest
* @return Result of the ListServiceNetworkServiceAssociations operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListServiceNetworkServiceAssociations
* @see AWS API Documentation
*/
@Override
public ListServiceNetworkServiceAssociationsResponse listServiceNetworkServiceAssociations(
ListServiceNetworkServiceAssociationsRequest listServiceNetworkServiceAssociationsRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ListServiceNetworkServiceAssociationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listServiceNetworkServiceAssociationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listServiceNetworkServiceAssociationsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListServiceNetworkServiceAssociations");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListServiceNetworkServiceAssociations").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(listServiceNetworkServiceAssociationsRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListServiceNetworkServiceAssociationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the service network and VPC associations. You can filter the list either by VPC or service network. You
* must provide either the service network identifier or the VPC identifier.
*
*
* @param listServiceNetworkVpcAssociationsRequest
* @return Result of the ListServiceNetworkVpcAssociations operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListServiceNetworkVpcAssociations
* @see AWS API Documentation
*/
@Override
public ListServiceNetworkVpcAssociationsResponse listServiceNetworkVpcAssociations(
ListServiceNetworkVpcAssociationsRequest listServiceNetworkVpcAssociationsRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException,
VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListServiceNetworkVpcAssociationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listServiceNetworkVpcAssociationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listServiceNetworkVpcAssociationsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListServiceNetworkVpcAssociations");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListServiceNetworkVpcAssociations").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listServiceNetworkVpcAssociationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListServiceNetworkVpcAssociationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the service networks owned by the caller account or shared with the caller account. Also includes the
* account ID in the ARN to show which account owns the service network.
*
*
* @param listServiceNetworksRequest
* @return Result of the ListServiceNetworks operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListServiceNetworks
* @see AWS API Documentation
*/
@Override
public ListServiceNetworksResponse listServiceNetworks(ListServiceNetworksRequest listServiceNetworksRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListServiceNetworksResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listServiceNetworksRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listServiceNetworksRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListServiceNetworks");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListServiceNetworks").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listServiceNetworksRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListServiceNetworksRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the services owned by the caller account or shared with the caller account.
*
*
* @param listServicesRequest
* @return Result of the ListServices operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListServices
* @see AWS API
* Documentation
*/
@Override
public ListServicesResponse listServices(ListServicesRequest listServicesRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException,
VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListServicesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listServicesRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listServicesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListServices");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListServices").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listServicesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListServicesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the tags for the specified resource.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws ValidationException, AccessDeniedException, ResourceNotFoundException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists your target groups. You can narrow your search by using the filters below in your request.
*
*
* @param listTargetGroupsRequest
* @return Result of the ListTargetGroups operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListTargetGroups
* @see AWS
* API Documentation
*/
@Override
public ListTargetGroupsResponse listTargetGroups(ListTargetGroupsRequest listTargetGroupsRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, InternalServerException, AwsServiceException, SdkClientException,
VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListTargetGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTargetGroupsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTargetGroupsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTargetGroups");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTargetGroups").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listTargetGroupsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTargetGroupsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the targets for the target group. By default, all targets are included. You can use this API to check the
* health status of targets. You can also filter the results by target.
*
*
* @param listTargetsRequest
* @return Result of the ListTargets operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.ListTargets
* @see AWS API
* Documentation
*/
@Override
public ListTargetsResponse listTargets(ListTargetsRequest listTargetsRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListTargetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTargetsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTargetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTargets");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTargets").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listTargetsRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTargetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates or updates the auth policy. The policy string in JSON must not contain newlines or blank lines.
*
*
* For more information, see Auth
* policies in the Amazon VPC Lattice User Guide.
*
*
* @param putAuthPolicyRequest
* @return Result of the PutAuthPolicy operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.PutAuthPolicy
* @see AWS API
* Documentation
*/
@Override
public PutAuthPolicyResponse putAuthPolicy(PutAuthPolicyRequest putAuthPolicyRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
PutAuthPolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putAuthPolicyRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putAuthPolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutAuthPolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PutAuthPolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putAuthPolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutAuthPolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Attaches a resource-based permission policy to a service or service network. The policy must contain the same
* actions and condition statements as the Amazon Web Services Resource Access Manager permission for sharing
* services and service networks.
*
*
* @param putResourcePolicyRequest
* @return Result of the PutResourcePolicy operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.PutResourcePolicy
* @see AWS
* API Documentation
*/
@Override
public PutResourcePolicyResponse putResourcePolicy(PutResourcePolicyRequest putResourcePolicyRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
PutResourcePolicyResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putResourcePolicyRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, putResourcePolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutResourcePolicy");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("PutResourcePolicy").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(putResourcePolicyRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutResourcePolicyRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Registers the targets with the target group. If it's a Lambda target, you can only have one target in a target
* group.
*
*
* @param registerTargetsRequest
* @return Result of the RegisterTargets operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws ServiceQuotaExceededException
* The request would cause a service quota to be exceeded.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.RegisterTargets
* @see AWS
* API Documentation
*/
@Override
public RegisterTargetsResponse registerTargets(RegisterTargetsRequest registerTargetsRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
ServiceQuotaExceededException, InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
RegisterTargetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(registerTargetsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, registerTargetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RegisterTargets");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("RegisterTargets").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(registerTargetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new RegisterTargetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds the specified tags to the specified resource.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(tagResourceRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes the specified tags from the specified resource.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.UntagResource
* @see AWS API
* Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ValidationException,
AccessDeniedException, ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException,
VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the specified access log subscription.
*
*
* @param updateAccessLogSubscriptionRequest
* @return Result of the UpdateAccessLogSubscription operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.UpdateAccessLogSubscription
* @see AWS API Documentation
*/
@Override
public UpdateAccessLogSubscriptionResponse updateAccessLogSubscription(
UpdateAccessLogSubscriptionRequest updateAccessLogSubscriptionRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateAccessLogSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAccessLogSubscriptionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAccessLogSubscriptionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAccessLogSubscription");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateAccessLogSubscription").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateAccessLogSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateAccessLogSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the specified listener for the specified service.
*
*
* @param updateListenerRequest
* @return Result of the UpdateListener operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.UpdateListener
* @see AWS
* API Documentation
*/
@Override
public UpdateListenerResponse updateListener(UpdateListenerRequest updateListenerRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateListenerResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateListenerRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateListenerRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateListener");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateListener").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateListenerRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateListenerRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates a rule for the listener. You can't modify a default listener rule. To modify a default listener rule, use
* UpdateListener
.
*
*
* @param updateRuleRequest
* @return Result of the UpdateRule operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.UpdateRule
* @see AWS API
* Documentation
*/
@Override
public UpdateRuleResponse updateRule(UpdateRuleRequest updateRuleRequest) throws ValidationException, AccessDeniedException,
ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException, AwsServiceException,
SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateRuleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateRuleRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRuleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRule");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateRule").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(updateRuleRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateRuleRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the specified service.
*
*
* @param updateServiceRequest
* @return Result of the UpdateService operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.UpdateService
* @see AWS API
* Documentation
*/
@Override
public UpdateServiceResponse updateService(UpdateServiceRequest updateServiceRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateServiceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateServiceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateServiceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateService");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateService").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateServiceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateServiceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the specified service network.
*
*
* @param updateServiceNetworkRequest
* @return Result of the UpdateServiceNetwork operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.UpdateServiceNetwork
* @see AWS API Documentation
*/
@Override
public UpdateServiceNetworkResponse updateServiceNetwork(UpdateServiceNetworkRequest updateServiceNetworkRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateServiceNetworkResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateServiceNetworkRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateServiceNetworkRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateServiceNetwork");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateServiceNetwork").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateServiceNetworkRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateServiceNetworkRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the service network and VPC association. If you add a security group to the service network and VPC
* association, the association must continue to always have at least one security group. You can add or edit
* security groups at any time. However, to remove all security groups, you must first delete the association and
* recreate it without security groups.
*
*
* @param updateServiceNetworkVpcAssociationRequest
* @return Result of the UpdateServiceNetworkVpcAssociation operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.UpdateServiceNetworkVpcAssociation
* @see AWS API Documentation
*/
@Override
public UpdateServiceNetworkVpcAssociationResponse updateServiceNetworkVpcAssociation(
UpdateServiceNetworkVpcAssociationRequest updateServiceNetworkVpcAssociationRequest) throws ValidationException,
AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException, InternalServerException,
AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateServiceNetworkVpcAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateServiceNetworkVpcAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
updateServiceNetworkVpcAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateServiceNetworkVpcAssociation");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateServiceNetworkVpcAssociation").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateServiceNetworkVpcAssociationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateServiceNetworkVpcAssociationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the specified target group.
*
*
* @param updateTargetGroupRequest
* @return Result of the UpdateTargetGroup operation returned by the service.
* @throws ValidationException
* The input does not satisfy the constraints specified by an Amazon Web Services service.
* @throws AccessDeniedException
* The user does not have sufficient access to perform this action.
* @throws ThrottlingException
* The limit on the number of requests per second was exceeded.
* @throws ResourceNotFoundException
* The request references a resource that does not exist.
* @throws ConflictException
* The request conflicts with the current state of the resource. Updating or deleting a resource can cause
* an inconsistent state.
* @throws InternalServerException
* An unexpected error occurred while processing the request.
* @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 VpcLatticeException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample VpcLatticeClient.UpdateTargetGroup
* @see AWS
* API Documentation
*/
@Override
public UpdateTargetGroupResponse updateTargetGroup(UpdateTargetGroupRequest updateTargetGroupRequest)
throws ValidationException, AccessDeniedException, ThrottlingException, ResourceNotFoundException, ConflictException,
InternalServerException, AwsServiceException, SdkClientException, VpcLatticeException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateTargetGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateTargetGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateTargetGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "VPC Lattice");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateTargetGroup");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateTargetGroup").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(updateTargetGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateTargetGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
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 void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) {
ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder();
RetryMode retryMode = builder.retryMode();
if (retryMode != null) {
configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode));
} else {
Consumer> configurator = builder.retryStrategyConfigurator();
if (configurator != null) {
RetryStrategy.Builder, ?> defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder();
configurator.accept(defaultBuilder);
configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build());
} else {
RetryStrategy retryStrategy = builder.retryStrategy();
if (retryStrategy != null) {
configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy);
}
}
}
configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null);
configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null);
configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null);
}
private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) {
List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder();
if (plugins.isEmpty()) {
return configuration.build();
}
VpcLatticeServiceClientConfigurationBuilder serviceConfigBuilder = new VpcLatticeServiceClientConfigurationBuilder(
configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
updateRetryStrategyClientConfiguration(configuration);
return configuration.build();
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(VpcLatticeException::builder)
.protocol(AwsJsonProtocol.REST_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("ThrottlingException")
.exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException")
.exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(402).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InternalServerException")
.exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).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(404).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ValidationException")
.exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build());
}
@Override
public final VpcLatticeServiceClientConfiguration serviceClientConfiguration() {
return new VpcLatticeServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build();
}
@Override
public void close() {
clientHandler.close();
}
}