@ThreadSafe @Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class AWSServiceDiscoveryClient extends AmazonWebServiceClient implements AWSServiceDiscovery
AWS Cloud Map lets you configure public DNS, private DNS, or HTTP namespaces that your microservice applications run in. When an instance of the service becomes available, you can call the AWS Cloud Map API to register the instance with AWS Cloud Map. For public or private DNS namespaces, AWS Cloud Map automatically creates DNS records and an optional health check. Clients that submit public or private DNS queries, or HTTP requests, for the service receive an answer that contains up to eight healthy records.
LOGGING_AWS_REQUEST_METRIC
ENDPOINT_PREFIX
Modifier and Type | Method and Description |
---|---|
static AWSServiceDiscoveryClientBuilder |
builder() |
CreateHttpNamespaceResult |
createHttpNamespace(CreateHttpNamespaceRequest request)
Creates an HTTP namespace.
|
CreatePrivateDnsNamespaceResult |
createPrivateDnsNamespace(CreatePrivateDnsNamespaceRequest request)
Creates a private namespace based on DNS, which will be visible only inside a specified Amazon VPC.
|
CreatePublicDnsNamespaceResult |
createPublicDnsNamespace(CreatePublicDnsNamespaceRequest request)
Creates a public namespace based on DNS, which will be visible on the internet.
|
CreateServiceResult |
createService(CreateServiceRequest request)
Creates a service, which defines the configuration for the following entities:
|
DeleteNamespaceResult |
deleteNamespace(DeleteNamespaceRequest request)
Deletes a namespace from the current account.
|
DeleteServiceResult |
deleteService(DeleteServiceRequest request)
Deletes a specified service.
|
DeregisterInstanceResult |
deregisterInstance(DeregisterInstanceRequest request)
Deletes the Amazon Route 53 DNS records and health check, if any, that AWS Cloud Map created for the specified
instance.
|
DiscoverInstancesResult |
discoverInstances(DiscoverInstancesRequest request)
Discovers registered instances for a specified namespace and service.
|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful, request, typically used for debugging issues
where a service isn't acting as expected.
|
GetInstanceResult |
getInstance(GetInstanceRequest request)
Gets information about a specified instance.
|
GetInstancesHealthStatusResult |
getInstancesHealthStatus(GetInstancesHealthStatusRequest request)
Gets the current health status (
Healthy , Unhealthy , or Unknown ) of one or
more instances that are associated with a specified service. |
GetNamespaceResult |
getNamespace(GetNamespaceRequest request)
Gets information about a namespace.
|
GetOperationResult |
getOperation(GetOperationRequest request)
Gets information about any operation that returns an operation ID in the response, such as a
CreateService request. |
GetServiceResult |
getService(GetServiceRequest request)
Gets the settings for a specified service.
|
ListInstancesResult |
listInstances(ListInstancesRequest request)
Lists summary information about the instances that you registered by using a specified service.
|
ListNamespacesResult |
listNamespaces(ListNamespacesRequest request)
Lists summary information about the namespaces that were created by the current AWS account.
|
ListOperationsResult |
listOperations(ListOperationsRequest request)
Lists operations that match the criteria that you specify.
|
ListServicesResult |
listServices(ListServicesRequest request)
Lists summary information for all the services that are associated with one or more specified namespaces.
|
RegisterInstanceResult |
registerInstance(RegisterInstanceRequest request)
Creates or updates one or more records and, optionally, creates a health check based on the settings in a
specified service.
|
UpdateInstanceCustomHealthStatusResult |
updateInstanceCustomHealthStatus(UpdateInstanceCustomHealthStatusRequest request)
Submits a request to change the health status of a custom health check to healthy or unhealthy.
|
UpdateServiceResult |
updateService(UpdateServiceRequest request)
Submits a request to perform the following operations:
|
addRequestHandler, addRequestHandler, configureRegion, getClientConfiguration, getEndpointPrefix, getMonitoringListeners, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerOverride, getSignerRegionOverride, getTimeOffset, makeImmutable, removeRequestHandler, removeRequestHandler, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withEndpoint, withRegion, withRegion, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
shutdown
public static AWSServiceDiscoveryClientBuilder builder()
public CreateHttpNamespaceResult createHttpNamespace(CreateHttpNamespaceRequest request)
Creates an HTTP namespace. Service instances that you register using an HTTP namespace can be discovered using a
DiscoverInstances
request but can't be discovered using DNS.
For the current limit on the number of namespaces that you can create using the same AWS account, see AWS Cloud Map Limits in the AWS Cloud Map Developer Guide.
createHttpNamespace
in interface AWSServiceDiscovery
createHttpNamespaceRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.NamespaceAlreadyExistsException
- The namespace that you're trying to create already exists.ResourceLimitExceededException
- The resource can't be created because you've reached the limit on the number of resources.DuplicateRequestException
- The operation is already in progress.public CreatePrivateDnsNamespaceResult createPrivateDnsNamespace(CreatePrivateDnsNamespaceRequest request)
Creates a private namespace based on DNS, which will be visible only inside a specified Amazon VPC. The namespace
defines your service naming scheme. For example, if you name your namespace example.com
and name
your service backend
, the resulting DNS name for the service will be
backend.example.com
. For the current limit on the number of namespaces that you can create using the
same AWS account, see AWS Cloud
Map Limits in the AWS Cloud Map Developer Guide.
createPrivateDnsNamespace
in interface AWSServiceDiscovery
createPrivateDnsNamespaceRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.NamespaceAlreadyExistsException
- The namespace that you're trying to create already exists.ResourceLimitExceededException
- The resource can't be created because you've reached the limit on the number of resources.DuplicateRequestException
- The operation is already in progress.public CreatePublicDnsNamespaceResult createPublicDnsNamespace(CreatePublicDnsNamespaceRequest request)
Creates a public namespace based on DNS, which will be visible on the internet. The namespace defines your
service naming scheme. For example, if you name your namespace example.com
and name your service
backend
, the resulting DNS name for the service will be backend.example.com
. For the
current limit on the number of namespaces that you can create using the same AWS account, see AWS Cloud Map Limits in the
AWS Cloud Map Developer Guide.
createPublicDnsNamespace
in interface AWSServiceDiscovery
createPublicDnsNamespaceRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.NamespaceAlreadyExistsException
- The namespace that you're trying to create already exists.ResourceLimitExceededException
- The resource can't be created because you've reached the limit on the number of resources.DuplicateRequestException
- The operation is already in progress.public CreateServiceResult createService(CreateServiceRequest request)
Creates a service, which defines the configuration for the following entities:
For public and private DNS namespaces, one of the following combinations of DNS records in Amazon Route 53:
A
AAAA
A and AAAA
SRV
CNAME
Optionally, a health check
After you create the service, you can submit a RegisterInstance request, and AWS Cloud Map uses the values in the configuration to create the specified entities.
For the current limit on the number of instances that you can register using the same namespace and using the same service, see AWS Cloud Map Limits in the AWS Cloud Map Developer Guide.
createService
in interface AWSServiceDiscovery
createServiceRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.ResourceLimitExceededException
- The resource can't be created because you've reached the limit on the number of resources.NamespaceNotFoundException
- No namespace exists with the specified ID.ServiceAlreadyExistsException
- The service can't be created because a service with the same name already exists.public DeleteNamespaceResult deleteNamespace(DeleteNamespaceRequest request)
Deletes a namespace from the current account. If the namespace still contains one or more services, the request fails.
deleteNamespace
in interface AWSServiceDiscovery
deleteNamespaceRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.NamespaceNotFoundException
- No namespace exists with the specified ID.ResourceInUseException
- The specified resource can't be deleted because it contains other resources. For example, you can't
delete a service that contains any instances.DuplicateRequestException
- The operation is already in progress.public DeleteServiceResult deleteService(DeleteServiceRequest request)
Deletes a specified service. If the service still contains one or more registered instances, the request fails.
deleteService
in interface AWSServiceDiscovery
deleteServiceRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.ServiceNotFoundException
- No service exists with the specified ID.ResourceInUseException
- The specified resource can't be deleted because it contains other resources. For example, you can't
delete a service that contains any instances.public DeregisterInstanceResult deregisterInstance(DeregisterInstanceRequest request)
Deletes the Amazon Route 53 DNS records and health check, if any, that AWS Cloud Map created for the specified instance.
deregisterInstance
in interface AWSServiceDiscovery
deregisterInstanceRequest
- DuplicateRequestException
- The operation is already in progress.InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.InstanceNotFoundException
- No instance exists with the specified ID, or the instance was recently registered, and information about
the instance hasn't propagated yet.ResourceInUseException
- The specified resource can't be deleted because it contains other resources. For example, you can't
delete a service that contains any instances.ServiceNotFoundException
- No service exists with the specified ID.public DiscoverInstancesResult discoverInstances(DiscoverInstancesRequest request)
Discovers registered instances for a specified namespace and service.
discoverInstances
in interface AWSServiceDiscovery
discoverInstancesRequest
- ServiceNotFoundException
- No service exists with the specified ID.NamespaceNotFoundException
- No namespace exists with the specified ID.InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.public GetInstanceResult getInstance(GetInstanceRequest request)
Gets information about a specified instance.
getInstance
in interface AWSServiceDiscovery
getInstanceRequest
- InstanceNotFoundException
- No instance exists with the specified ID, or the instance was recently registered, and information about
the instance hasn't propagated yet.InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.ServiceNotFoundException
- No service exists with the specified ID.public GetInstancesHealthStatusResult getInstancesHealthStatus(GetInstancesHealthStatusRequest request)
Gets the current health status (Healthy
, Unhealthy
, or Unknown
) of one or
more instances that are associated with a specified service.
There is a brief delay between when you register an instance and when the health status for the instance is available.
getInstancesHealthStatus
in interface AWSServiceDiscovery
getInstancesHealthStatusRequest
- InstanceNotFoundException
- No instance exists with the specified ID, or the instance was recently registered, and information about
the instance hasn't propagated yet.InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.ServiceNotFoundException
- No service exists with the specified ID.public GetNamespaceResult getNamespace(GetNamespaceRequest request)
Gets information about a namespace.
getNamespace
in interface AWSServiceDiscovery
getNamespaceRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.NamespaceNotFoundException
- No namespace exists with the specified ID.public GetOperationResult getOperation(GetOperationRequest request)
Gets information about any operation that returns an operation ID in the response, such as a
CreateService
request.
To get a list of operations that match specified criteria, see ListOperations.
getOperation
in interface AWSServiceDiscovery
getOperationRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.OperationNotFoundException
- No operation exists with the specified ID.public GetServiceResult getService(GetServiceRequest request)
Gets the settings for a specified service.
getService
in interface AWSServiceDiscovery
getServiceRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.ServiceNotFoundException
- No service exists with the specified ID.public ListInstancesResult listInstances(ListInstancesRequest request)
Lists summary information about the instances that you registered by using a specified service.
listInstances
in interface AWSServiceDiscovery
listInstancesRequest
- ServiceNotFoundException
- No service exists with the specified ID.InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.public ListNamespacesResult listNamespaces(ListNamespacesRequest request)
Lists summary information about the namespaces that were created by the current AWS account.
listNamespaces
in interface AWSServiceDiscovery
listNamespacesRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.public ListOperationsResult listOperations(ListOperationsRequest request)
Lists operations that match the criteria that you specify.
listOperations
in interface AWSServiceDiscovery
listOperationsRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.public ListServicesResult listServices(ListServicesRequest request)
Lists summary information for all the services that are associated with one or more specified namespaces.
listServices
in interface AWSServiceDiscovery
listServicesRequest
- InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.public RegisterInstanceResult registerInstance(RegisterInstanceRequest request)
Creates or updates one or more records and, optionally, creates a health check based on the settings in a
specified service. When you submit a RegisterInstance
request, the following occurs:
For each DNS record that you define in the service that is specified by ServiceId
, a record is
created or updated in the hosted zone that is associated with the corresponding namespace.
If the service includes HealthCheckConfig
, a health check is created based on the settings in the
health check configuration.
The health check, if any, is associated with each of the new or updated records.
One RegisterInstance
request must complete before you can submit another request and specify the
same service ID and instance ID.
For more information, see CreateService.
When AWS Cloud Map receives a DNS query for the specified DNS name, it returns the applicable value:
If the health check is healthy: returns all the records
If the health check is unhealthy: returns the applicable value for the last healthy instance
If you didn't specify a health check configuration: returns all the records
For the current limit on the number of instances that you can register using the same namespace and using the same service, see AWS Cloud Map Limits in the AWS Cloud Map Developer Guide.
registerInstance
in interface AWSServiceDiscovery
registerInstanceRequest
- DuplicateRequestException
- The operation is already in progress.InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.ResourceInUseException
- The specified resource can't be deleted because it contains other resources. For example, you can't
delete a service that contains any instances.ResourceLimitExceededException
- The resource can't be created because you've reached the limit on the number of resources.ServiceNotFoundException
- No service exists with the specified ID.public UpdateInstanceCustomHealthStatusResult updateInstanceCustomHealthStatus(UpdateInstanceCustomHealthStatusRequest request)
Submits a request to change the health status of a custom health check to healthy or unhealthy.
You can use UpdateInstanceCustomHealthStatus
to change the status only for custom health checks,
which you define using HealthCheckCustomConfig
when you create a service. You can't use it to change
the status for Route 53 health checks, which you define using HealthCheckConfig
.
For more information, see HealthCheckCustomConfig.
updateInstanceCustomHealthStatus
in interface AWSServiceDiscovery
updateInstanceCustomHealthStatusRequest
- InstanceNotFoundException
- No instance exists with the specified ID, or the instance was recently registered, and information about
the instance hasn't propagated yet.ServiceNotFoundException
- No service exists with the specified ID.CustomHealthNotFoundException
- The health check for the instance that is specified by ServiceId
and InstanceId
is not a custom health check.InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.public UpdateServiceResult updateService(UpdateServiceRequest request)
Submits a request to perform the following operations:
Add or delete DnsRecords
configurations
Update the TTL setting for existing DnsRecords
configurations
Add, update, or delete HealthCheckConfig
for a specified service
For public and private DNS namespaces, you must specify all DnsRecords
configurations (and,
optionally, HealthCheckConfig
) that you want to appear in the updated service. Any current
configurations that don't appear in an UpdateService
request are deleted.
When you update the TTL setting for a service, AWS Cloud Map also updates the corresponding settings in all the records and health checks that were created by using the specified service.
updateService
in interface AWSServiceDiscovery
updateServiceRequest
- DuplicateRequestException
- The operation is already in progress.InvalidInputException
- One or more specified values aren't valid. For example, a required value might be missing, a numeric
value might be outside the allowed range, or a string value might exceed length constraints.ServiceNotFoundException
- No service exists with the specified ID.public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AWSServiceDiscovery
request
- The originally executed requestCopyright © 2013 Amazon Web Services, Inc. All Rights Reserved.