software.amazon.awssdk.services.applicationdiscovery.DefaultApplicationDiscoveryClient Maven / Gradle / Ivy
Show all versions of applicationdiscovery 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.applicationdiscovery;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.applicationdiscovery.model.ApplicationDiscoveryException;
import software.amazon.awssdk.services.applicationdiscovery.model.ApplicationDiscoveryRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.AssociateConfigurationItemsToApplicationRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.AssociateConfigurationItemsToApplicationResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.AuthorizationErrorException;
import software.amazon.awssdk.services.applicationdiscovery.model.BatchDeleteImportDataRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.BatchDeleteImportDataResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.ConflictErrorException;
import software.amazon.awssdk.services.applicationdiscovery.model.CreateApplicationRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.CreateApplicationResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.CreateTagsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.CreateTagsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.DeleteApplicationsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.DeleteApplicationsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.DeleteTagsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.DeleteTagsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeAgentsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeAgentsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeConfigurationsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeConfigurationsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeContinuousExportsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeContinuousExportsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeExportTasksRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeExportTasksResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeImportTasksRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeImportTasksResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeTagsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.DescribeTagsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.DisassociateConfigurationItemsFromApplicationRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.DisassociateConfigurationItemsFromApplicationResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.GetDiscoverySummaryRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.GetDiscoverySummaryResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.HomeRegionNotSetException;
import software.amazon.awssdk.services.applicationdiscovery.model.InvalidParameterException;
import software.amazon.awssdk.services.applicationdiscovery.model.InvalidParameterValueException;
import software.amazon.awssdk.services.applicationdiscovery.model.ListConfigurationsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.ListConfigurationsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.ListServerNeighborsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.ListServerNeighborsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.OperationNotPermittedException;
import software.amazon.awssdk.services.applicationdiscovery.model.ResourceInUseException;
import software.amazon.awssdk.services.applicationdiscovery.model.ResourceNotFoundException;
import software.amazon.awssdk.services.applicationdiscovery.model.ServerInternalErrorException;
import software.amazon.awssdk.services.applicationdiscovery.model.StartContinuousExportRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.StartContinuousExportResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.StartDataCollectionByAgentIdsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.StartDataCollectionByAgentIdsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.StartExportTaskRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.StartExportTaskResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.StartImportTaskRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.StartImportTaskResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.StopContinuousExportRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.StopContinuousExportResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.StopDataCollectionByAgentIdsRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.StopDataCollectionByAgentIdsResponse;
import software.amazon.awssdk.services.applicationdiscovery.model.UpdateApplicationRequest;
import software.amazon.awssdk.services.applicationdiscovery.model.UpdateApplicationResponse;
import software.amazon.awssdk.services.applicationdiscovery.paginators.DescribeContinuousExportsIterable;
import software.amazon.awssdk.services.applicationdiscovery.paginators.DescribeImportTasksIterable;
import software.amazon.awssdk.services.applicationdiscovery.transform.AssociateConfigurationItemsToApplicationRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.BatchDeleteImportDataRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.CreateApplicationRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.CreateTagsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.DeleteApplicationsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.DeleteTagsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.DescribeAgentsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.DescribeConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.DescribeContinuousExportsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.DescribeExportTasksRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.DescribeImportTasksRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.DescribeTagsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.DisassociateConfigurationItemsFromApplicationRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.GetDiscoverySummaryRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.ListConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.ListServerNeighborsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.StartContinuousExportRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.StartDataCollectionByAgentIdsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.StartExportTaskRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.StartImportTaskRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.StopContinuousExportRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.StopDataCollectionByAgentIdsRequestMarshaller;
import software.amazon.awssdk.services.applicationdiscovery.transform.UpdateApplicationRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link ApplicationDiscoveryClient}.
*
* @see ApplicationDiscoveryClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultApplicationDiscoveryClient implements ApplicationDiscoveryClient {
private static final Logger log = Logger.loggerFor(DefaultApplicationDiscoveryClient.class);
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultApplicationDiscoveryClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Associates one or more configuration items with an application.
*
*
* @param associateConfigurationItemsToApplicationRequest
* @return Result of the AssociateConfigurationItemsToApplication operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.AssociateConfigurationItemsToApplication
*/
@Override
public AssociateConfigurationItemsToApplicationResponse associateConfigurationItemsToApplication(
AssociateConfigurationItemsToApplicationRequest associateConfigurationItemsToApplicationRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, AssociateConfigurationItemsToApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
associateConfigurationItemsToApplicationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateConfigurationItemsToApplication");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateConfigurationItemsToApplication").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler)
.withInput(associateConfigurationItemsToApplicationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AssociateConfigurationItemsToApplicationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes one or more import tasks, each identified by their import ID. Each import task has a number of records
* that can identify servers or applications.
*
*
* Amazon Web Services Application Discovery Service has built-in matching logic that will identify when discovered
* servers match existing entries that you've previously discovered, the information for the already-existing
* discovered server is updated. When you delete an import task that contains records that were used to match, the
* information in those matched records that comes from the deleted records will also be deleted.
*
*
* @param batchDeleteImportDataRequest
* @return Result of the BatchDeleteImportData operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.BatchDeleteImportData
*/
@Override
public BatchDeleteImportDataResponse batchDeleteImportData(BatchDeleteImportDataRequest batchDeleteImportDataRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchDeleteImportDataResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchDeleteImportDataRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchDeleteImportData");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("BatchDeleteImportData").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(batchDeleteImportDataRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new BatchDeleteImportDataRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates an application with the given name and description.
*
*
* @param createApplicationRequest
* @return Result of the CreateApplication operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.CreateApplication
*/
@Override
public CreateApplicationResponse createApplication(CreateApplicationRequest createApplicationRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createApplicationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateApplication");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateApplication").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createApplicationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateApplicationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates one or more tags for configuration items. Tags are metadata that help you categorize IT assets. This API
* accepts a list of multiple configuration items.
*
*
*
* Do not store sensitive information (like personal data) in tags.
*
*
*
* @param createTagsRequest
* @return Result of the CreateTags operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws ResourceNotFoundException
* The specified configuration ID was not located. Verify the configuration ID and try again.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.CreateTags
*/
@Override
public CreateTagsResponse createTags(CreateTagsRequest createTagsRequest) throws AuthorizationErrorException,
ResourceNotFoundException, InvalidParameterException, InvalidParameterValueException, ServerInternalErrorException,
HomeRegionNotSetException, AwsServiceException, SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateTagsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createTagsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateTags");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("CreateTags")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(createTagsRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateTagsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a list of applications and their associations with configuration items.
*
*
* @param deleteApplicationsRequest
* @return Result of the DeleteApplications operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DeleteApplications
*/
@Override
public DeleteApplicationsResponse deleteApplications(DeleteApplicationsRequest deleteApplicationsRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteApplicationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApplicationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApplications");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteApplications").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteApplicationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteApplicationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the association between configuration items and one or more tags. This API accepts a list of multiple
* configuration items.
*
*
* @param deleteTagsRequest
* @return Result of the DeleteTags operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws ResourceNotFoundException
* The specified configuration ID was not located. Verify the configuration ID and try again.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DeleteTags
*/
@Override
public DeleteTagsResponse deleteTags(DeleteTagsRequest deleteTagsRequest) throws AuthorizationErrorException,
ResourceNotFoundException, InvalidParameterException, InvalidParameterValueException, ServerInternalErrorException,
HomeRegionNotSetException, AwsServiceException, SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteTagsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteTagsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteTags");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("DeleteTags")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(deleteTagsRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteTagsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists agents or connectors as specified by ID or other filters. All agents/connectors associated with your user
* account can be listed if you call DescribeAgents
as is without passing any parameters.
*
*
* @param describeAgentsRequest
* @return Result of the DescribeAgents operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DescribeAgents
*/
@Override
public DescribeAgentsResponse describeAgents(DescribeAgentsRequest describeAgentsRequest) throws AuthorizationErrorException,
InvalidParameterException, InvalidParameterValueException, ServerInternalErrorException, HomeRegionNotSetException,
AwsServiceException, SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeAgentsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAgentsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAgents");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeAgents").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeAgentsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeAgentsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves attributes for a list of configuration item IDs.
*
*
*
* All of the supplied IDs must be for the same asset type from one of the following:
*
*
* -
*
* server
*
*
* -
*
* application
*
*
* -
*
* process
*
*
* -
*
* connection
*
*
*
*
* Output fields are specific to the asset type specified. For example, the output for a server configuration
* item includes a list of attributes about the server, such as host name, operating system, number of network
* cards, etc.
*
*
* For a complete list of outputs for each asset type, see Using the DescribeConfigurations Action in the Amazon Web Services Application Discovery Service User
* Guide.
*
*
*
* @param describeConfigurationsRequest
* @return Result of the DescribeConfigurations operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DescribeConfigurations
*/
@Override
public DescribeConfigurationsResponse describeConfigurations(DescribeConfigurationsRequest describeConfigurationsRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeConfigurationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeConfigurationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeConfigurations");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeConfigurations").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeConfigurationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeConfigurationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists exports as specified by ID. All continuous exports associated with your user account can be listed if you
* call DescribeContinuousExports
as is without passing any parameters.
*
*
* @param describeContinuousExportsRequest
* @return Result of the DescribeContinuousExports operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws OperationNotPermittedException
* This operation is not permitted.
* @throws ResourceNotFoundException
* The specified configuration ID was not located. Verify the configuration ID and try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DescribeContinuousExports
*/
@Override
public DescribeContinuousExportsResponse describeContinuousExports(
DescribeContinuousExportsRequest describeContinuousExportsRequest) throws AuthorizationErrorException,
InvalidParameterException, InvalidParameterValueException, ServerInternalErrorException,
OperationNotPermittedException, ResourceNotFoundException, HomeRegionNotSetException, AwsServiceException,
SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeContinuousExportsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeContinuousExportsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeContinuousExports");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeContinuousExports").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeContinuousExportsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeContinuousExportsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists exports as specified by ID. All continuous exports associated with your user account can be listed if you
* call DescribeContinuousExports
as is without passing any parameters.
*
*
*
* This is a variant of
* {@link #describeContinuousExports(software.amazon.awssdk.services.applicationdiscovery.model.DescribeContinuousExportsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.applicationdiscovery.paginators.DescribeContinuousExportsIterable responses = client.describeContinuousExportsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.applicationdiscovery.paginators.DescribeContinuousExportsIterable responses = client
* .describeContinuousExportsPaginator(request);
* for (software.amazon.awssdk.services.applicationdiscovery.model.DescribeContinuousExportsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.applicationdiscovery.paginators.DescribeContinuousExportsIterable responses = client.describeContinuousExportsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeContinuousExports(software.amazon.awssdk.services.applicationdiscovery.model.DescribeContinuousExportsRequest)}
* operation.
*
*
* @param describeContinuousExportsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws OperationNotPermittedException
* This operation is not permitted.
* @throws ResourceNotFoundException
* The specified configuration ID was not located. Verify the configuration ID and try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DescribeContinuousExports
*/
@Override
public DescribeContinuousExportsIterable describeContinuousExportsPaginator(
DescribeContinuousExportsRequest describeContinuousExportsRequest) throws AuthorizationErrorException,
InvalidParameterException, InvalidParameterValueException, ServerInternalErrorException,
OperationNotPermittedException, ResourceNotFoundException, HomeRegionNotSetException, AwsServiceException,
SdkClientException, ApplicationDiscoveryException {
return new DescribeContinuousExportsIterable(this, applyPaginatorUserAgent(describeContinuousExportsRequest));
}
/**
*
* Retrieve status of one or more export tasks. You can retrieve the status of up to 100 export tasks.
*
*
* @param describeExportTasksRequest
* @return Result of the DescribeExportTasks operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DescribeExportTasks
*/
@Override
public DescribeExportTasksResponse describeExportTasks(DescribeExportTasksRequest describeExportTasksRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeExportTasksResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeExportTasksRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeExportTasks");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeExportTasks").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeExportTasksRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeExportTasksRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns an array of import tasks for your account, including status information, times, IDs, the Amazon S3 Object
* URL for the import file, and more.
*
*
* @param describeImportTasksRequest
* @return Result of the DescribeImportTasks operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DescribeImportTasks
*/
@Override
public DescribeImportTasksResponse describeImportTasks(DescribeImportTasksRequest describeImportTasksRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeImportTasksResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeImportTasksRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeImportTasks");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeImportTasks").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeImportTasksRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeImportTasksRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns an array of import tasks for your account, including status information, times, IDs, the Amazon S3 Object
* URL for the import file, and more.
*
*
*
* This is a variant of
* {@link #describeImportTasks(software.amazon.awssdk.services.applicationdiscovery.model.DescribeImportTasksRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.applicationdiscovery.paginators.DescribeImportTasksIterable responses = client.describeImportTasksPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.applicationdiscovery.paginators.DescribeImportTasksIterable responses = client
* .describeImportTasksPaginator(request);
* for (software.amazon.awssdk.services.applicationdiscovery.model.DescribeImportTasksResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.applicationdiscovery.paginators.DescribeImportTasksIterable responses = client.describeImportTasksPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of maxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeImportTasks(software.amazon.awssdk.services.applicationdiscovery.model.DescribeImportTasksRequest)}
* operation.
*
*
* @param describeImportTasksRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DescribeImportTasks
*/
@Override
public DescribeImportTasksIterable describeImportTasksPaginator(DescribeImportTasksRequest describeImportTasksRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
return new DescribeImportTasksIterable(this, applyPaginatorUserAgent(describeImportTasksRequest));
}
/**
*
* Retrieves a list of configuration items that have tags as specified by the key-value pairs, name and value,
* passed to the optional parameter filters
.
*
*
* There are three valid tag filter names:
*
*
* -
*
* tagKey
*
*
* -
*
* tagValue
*
*
* -
*
* configurationId
*
*
*
*
* Also, all configuration items associated with your user account that have tags can be listed if you call
* DescribeTags
as is without passing any parameters.
*
*
* @param describeTagsRequest
* @return Result of the DescribeTags operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws ResourceNotFoundException
* The specified configuration ID was not located. Verify the configuration ID and try again.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DescribeTags
*/
@Override
public DescribeTagsResponse describeTags(DescribeTagsRequest describeTagsRequest) throws AuthorizationErrorException,
ResourceNotFoundException, InvalidParameterException, InvalidParameterValueException, ServerInternalErrorException,
HomeRegionNotSetException, AwsServiceException, SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeTagsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeTagsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeTags");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeTags").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeTagsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeTagsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Disassociates one or more configuration items from an application.
*
*
* @param disassociateConfigurationItemsFromApplicationRequest
* @return Result of the DisassociateConfigurationItemsFromApplication operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.DisassociateConfigurationItemsFromApplication
*/
@Override
public DisassociateConfigurationItemsFromApplicationResponse disassociateConfigurationItemsFromApplication(
DisassociateConfigurationItemsFromApplicationRequest disassociateConfigurationItemsFromApplicationRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DisassociateConfigurationItemsFromApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
disassociateConfigurationItemsFromApplicationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateConfigurationItemsFromApplication");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateConfigurationItemsFromApplication")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(disassociateConfigurationItemsFromApplicationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DisassociateConfigurationItemsFromApplicationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a short summary of discovered assets.
*
*
* This API operation takes no request parameters and is called as is at the command prompt as shown in the example.
*
*
* @param getDiscoverySummaryRequest
* @return Result of the GetDiscoverySummary operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.GetDiscoverySummary
*/
@Override
public GetDiscoverySummaryResponse getDiscoverySummary(GetDiscoverySummaryRequest getDiscoverySummaryRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDiscoverySummaryResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getDiscoverySummaryRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetDiscoverySummary");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetDiscoverySummary").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getDiscoverySummaryRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetDiscoverySummaryRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list of configuration items as specified by the value passed to the required parameter
* configurationType
. Optional filtering may be applied to refine search results.
*
*
* @param listConfigurationsRequest
* @return Result of the ListConfigurations operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws ResourceNotFoundException
* The specified configuration ID was not located. Verify the configuration ID and try again.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.ListConfigurations
*/
@Override
public ListConfigurationsResponse listConfigurations(ListConfigurationsRequest listConfigurationsRequest)
throws AuthorizationErrorException, ResourceNotFoundException, InvalidParameterException,
InvalidParameterValueException, ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException,
SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListConfigurationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listConfigurationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListConfigurations");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListConfigurations").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listConfigurationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListConfigurationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list of servers that are one network hop away from a specified server.
*
*
* @param listServerNeighborsRequest
* @return Result of the ListServerNeighbors operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.ListServerNeighbors
*/
@Override
public ListServerNeighborsResponse listServerNeighbors(ListServerNeighborsRequest listServerNeighborsRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListServerNeighborsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listServerNeighborsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListServerNeighbors");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListServerNeighbors").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listServerNeighborsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListServerNeighborsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Start the continuous flow of agent's discovered data into Amazon Athena.
*
*
* @param startContinuousExportRequest
* @return Result of the StartContinuousExport operation returned by the service.
* @throws ConflictErrorException
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws OperationNotPermittedException
* This operation is not permitted.
* @throws ResourceInUseException
* This issue occurs when the same clientRequestToken
is used with the
* StartImportTask
action, but with different parameters. For example, you use the same request
* token but have two different import URLs, you can encounter this issue. If the import tasks are meant to
* be different, use a different clientRequestToken
, and try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.StartContinuousExport
*/
@Override
public StartContinuousExportResponse startContinuousExport(StartContinuousExportRequest startContinuousExportRequest)
throws ConflictErrorException, AuthorizationErrorException, InvalidParameterException,
InvalidParameterValueException, ServerInternalErrorException, OperationNotPermittedException, ResourceInUseException,
HomeRegionNotSetException, AwsServiceException, SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StartContinuousExportResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startContinuousExportRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartContinuousExport");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartContinuousExport").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(startContinuousExportRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartContinuousExportRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Instructs the specified agents or connectors to start collecting data.
*
*
* @param startDataCollectionByAgentIdsRequest
* @return Result of the StartDataCollectionByAgentIds operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.StartDataCollectionByAgentIds
*/
@Override
public StartDataCollectionByAgentIdsResponse startDataCollectionByAgentIds(
StartDataCollectionByAgentIdsRequest startDataCollectionByAgentIdsRequest) throws AuthorizationErrorException,
InvalidParameterException, InvalidParameterValueException, ServerInternalErrorException, HomeRegionNotSetException,
AwsServiceException, SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StartDataCollectionByAgentIdsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
startDataCollectionByAgentIdsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartDataCollectionByAgentIds");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("StartDataCollectionByAgentIds").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(startDataCollectionByAgentIdsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartDataCollectionByAgentIdsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Begins the export of discovered data to an S3 bucket.
*
*
* If you specify agentIds
in a filter, the task exports up to 72 hours of detailed data collected by
* the identified Application Discovery Agent, including network, process, and performance details. A time range for
* exported agent data may be set by using startTime
and endTime
. Export of detailed agent
* data is limited to five concurrently running exports.
*
*
* If you do not include an agentIds
filter, summary data is exported that includes both Amazon Web
* Services Agentless Discovery Connector data and summary data from Amazon Web Services Discovery Agents. Export of
* summary data is limited to two exports per day.
*
*
* @param startExportTaskRequest
* @return Result of the StartExportTask operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws OperationNotPermittedException
* This operation is not permitted.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.StartExportTask
*/
@Override
public StartExportTaskResponse startExportTask(StartExportTaskRequest startExportTaskRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, OperationNotPermittedException, HomeRegionNotSetException, AwsServiceException,
SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StartExportTaskResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startExportTaskRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartExportTask");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartExportTask").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(startExportTaskRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartExportTaskRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Starts an import task, which allows you to import details of your on-premises environment directly into Amazon
* Web Services Migration Hub without having to use the Application Discovery Service (ADS) tools such as the
* Discovery Connector or Discovery Agent. This gives you the option to perform migration assessment and planning
* directly from your imported data, including the ability to group your devices as applications and track their
* migration status.
*
*
* To start an import request, do this:
*
*
* -
*
* Download the specially formatted comma separated value (CSV) import template, which you can find here: https://s3.us-west-2.amazonaws.com/templates-7cffcf56-bd96-4b1c-b45b-a5b42f282e46/import_template.csv.
*
*
* -
*
* Fill out the template with your server and application data.
*
*
* -
*
* Upload your import file to an Amazon S3 bucket, and make a note of it's Object URL. Your import file must be in
* the CSV format.
*
*
* -
*
* Use the console or the StartImportTask
command with the Amazon Web Services CLI or one of the Amazon
* Web Services SDKs to import the records from your file.
*
*
*
*
* For more information, including step-by-step procedures, see Migration Hub
* Import in the Amazon Web Services Application Discovery Service User Guide.
*
*
*
* There are limits to the number of import tasks you can create (and delete) in an Amazon Web Services account. For
* more information, see Amazon Web
* Services Application Discovery Service Limits in the Amazon Web Services Application Discovery Service
* User Guide.
*
*
*
* @param startImportTaskRequest
* @return Result of the StartImportTask operation returned by the service.
* @throws ResourceInUseException
* This issue occurs when the same clientRequestToken
is used with the
* StartImportTask
action, but with different parameters. For example, you use the same request
* token but have two different import URLs, you can encounter this issue. If the import tasks are meant to
* be different, use a different clientRequestToken
, and try again.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.StartImportTask
*/
@Override
public StartImportTaskResponse startImportTask(StartImportTaskRequest startImportTaskRequest) throws ResourceInUseException,
AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException, ServerInternalErrorException,
HomeRegionNotSetException, AwsServiceException, SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StartImportTaskResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startImportTaskRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartImportTask");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartImportTask").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(startImportTaskRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartImportTaskRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Stop the continuous flow of agent's discovered data into Amazon Athena.
*
*
* @param stopContinuousExportRequest
* @return Result of the StopContinuousExport operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws OperationNotPermittedException
* This operation is not permitted.
* @throws ResourceNotFoundException
* The specified configuration ID was not located. Verify the configuration ID and try again.
* @throws ResourceInUseException
* This issue occurs when the same clientRequestToken
is used with the
* StartImportTask
action, but with different parameters. For example, you use the same request
* token but have two different import URLs, you can encounter this issue. If the import tasks are meant to
* be different, use a different clientRequestToken
, and try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.StopContinuousExport
*/
@Override
public StopContinuousExportResponse stopContinuousExport(StopContinuousExportRequest stopContinuousExportRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, OperationNotPermittedException, ResourceNotFoundException, ResourceInUseException,
HomeRegionNotSetException, AwsServiceException, SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StopContinuousExportResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, stopContinuousExportRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopContinuousExport");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StopContinuousExport").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(stopContinuousExportRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StopContinuousExportRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Instructs the specified agents or connectors to stop collecting data.
*
*
* @param stopDataCollectionByAgentIdsRequest
* @return Result of the StopDataCollectionByAgentIds operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.StopDataCollectionByAgentIds
*/
@Override
public StopDataCollectionByAgentIdsResponse stopDataCollectionByAgentIds(
StopDataCollectionByAgentIdsRequest stopDataCollectionByAgentIdsRequest) throws AuthorizationErrorException,
InvalidParameterException, InvalidParameterValueException, ServerInternalErrorException, HomeRegionNotSetException,
AwsServiceException, SdkClientException, ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StopDataCollectionByAgentIdsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, stopDataCollectionByAgentIdsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopDataCollectionByAgentIds");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("StopDataCollectionByAgentIds").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(stopDataCollectionByAgentIdsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StopDataCollectionByAgentIdsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates metadata about an application.
*
*
* @param updateApplicationRequest
* @return Result of the UpdateApplication operation returned by the service.
* @throws AuthorizationErrorException
* The Amazon Web Services user account does not have permission to perform the action. Check the IAM policy
* associated with this account.
* @throws InvalidParameterException
* One or more parameters are not valid. Verify the parameters and try again.
* @throws InvalidParameterValueException
* The value of one or more parameters are either invalid or out of range. Verify the parameter values and
* try again.
* @throws ServerInternalErrorException
* The server experienced an internal error. Try again.
* @throws HomeRegionNotSetException
* The home region is not set. Set the home region to continue.
* @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 ApplicationDiscoveryException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationDiscoveryClient.UpdateApplication
*/
@Override
public UpdateApplicationResponse updateApplication(UpdateApplicationRequest updateApplicationRequest)
throws AuthorizationErrorException, InvalidParameterException, InvalidParameterValueException,
ServerInternalErrorException, HomeRegionNotSetException, AwsServiceException, SdkClientException,
ApplicationDiscoveryException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApplicationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Discovery Service");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApplication");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateApplication").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateApplicationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateApplicationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
RequestOverrideConfiguration requestOverrideConfiguration) {
List publishers = null;
if (requestOverrideConfiguration != null) {
publishers = requestOverrideConfiguration.metricPublishers();
}
if (publishers == null || publishers.isEmpty()) {
publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS);
}
if (publishers == null) {
publishers = Collections.emptyList();
}
return publishers;
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(ApplicationDiscoveryException::builder)
.protocol(AwsJsonProtocol.AWS_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("ServerInternalErrorException")
.exceptionBuilderSupplier(ServerInternalErrorException::builder).httpStatusCode(500).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidParameterException")
.exceptionBuilderSupplier(InvalidParameterException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidParameterValueException")
.exceptionBuilderSupplier(InvalidParameterValueException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceInUseException")
.exceptionBuilderSupplier(ResourceInUseException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ConflictErrorException")
.exceptionBuilderSupplier(ConflictErrorException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("OperationNotPermittedException")
.exceptionBuilderSupplier(OperationNotPermittedException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("HomeRegionNotSetException")
.exceptionBuilderSupplier(HomeRegionNotSetException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AuthorizationErrorException")
.exceptionBuilderSupplier(AuthorizationErrorException::builder).httpStatusCode(400).build());
}
@Override
public void close() {
clientHandler.close();
}
private T applyPaginatorUserAgent(T request) {
Consumer userAgentApplier = b -> b.addApiName(ApiName.builder()
.version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
}