@Generated(value="software.amazon.awssdk:codegen") @ThreadSafe public interface AmpClient extends SdkClient
builder()
method.
Amazon Managed Service for Prometheus
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVICE_METADATA_ID
Value for looking up the service's metadata from the
ServiceMetadataProvider. |
static String |
SERVICE_NAME |
| Modifier and Type | Method and Description |
|---|---|
static AmpClientBuilder |
builder()
Create a builder that can be used to configure and create a
AmpClient. |
static AmpClient |
create()
Create a
AmpClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider. |
default CreateWorkspaceResponse |
createWorkspace(Consumer<CreateWorkspaceRequest.Builder> createWorkspaceRequest)
Creates a new AMP workspace.
|
default CreateWorkspaceResponse |
createWorkspace(CreateWorkspaceRequest createWorkspaceRequest)
Creates a new AMP workspace.
|
default DeleteWorkspaceResponse |
deleteWorkspace(Consumer<DeleteWorkspaceRequest.Builder> deleteWorkspaceRequest)
Deletes an AMP workspace.
|
default DeleteWorkspaceResponse |
deleteWorkspace(DeleteWorkspaceRequest deleteWorkspaceRequest)
Deletes an AMP workspace.
|
default DescribeWorkspaceResponse |
describeWorkspace(Consumer<DescribeWorkspaceRequest.Builder> describeWorkspaceRequest)
Describes an existing AMP workspace.
|
default DescribeWorkspaceResponse |
describeWorkspace(DescribeWorkspaceRequest describeWorkspaceRequest)
Describes an existing AMP workspace.
|
default ListWorkspacesResponse |
listWorkspaces(Consumer<ListWorkspacesRequest.Builder> listWorkspacesRequest)
Lists all AMP workspaces, including workspaces being created or deleted.
|
default ListWorkspacesResponse |
listWorkspaces(ListWorkspacesRequest listWorkspacesRequest)
Lists all AMP workspaces, including workspaces being created or deleted.
|
default ListWorkspacesIterable |
listWorkspacesPaginator(Consumer<ListWorkspacesRequest.Builder> listWorkspacesRequest)
Lists all AMP workspaces, including workspaces being created or deleted.
|
default ListWorkspacesIterable |
listWorkspacesPaginator(ListWorkspacesRequest listWorkspacesRequest)
Lists all AMP workspaces, including workspaces being created or deleted.
|
static ServiceMetadata |
serviceMetadata() |
default UpdateWorkspaceAliasResponse |
updateWorkspaceAlias(Consumer<UpdateWorkspaceAliasRequest.Builder> updateWorkspaceAliasRequest)
Updates an AMP workspace alias.
|
default UpdateWorkspaceAliasResponse |
updateWorkspaceAlias(UpdateWorkspaceAliasRequest updateWorkspaceAliasRequest)
Updates an AMP workspace alias.
|
serviceNameclosestatic final String SERVICE_NAME
static final String SERVICE_METADATA_ID
ServiceMetadataProvider.static AmpClient create()
AmpClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider.static AmpClientBuilder builder()
AmpClient.default CreateWorkspaceResponse createWorkspace(CreateWorkspaceRequest createWorkspaceRequest) throws ThrottlingException, ConflictException, ValidationException, AccessDeniedException, InternalServerException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, AmpException
Creates a new AMP workspace.
createWorkspaceRequest - Represents the input of a CreateWorkspace operation.ThrottlingException - Request was denied due to request throttling.ConflictException - Updating or deleting a resource can cause an inconsistent state.ValidationException - The input fails to satisfy the constraints specified by an AWS service.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.ServiceQuotaExceededException - Request would cause a service quota to be exceeded.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault CreateWorkspaceResponse createWorkspace(Consumer<CreateWorkspaceRequest.Builder> createWorkspaceRequest) throws ThrottlingException, ConflictException, ValidationException, AccessDeniedException, InternalServerException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, AmpException
Creates a new AMP workspace.
This is a convenience which creates an instance of the CreateWorkspaceRequest.Builder avoiding the need
to create one manually via CreateWorkspaceRequest.builder()
createWorkspaceRequest - A Consumer that will call methods on CreateWorkspaceRequest.Builder to create a request.
Represents the input of a CreateWorkspace operation.ThrottlingException - Request was denied due to request throttling.ConflictException - Updating or deleting a resource can cause an inconsistent state.ValidationException - The input fails to satisfy the constraints specified by an AWS service.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.ServiceQuotaExceededException - Request would cause a service quota to be exceeded.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault DeleteWorkspaceResponse deleteWorkspace(DeleteWorkspaceRequest deleteWorkspaceRequest) throws ThrottlingException, ValidationException, ResourceNotFoundException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, AmpException
Deletes an AMP workspace.
deleteWorkspaceRequest - Represents the input of a DeleteWorkspace operation.ThrottlingException - Request was denied due to request throttling.ValidationException - The input fails to satisfy the constraints specified by an AWS service.ResourceNotFoundException - Request references a resource which does not exist.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault DeleteWorkspaceResponse deleteWorkspace(Consumer<DeleteWorkspaceRequest.Builder> deleteWorkspaceRequest) throws ThrottlingException, ValidationException, ResourceNotFoundException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, AmpException
Deletes an AMP workspace.
This is a convenience which creates an instance of the DeleteWorkspaceRequest.Builder avoiding the need
to create one manually via DeleteWorkspaceRequest.builder()
deleteWorkspaceRequest - A Consumer that will call methods on DeleteWorkspaceRequest.Builder to create a request.
Represents the input of a DeleteWorkspace operation.ThrottlingException - Request was denied due to request throttling.ValidationException - The input fails to satisfy the constraints specified by an AWS service.ResourceNotFoundException - Request references a resource which does not exist.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault DescribeWorkspaceResponse describeWorkspace(DescribeWorkspaceRequest describeWorkspaceRequest) throws ThrottlingException, ValidationException, ResourceNotFoundException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, AmpException
Describes an existing AMP workspace.
describeWorkspaceRequest - Represents the input of a DescribeWorkspace operation.ThrottlingException - Request was denied due to request throttling.ValidationException - The input fails to satisfy the constraints specified by an AWS service.ResourceNotFoundException - Request references a resource which does not exist.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault DescribeWorkspaceResponse describeWorkspace(Consumer<DescribeWorkspaceRequest.Builder> describeWorkspaceRequest) throws ThrottlingException, ValidationException, ResourceNotFoundException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, AmpException
Describes an existing AMP workspace.
This is a convenience which creates an instance of the DescribeWorkspaceRequest.Builder avoiding the need
to create one manually via DescribeWorkspaceRequest.builder()
describeWorkspaceRequest - A Consumer that will call methods on DescribeWorkspaceRequest.Builder to create a request.
Represents the input of a DescribeWorkspace operation.ThrottlingException - Request was denied due to request throttling.ValidationException - The input fails to satisfy the constraints specified by an AWS service.ResourceNotFoundException - Request references a resource which does not exist.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListWorkspacesResponse listWorkspaces(ListWorkspacesRequest listWorkspacesRequest) throws ThrottlingException, ValidationException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, AmpException
Lists all AMP workspaces, including workspaces being created or deleted.
listWorkspacesRequest - Represents the input of a ListWorkspaces operation.ThrottlingException - Request was denied due to request throttling.ValidationException - The input fails to satisfy the constraints specified by an AWS service.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListWorkspacesResponse listWorkspaces(Consumer<ListWorkspacesRequest.Builder> listWorkspacesRequest) throws ThrottlingException, ValidationException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, AmpException
Lists all AMP workspaces, including workspaces being created or deleted.
This is a convenience which creates an instance of the ListWorkspacesRequest.Builder avoiding the need to
create one manually via ListWorkspacesRequest.builder()
listWorkspacesRequest - A Consumer that will call methods on ListWorkspacesRequest.Builder to create a request.
Represents the input of a ListWorkspaces operation.ThrottlingException - Request was denied due to request throttling.ValidationException - The input fails to satisfy the constraints specified by an AWS service.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListWorkspacesIterable listWorkspacesPaginator(ListWorkspacesRequest listWorkspacesRequest) throws ThrottlingException, ValidationException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, AmpException
Lists all AMP workspaces, including workspaces being created or deleted.
This is a variant of listWorkspaces(software.amazon.awssdk.services.amp.model.ListWorkspacesRequest)
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
software.amazon.awssdk.services.amp.paginators.ListWorkspacesIterable responses = client.listWorkspacesPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.amp.paginators.ListWorkspacesIterable responses = client.listWorkspacesPaginator(request);
for (software.amazon.awssdk.services.amp.model.ListWorkspacesResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.amp.paginators.ListWorkspacesIterable responses = client.listWorkspacesPaginator(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
listWorkspaces(software.amazon.awssdk.services.amp.model.ListWorkspacesRequest) operation.
listWorkspacesRequest - Represents the input of a ListWorkspaces operation.ThrottlingException - Request was denied due to request throttling.ValidationException - The input fails to satisfy the constraints specified by an AWS service.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault ListWorkspacesIterable listWorkspacesPaginator(Consumer<ListWorkspacesRequest.Builder> listWorkspacesRequest) throws ThrottlingException, ValidationException, AccessDeniedException, InternalServerException, AwsServiceException, SdkClientException, AmpException
Lists all AMP workspaces, including workspaces being created or deleted.
This is a variant of listWorkspaces(software.amazon.awssdk.services.amp.model.ListWorkspacesRequest)
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
software.amazon.awssdk.services.amp.paginators.ListWorkspacesIterable responses = client.listWorkspacesPaginator(request);
responses.stream().forEach(....);
2) Using For loop
{
@code
software.amazon.awssdk.services.amp.paginators.ListWorkspacesIterable responses = client.listWorkspacesPaginator(request);
for (software.amazon.awssdk.services.amp.model.ListWorkspacesResponse response : responses) {
// do something;
}
}
3) Use iterator directly
software.amazon.awssdk.services.amp.paginators.ListWorkspacesIterable responses = client.listWorkspacesPaginator(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
listWorkspaces(software.amazon.awssdk.services.amp.model.ListWorkspacesRequest) operation.
This is a convenience which creates an instance of the ListWorkspacesRequest.Builder avoiding the need to
create one manually via ListWorkspacesRequest.builder()
listWorkspacesRequest - A Consumer that will call methods on ListWorkspacesRequest.Builder to create a request.
Represents the input of a ListWorkspaces operation.ThrottlingException - Request was denied due to request throttling.ValidationException - The input fails to satisfy the constraints specified by an AWS service.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault UpdateWorkspaceAliasResponse updateWorkspaceAlias(UpdateWorkspaceAliasRequest updateWorkspaceAliasRequest) throws ThrottlingException, ConflictException, ValidationException, ResourceNotFoundException, AccessDeniedException, InternalServerException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, AmpException
Updates an AMP workspace alias.
updateWorkspaceAliasRequest - Represents the input of an UpdateWorkspaceAlias operation.ThrottlingException - Request was denied due to request throttling.ConflictException - Updating or deleting a resource can cause an inconsistent state.ValidationException - The input fails to satisfy the constraints specified by an AWS service.ResourceNotFoundException - Request references a resource which does not exist.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.ServiceQuotaExceededException - Request would cause a service quota to be exceeded.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptiondefault UpdateWorkspaceAliasResponse updateWorkspaceAlias(Consumer<UpdateWorkspaceAliasRequest.Builder> updateWorkspaceAliasRequest) throws ThrottlingException, ConflictException, ValidationException, ResourceNotFoundException, AccessDeniedException, InternalServerException, ServiceQuotaExceededException, AwsServiceException, SdkClientException, AmpException
Updates an AMP workspace alias.
This is a convenience which creates an instance of the UpdateWorkspaceAliasRequest.Builder avoiding the
need to create one manually via UpdateWorkspaceAliasRequest.builder()
updateWorkspaceAliasRequest - A Consumer that will call methods on UpdateWorkspaceAliasRequest.Builder to create a
request. Represents the input of an UpdateWorkspaceAlias operation.ThrottlingException - Request was denied due to request throttling.ConflictException - Updating or deleting a resource can cause an inconsistent state.ValidationException - The input fails to satisfy the constraints specified by an AWS service.ResourceNotFoundException - Request references a resource which does not exist.AccessDeniedException - User does not have sufficient access to perform this action.InternalServerException - Unexpected error during processing of request.ServiceQuotaExceededException - Request would cause a service quota to be exceeded.SdkException - Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
catch all scenarios.SdkClientException - If any client side error occurs such as an IO related failure, failure to get credentials, etc.AmpException - Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.AwsServiceExceptionstatic ServiceMetadata serviceMetadata()
Copyright © 2021. All rights reserved.