/* * Copyright 2018-2023 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 com.amazonaws.services.servicediscovery; import javax.annotation.Generated; import com.amazonaws.*; import com.amazonaws.regions.*; import com.amazonaws.services.servicediscovery.model.*; /** * Interface for accessing ServiceDiscovery. *
* Note: Do not directly implement this interface, new methods are added to it regularly. Extend from * {@link com.amazonaws.services.servicediscovery.AbstractAWSServiceDiscovery} instead. *
*
*
* With Cloud Map, you can configure public DNS, private DNS, or HTTP namespaces that your microservice applications run * in. When an instance becomes available, you can call the Cloud Map API to register the instance with Cloud Map. For * public or private DNS namespaces, 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. *
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public interface AWSServiceDiscovery { /** * The region metadata service name for computing region endpoints. You can use this value to retrieve metadata * (such as supported regions) of the service. * * @see RegionUtils#getRegionsForService(String) */ String ENDPOINT_PREFIX = "servicediscovery"; /** *
* Creates an HTTP namespace. Service instances registered using an HTTP namespace can be discovered using a
* DiscoverInstances
request but can't be discovered using DNS.
*
* For the current quota on the number of namespaces that you can create using the same Amazon Web Services account, * see Cloud Map quotas in the * Cloud Map Developer Guide. *
* * @param createHttpNamespaceRequest * @return Result of the CreateHttpNamespace operation returned by the service. * @throws 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. * @throws NamespaceAlreadyExistsException * The namespace that you're trying to create already exists. * @throws ResourceLimitExceededException * The resource can't be created because you've reached the quota on the number of resources. * @throws DuplicateRequestException * The operation is already in progress. * @throws TooManyTagsException * The list of tags on the resource is over the quota. The maximum number of tags that can be applied to a * resource is 50. * @sample AWSServiceDiscovery.CreateHttpNamespace * @see AWS API Documentation */ CreateHttpNamespaceResult createHttpNamespace(CreateHttpNamespaceRequest createHttpNamespaceRequest); /** *
* Creates a private namespace based on DNS, which is 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 is backend.example.com
.
* Service instances that are registered using a private DNS namespace can be discovered using either a
* DiscoverInstances
request or using DNS. For the current quota on the number of namespaces that you
* can create using the same Amazon Web Services account, see Cloud Map quotas in the Cloud
* Map Developer Guide.
*
* Creates a public namespace based on DNS, which is 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 is backend.example.com
. You can
* discover instances that were registered with a public DNS namespace by using either a
* DiscoverInstances
request or using DNS. For the current quota on the number of namespaces that you
* can create using the same Amazon Web Services account, see Cloud Map quotas in the Cloud
* Map Developer Guide.
*
* The CreatePublicDnsNamespace
API operation is not supported in the Amazon Web Services GovCloud (US)
* Regions.
*
* Creates a service. This action 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 Cloud Map uses the values in the configuration to create the specified entities. *
** For the current quota on the number of instances that you can register using the same namespace and using the * same service, see Cloud Map * quotas in the Cloud Map Developer Guide. *
* * @param createServiceRequest * @return Result of the CreateService operation returned by the service. * @throws 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. * @throws ResourceLimitExceededException * The resource can't be created because you've reached the quota on the number of resources. * @throws NamespaceNotFoundException * No namespace exists with the specified ID. * @throws ServiceAlreadyExistsException * The service can't be created because a service with the same name already exists. * @throws TooManyTagsException * The list of tags on the resource is over the quota. The maximum number of tags that can be applied to a * resource is 50. * @sample AWSServiceDiscovery.CreateService * @see AWS * API Documentation */ CreateServiceResult createService(CreateServiceRequest createServiceRequest); /** ** Deletes a namespace from the current account. If the namespace still contains one or more services, the request * fails. *
* * @param deleteNamespaceRequest * @return Result of the DeleteNamespace operation returned by the service. * @throws 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. * @throws NamespaceNotFoundException * No namespace exists with the specified ID. * @throws 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. * @throws DuplicateRequestException * The operation is already in progress. * @sample AWSServiceDiscovery.DeleteNamespace * @see AWS API Documentation */ DeleteNamespaceResult deleteNamespace(DeleteNamespaceRequest deleteNamespaceRequest); /** ** Deletes a specified service. If the service still contains one or more registered instances, the request fails. *
* * @param deleteServiceRequest * @return Result of the DeleteService operation returned by the service. * @throws 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. * @throws ServiceNotFoundException * No service exists with the specified ID. * @throws 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. * @sample AWSServiceDiscovery.DeleteService * @see AWS * API Documentation */ DeleteServiceResult deleteService(DeleteServiceRequest deleteServiceRequest); /** ** Deletes the Amazon Route 53 DNS records and health check, if any, that Cloud Map created for the specified * instance. *
* * @param deregisterInstanceRequest * @return Result of the DeregisterInstance operation returned by the service. * @throws DuplicateRequestException * The operation is already in progress. * @throws 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. * @throws InstanceNotFoundException * No instance exists with the specified ID, or the instance was recently registered, and information about * the instance hasn't propagated yet. * @throws 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. * @throws ServiceNotFoundException * No service exists with the specified ID. * @sample AWSServiceDiscovery.DeregisterInstance * @see AWS API Documentation */ DeregisterInstanceResult deregisterInstance(DeregisterInstanceRequest deregisterInstanceRequest); /** *
* Discovers registered instances for a specified namespace and service. You can use DiscoverInstances
* to discover instances for any type of namespace. For public and private DNS namespaces, you can also use DNS
* queries to discover instances.
*
* Gets information about a specified instance. *
* * @param getInstanceRequest * @return Result of the GetInstance operation returned by the service. * @throws InstanceNotFoundException * No instance exists with the specified ID, or the instance was recently registered, and information about * the instance hasn't propagated yet. * @throws 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. * @throws ServiceNotFoundException * No service exists with the specified ID. * @sample AWSServiceDiscovery.GetInstance * @see AWS * API Documentation */ GetInstanceResult getInstance(GetInstanceRequest getInstanceRequest); /** *
* Gets the current health status (Healthy
, Unhealthy
, or Unknown
) of one or
* more instances that are associated with a specified service.
*
* There's a brief delay between when you register an instance and when the health status for the instance is * available. *
** Gets information about a namespace. *
* * @param getNamespaceRequest * @return Result of the GetNamespace operation returned by the service. * @throws 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. * @throws NamespaceNotFoundException * No namespace exists with the specified ID. * @sample AWSServiceDiscovery.GetNamespace * @see AWS * API Documentation */ GetNamespaceResult getNamespace(GetNamespaceRequest getNamespaceRequest); /** *
* 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. *
** Gets the settings for a specified service. *
* * @param getServiceRequest * @return Result of the GetService operation returned by the service. * @throws 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. * @throws ServiceNotFoundException * No service exists with the specified ID. * @sample AWSServiceDiscovery.GetService * @see AWS * API Documentation */ GetServiceResult getService(GetServiceRequest getServiceRequest); /** ** Lists summary information about the instances that you registered by using a specified service. *
* * @param listInstancesRequest * @return Result of the ListInstances operation returned by the service. * @throws ServiceNotFoundException * No service exists with the specified ID. * @throws 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. * @sample AWSServiceDiscovery.ListInstances * @see AWS * API Documentation */ ListInstancesResult listInstances(ListInstancesRequest listInstancesRequest); /** ** Lists summary information about the namespaces that were created by the current Amazon Web Services account. *
* * @param listNamespacesRequest * @return Result of the ListNamespaces operation returned by the service. * @throws 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. * @sample AWSServiceDiscovery.ListNamespaces * @see AWS API Documentation */ ListNamespacesResult listNamespaces(ListNamespacesRequest listNamespacesRequest); /** ** Lists operations that match the criteria that you specify. *
* * @param listOperationsRequest * @return Result of the ListOperations operation returned by the service. * @throws 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. * @sample AWSServiceDiscovery.ListOperations * @see AWS API Documentation */ ListOperationsResult listOperations(ListOperationsRequest listOperationsRequest); /** ** Lists summary information for all the services that are associated with one or more specified namespaces. *
* * @param listServicesRequest * @return Result of the ListServices operation returned by the service. * @throws 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. * @sample AWSServiceDiscovery.ListServices * @see AWS * API Documentation */ ListServicesResult listServices(ListServicesRequest listServicesRequest); /** ** Lists tags for the specified resource. *
* * @param listTagsForResourceRequest * @return Result of the ListTagsForResource operation returned by the service. * @throws ResourceNotFoundException * The operation can't be completed because the resource was not found. * @throws 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. * @sample AWSServiceDiscovery.ListTagsForResource * @see AWS API Documentation */ ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest); /** *
* 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's specified by ServiceId
, a record is
* created or updated in the hosted zone that's 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 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 quota on the number of instances that you can register using the same namespace and using the * same service, see Cloud Map * quotas in the Cloud Map Developer Guide. *
* * @param registerInstanceRequest * @return Result of the RegisterInstance operation returned by the service. * @throws DuplicateRequestException * The operation is already in progress. * @throws 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. * @throws 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. * @throws ResourceLimitExceededException * The resource can't be created because you've reached the quota on the number of resources. * @throws ServiceNotFoundException * No service exists with the specified ID. * @sample AWSServiceDiscovery.RegisterInstance * @see AWS API Documentation */ RegisterInstanceResult registerInstance(RegisterInstanceRequest registerInstanceRequest); /** ** Adds one or more tags to the specified resource. *
* * @param tagResourceRequest * @return Result of the TagResource operation returned by the service. * @throws ResourceNotFoundException * The operation can't be completed because the resource was not found. * @throws TooManyTagsException * The list of tags on the resource is over the quota. The maximum number of tags that can be applied to a * resource is 50. * @throws 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. * @sample AWSServiceDiscovery.TagResource * @see AWS * API Documentation */ TagResourceResult tagResource(TagResourceRequest tagResourceRequest); /** ** Removes one or more tags from the specified resource. *
* * @param untagResourceRequest * @return Result of the UntagResource operation returned by the service. * @throws ResourceNotFoundException * The operation can't be completed because the resource was not found. * @throws 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. * @sample AWSServiceDiscovery.UntagResource * @see AWS * API Documentation */ UntagResourceResult untagResource(UntagResourceRequest untagResourceRequest); /** ** Updates an HTTP namespace. *
* * @param updateHttpNamespaceRequest * @return Result of the UpdateHttpNamespace operation returned by the service. * @throws 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. * @throws NamespaceNotFoundException * No namespace exists with the specified ID. * @throws 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. * @throws DuplicateRequestException * The operation is already in progress. * @sample AWSServiceDiscovery.UpdateHttpNamespace * @see AWS API Documentation */ UpdateHttpNamespaceResult updateHttpNamespace(UpdateHttpNamespaceRequest updateHttpNamespaceRequest); /** ** 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. *
* * @param updateInstanceCustomHealthStatusRequest * @return Result of the UpdateInstanceCustomHealthStatus operation returned by the service. * @throws InstanceNotFoundException * No instance exists with the specified ID, or the instance was recently registered, and information about * the instance hasn't propagated yet. * @throws ServiceNotFoundException * No service exists with the specified ID. * @throws CustomHealthNotFoundException * The health check for the instance that's specified byServiceId
and InstanceId
* isn't a custom health check.
* @throws 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.
* @sample AWSServiceDiscovery.UpdateInstanceCustomHealthStatus
* @see AWS API Documentation
*/
UpdateInstanceCustomHealthStatusResult updateInstanceCustomHealthStatus(UpdateInstanceCustomHealthStatusRequest updateInstanceCustomHealthStatusRequest);
/**
* * Updates a private DNS namespace. *
* * @param updatePrivateDnsNamespaceRequest * @return Result of the UpdatePrivateDnsNamespace operation returned by the service. * @throws 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. * @throws NamespaceNotFoundException * No namespace exists with the specified ID. * @throws 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. * @throws DuplicateRequestException * The operation is already in progress. * @sample AWSServiceDiscovery.UpdatePrivateDnsNamespace * @see AWS API Documentation */ UpdatePrivateDnsNamespaceResult updatePrivateDnsNamespace(UpdatePrivateDnsNamespaceRequest updatePrivateDnsNamespaceRequest); /** ** Updates a public DNS namespace. *
* * @param updatePublicDnsNamespaceRequest * @return Result of the UpdatePublicDnsNamespace operation returned by the service. * @throws 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. * @throws NamespaceNotFoundException * No namespace exists with the specified ID. * @throws 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. * @throws DuplicateRequestException * The operation is already in progress. * @sample AWSServiceDiscovery.UpdatePublicDnsNamespace * @see AWS API Documentation */ UpdatePublicDnsNamespaceResult updatePublicDnsNamespace(UpdatePublicDnsNamespaceRequest updatePublicDnsNamespaceRequest); /** ** Submits a request to perform the following operations: *
*
* Update the TTL setting for existing DnsRecords
configurations
*
* Add, update, or delete HealthCheckConfig
for a specified service
*
* You can't add, update, or delete a HealthCheckCustomConfig
configuration.
*
* For public and private DNS namespaces, note the following: *
*
* If you omit any existing DnsRecords
or HealthCheckConfig
configurations from an
* UpdateService
request, the configurations are deleted from the service.
*
* If you omit an existing HealthCheckCustomConfig
configuration from an UpdateService
* request, the configuration isn't deleted from the service.
*
* When you update settings for a service, Cloud Map also updates the corresponding settings in all the records and * health checks that were created by using the specified service. *
* * @param updateServiceRequest * @return Result of the UpdateService operation returned by the service. * @throws DuplicateRequestException * The operation is already in progress. * @throws 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. * @throws ServiceNotFoundException * No service exists with the specified ID. * @sample AWSServiceDiscovery.UpdateService * @see AWS * API Documentation */ UpdateServiceResult updateService(UpdateServiceRequest updateServiceRequest); /** * Shuts down this client object, releasing any resources that might be held open. This is an optional method, and * callers are not expected to call it, but can if they want to explicitly release any open resources. Once a client * has been shutdown, it should not be used to make any more requests. */ void shutdown(); /** * Returns additional metadata for a previously executed successful request, typically used for debugging issues * where a service isn't acting as expected. This data isn't considered part of the result data returned by an * operation, so it's available through this separate, diagnostic interface. ** 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 a request. * * @param request * The originally executed request. * * @return The response metadata for the specified request, or null if none is available. */ ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request); }