ServiceDiscovery class

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.

Constructors

ServiceDiscovery({required String region, AwsClientCredentials? credentials, AwsClientCredentialsProvider? credentialsProvider, Client? client, String? endpointUrl})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Closes the internal HTTP client if none was provided at creation. If a client was passed as a constructor argument, this becomes a noop.
createHttpNamespace({required String name, String? creatorRequestId, String? description, List<Tag>? tags}) Future<CreateHttpNamespaceResponse>
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.
createPrivateDnsNamespace({required String name, required String vpc, String? creatorRequestId, String? description, PrivateDnsNamespaceProperties? properties, List<Tag>? tags}) Future<CreatePrivateDnsNamespaceResponse>
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.
createPublicDnsNamespace({required String name, String? creatorRequestId, String? description, PublicDnsNamespaceProperties? properties, List<Tag>? tags}) Future<CreatePublicDnsNamespaceResponse>
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.
createService({required String name, String? creatorRequestId, String? description, DnsConfig? dnsConfig, HealthCheckConfig? healthCheckConfig, HealthCheckCustomConfig? healthCheckCustomConfig, String? namespaceId, List<Tag>? tags, ServiceTypeOption? type}) Future<CreateServiceResponse>
Creates a service. This action defines the configuration for the following entities:
deleteNamespace({required String id}) Future<DeleteNamespaceResponse>
Deletes a namespace from the current account. If the namespace still contains one or more services, the request fails.
deleteService({required String id}) Future<void>
Deletes a specified service and all associated service attributes. If the service still contains one or more registered instances, the request fails.
deleteServiceAttributes({required List<String> attributes, required String serviceId}) Future<void>
Deletes specific attributes associated with a service.
deregisterInstance({required String instanceId, required String serviceId}) Future<DeregisterInstanceResponse>
Deletes the Amazon Route 53 DNS records and health check, if any, that Cloud Map created for the specified instance.
discoverInstances({required String namespaceName, required String serviceName, HealthStatusFilter? healthStatus, int? maxResults, Map<String, String>? optionalParameters, String? ownerAccount, Map<String, String>? queryParameters}) Future<DiscoverInstancesResponse>
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.
discoverInstancesRevision({required String namespaceName, required String serviceName, String? ownerAccount}) Future<DiscoverInstancesRevisionResponse>
Discovers the increasing revision associated with an instance.
getInstance({required String instanceId, required String serviceId}) Future<GetInstanceResponse>
Gets information about a specified instance.
getInstancesHealthStatus({required String serviceId, List<String>? instances, int? maxResults, String? nextToken}) Future<GetInstancesHealthStatusResponse>
Gets the current health status (Healthy, Unhealthy, or Unknown) of one or more instances that are associated with a specified service.
getNamespace({required String id}) Future<GetNamespaceResponse>
Gets information about a namespace.
getOperation({required String operationId, String? ownerAccount}) Future<GetOperationResponse>
Gets information about any operation that returns an operation ID in the response, such as a CreateHttpNamespace request.
getService({required String id}) Future<GetServiceResponse>
Gets the settings for a specified service.
getServiceAttributes({required String serviceId}) Future<GetServiceAttributesResponse>
Returns the attributes associated with a specified service.
listInstances({required String serviceId, int? maxResults, String? nextToken}) Future<ListInstancesResponse>
Lists summary information about the instances that you registered by using a specified service.
listNamespaces({List<NamespaceFilter>? filters, int? maxResults, String? nextToken}) Future<ListNamespacesResponse>
Lists summary information about the namespaces that were created by the current Amazon Web Services account and shared with the current Amazon Web Services account.
listOperations({List<OperationFilter>? filters, int? maxResults, String? nextToken}) Future<ListOperationsResponse>
Lists operations that match the criteria that you specify.
listServices({List<ServiceFilter>? filters, int? maxResults, String? nextToken}) Future<ListServicesResponse>
Lists summary information for all the services that are associated with one or more namespaces.
listTagsForResource({required String resourceARN}) Future<ListTagsForResourceResponse>
Lists tags for the specified resource.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerInstance({required Map<String, String> attributes, required String instanceId, required String serviceId, String? creatorRequestId}) Future<RegisterInstanceResponse>
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:
tagResource({required String resourceARN, required List<Tag> tags}) Future<void>
Adds one or more tags to the specified resource.
toString() String
A string representation of this object.
inherited
untagResource({required String resourceARN, required List<String> tagKeys}) Future<void>
Removes one or more tags from the specified resource.
updateHttpNamespace({required String id, required HttpNamespaceChange namespace, String? updaterRequestId}) Future<UpdateHttpNamespaceResponse>
Updates an HTTP namespace.
updateInstanceCustomHealthStatus({required String instanceId, required String serviceId, required CustomHealthStatus status}) Future<void>
Submits a request to change the health status of a custom health check to healthy or unhealthy.
updatePrivateDnsNamespace({required String id, required PrivateDnsNamespaceChange namespace, String? updaterRequestId}) Future<UpdatePrivateDnsNamespaceResponse>
Updates a private DNS namespace.
updatePublicDnsNamespace({required String id, required PublicDnsNamespaceChange namespace, String? updaterRequestId}) Future<UpdatePublicDnsNamespaceResponse>
Updates a public DNS namespace.
updateService({required String id, required ServiceChange service}) Future<UpdateServiceResponse>
Submits a request to perform the following operations:
updateServiceAttributes({required Map<String, String> attributes, required String serviceId}) Future<void>
Submits a request to update a specified service to add service-level attributes.

Operators

operator ==(Object other) bool
The equality operator.
inherited