JavaScript is disabled on your browser.
Skip navigation links

AWS SDK for Java 1.x API Reference - 1.12.793

We announced the upcoming end-of-support for AWS SDK for Java (v1). We recommend that you migrate to AWS SDK for Java v2. For dates, additional details, and information on how to migrate, please refer to the linked announcement.
  • Detail:
  • Field |
  • Constr |
  • Method
com.amazonaws.services.servicediscovery

Class AWSServiceDiscoveryClient

  • All Implemented Interfaces:
    AWSServiceDiscovery
    Direct Known Subclasses:
    AWSServiceDiscoveryAsyncClient


    @ThreadSafe
     @Generated(value="com.amazonaws:aws-java-sdk-code-generator")
    public class AWSServiceDiscoveryClient
    extends AmazonWebServiceClient
    implements AWSServiceDiscovery 
    Client for accessing ServiceDiscovery. All service calls made using this client are blocking, and will not return until the service call completes.

    Cloud Map

    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.

    • Method Detail

      • createHttpNamespace

        public CreateHttpNamespaceResult createHttpNamespace(CreateHttpNamespaceRequest request)

        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.

        Specified by:
        createHttpNamespace in interface AWSServiceDiscovery
        Parameters:
        createHttpNamespaceRequest -
        Returns:
        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.
        NamespaceAlreadyExistsException - The namespace that you're trying to create already exists.
        ResourceLimitExceededException - The resource can't be created because you've reached the quota on the number of resources.
        DuplicateRequestException - The operation is already in progress.
        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.
        See Also:
        AWS API Documentation
      • createPrivateDnsNamespace

        public CreatePrivateDnsNamespaceResult createPrivateDnsNamespace(CreatePrivateDnsNamespaceRequest request)

        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.

        Specified by:
        createPrivateDnsNamespace in interface AWSServiceDiscovery
        Parameters:
        createPrivateDnsNamespaceRequest -
        Returns:
        Result of the CreatePrivateDnsNamespace 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.
        NamespaceAlreadyExistsException - The namespace that you're trying to create already exists.
        ResourceLimitExceededException - The resource can't be created because you've reached the quota on the number of resources.
        DuplicateRequestException - The operation is already in progress.
        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.
        See Also:
        AWS API Documentation
      • createPublicDnsNamespace

        public CreatePublicDnsNamespaceResult createPublicDnsNamespace(CreatePublicDnsNamespaceRequest request)

        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.

        Specified by:
        createPublicDnsNamespace in interface AWSServiceDiscovery
        Parameters:
        createPublicDnsNamespaceRequest -
        Returns:
        Result of the CreatePublicDnsNamespace 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.
        NamespaceAlreadyExistsException - The namespace that you're trying to create already exists.
        ResourceLimitExceededException - The resource can't be created because you've reached the quota on the number of resources.
        DuplicateRequestException - The operation is already in progress.
        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.
        See Also:
        AWS API Documentation
      • createService

        public CreateServiceResult createService(CreateServiceRequest request)

        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.

        Specified by:
        createService in interface AWSServiceDiscovery
        Parameters:
        createServiceRequest -
        Returns:
        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.
        ResourceLimitExceededException - The resource can't be created because you've reached the quota 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.
        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.
        See Also:
        AWS API Documentation
      • deleteService

        public DeleteServiceResult deleteService(DeleteServiceRequest request)

        Deletes a specified service. If the service still contains one or more registered instances, the request fails.

        Specified by:
        deleteService in interface AWSServiceDiscovery
        Parameters:
        deleteServiceRequest -
        Returns:
        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.
        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.
        See Also:
        AWS API Documentation
      • deregisterInstance

        public DeregisterInstanceResult deregisterInstance(DeregisterInstanceRequest request)

        Deletes the Amazon Route 53 DNS records and health check, if any, that Cloud Map created for the specified instance.

        Specified by:
        deregisterInstance in interface AWSServiceDiscovery
        Parameters:
        deregisterInstanceRequest -
        Returns:
        Result of the DeregisterInstance operation returned by the service.
        Throws:
        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.
        See Also:
        AWS API Documentation
      • discoverInstances

        public DiscoverInstancesResult discoverInstances(DiscoverInstancesRequest request)

        Discovers registered instances for a specified namespace and service. You can use DiscoverInstances to discover instances for any type of namespace. DiscoverInstances returns a randomized list of instances allowing customers to distribute traffic evenly across instances. For public and private DNS namespaces, you can also use DNS queries to discover instances.

        Specified by:
        discoverInstances in interface AWSServiceDiscovery
        Parameters:
        discoverInstancesRequest -
        Returns:
        Result of the DiscoverInstances operation returned by the service.
        Throws:
        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.
        RequestLimitExceededException - The operation can't be completed because you've reached the quota for the number of requests. For more information, see Cloud Map API request throttling quota in the Cloud Map Developer Guide.
        See Also:
        AWS API Documentation
      • getInstance

        public GetInstanceResult getInstance(GetInstanceRequest request)

        Gets information about a specified instance.

        Specified by:
        getInstance in interface AWSServiceDiscovery
        Parameters:
        getInstanceRequest -
        Returns:
        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.
        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.
        See Also:
        AWS API Documentation
      • getInstancesHealthStatus

        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's a brief delay between when you register an instance and when the health status for the instance is available.

        Specified by:
        getInstancesHealthStatus in interface AWSServiceDiscovery
        Parameters:
        getInstancesHealthStatusRequest -
        Returns:
        Result of the GetInstancesHealthStatus 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.
        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.
        See Also:
        AWS API Documentation
      • getOperation

        public GetOperationResult getOperation(GetOperationRequest request)

        Gets information about any operation that returns an operation ID in the response, such as a CreateHttpNamespace request.

        To get a list of operations that match specified criteria, see ListOperations.

        Specified by:
        getOperation in interface AWSServiceDiscovery
        Parameters:
        getOperationRequest -
        Returns:
        Result of the GetOperation 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.
        OperationNotFoundException - No operation exists with the specified ID.
        See Also:
        AWS API Documentation
      • listNamespaces

        public ListNamespacesResult listNamespaces(ListNamespacesRequest request)

        Lists summary information about the namespaces that were created by the current Amazon Web Services account.

        Specified by:
        listNamespaces in interface AWSServiceDiscovery
        Parameters:
        listNamespacesRequest -
        Returns:
        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.
        See Also:
        AWS API Documentation
      • listServices

        public ListServicesResult listServices(ListServicesRequest request)

        Lists summary information for all the services that are associated with one or more namespaces.

        Specified by:
        listServices in interface AWSServiceDiscovery
        Parameters:
        listServicesRequest -
        Returns:
        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.
        See Also:
        AWS API Documentation
      • registerInstance

        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'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.

        Specified by:
        registerInstance in interface AWSServiceDiscovery
        Parameters:
        registerInstanceRequest -
        Returns:
        Result of the RegisterInstance operation returned by the service.
        Throws:
        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 quota on the number of resources.
        ServiceNotFoundException - No service exists with the specified ID.
        See Also:
        AWS API Documentation
      • tagResource

        public TagResourceResult tagResource(TagResourceRequest request)

        Adds one or more tags to the specified resource.

        Specified by:
        tagResource in interface AWSServiceDiscovery
        Parameters:
        tagResourceRequest -
        Returns:
        Result of the TagResource operation returned by the service.
        Throws:
        ResourceNotFoundException - The operation can't be completed because the resource was not found.
        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.
        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.
        See Also:
        AWS API Documentation
      • updateInstanceCustomHealthStatus

        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.

        Specified by:
        updateInstanceCustomHealthStatus in interface AWSServiceDiscovery
        Parameters:
        updateInstanceCustomHealthStatusRequest -
        Returns:
        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.
        ServiceNotFoundException - No service exists with the specified ID.
        CustomHealthNotFoundException - The health check for the instance that's specified by ServiceId and InstanceId isn't 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.
        See Also:
        AWS API Documentation
      • updateService

        public UpdateServiceResult updateService(UpdateServiceRequest request)

        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.

        Specified by:
        updateService in interface AWSServiceDiscovery
        Parameters:
        updateServiceRequest -
        Returns:
        Result of the UpdateService operation returned by the service.
        Throws:
        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.
        See Also:
        AWS API Documentation
      • getCachedResponseMetadata

        public 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. 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 the request.

        Specified by:
        getCachedResponseMetadata in interface AWSServiceDiscovery
        Parameters:
        request - The originally executed request
        Returns:
        The response metadata for the specified request, or null if none is available.
      • shutdown

        public void shutdown()
        Description copied from class: AmazonWebServiceClient
        Shuts down this client object, releasing any resources that might be held open. If this method is not invoked, resources may be leaked. Once a client has been shutdown, it should not be used to make any more requests.
        Specified by:
        shutdown in interface AWSServiceDiscovery
        Overrides:
        shutdown in class AmazonWebServiceClient
Skip navigation links
  • Detail:
  • Field |
  • Constr |
  • Method

AltStyle によって変換されたページ (->オリジナル) /