Skip to content

ServiceDiscoveryClient

Index > ServiceDiscovery > ServiceDiscoveryClient

Auto-generated documentation for ServiceDiscovery type annotations stubs module mypy-boto3-servicediscovery.

ServiceDiscoveryClient

Type annotations and code completion for boto3.client("servicediscovery"). boto3 documentation

Usage example
from boto3.session import Session
from mypy_boto3_servicediscovery.client import ServiceDiscoveryClient

def get_servicediscovery_client() -> ServiceDiscoveryClient:
    return Session().client("servicediscovery")

Exceptions

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("servicediscovery").exceptions structure.

Usage example
client = boto3.client("servicediscovery")

try:
    do_something(client)
except (
    client.ClientError,
    client.CustomHealthNotFound,
    client.DuplicateRequest,
    client.InstanceNotFound,
    client.InvalidInput,
    client.NamespaceAlreadyExists,
    client.NamespaceNotFound,
    client.OperationNotFound,
    client.RequestLimitExceeded,
    client.ResourceInUse,
    client.ResourceLimitExceeded,
    client.ResourceNotFoundException,
    client.ServiceAlreadyExists,
    client.ServiceNotFound,
    client.TooManyTagsException,
) as e:
    print(e)
Type checking example
from mypy_boto3_servicediscovery.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods

can_paginate

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("servicediscovery").can_paginate method. boto3 documentation

Method definition
def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close

Closes underlying endpoint connections.

Type annotations and code completion for boto3.client("servicediscovery").close method. boto3 documentation

Method definition
def close(
    self,
) -> None:
    ...

create_http_namespace

Creates an HTTP namespace.

Type annotations and code completion for boto3.client("servicediscovery").create_http_namespace method. boto3 documentation

Method definition
def create_http_namespace(
    self,
    *,
    Name: str,
    CreatorRequestId: str = ...,
    Description: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
) -> CreateHttpNamespaceResponseTypeDef:  # (2)
    ...
  1. See TagTypeDef
  2. See CreateHttpNamespaceResponseTypeDef
Usage example with kwargs
kwargs: CreateHttpNamespaceRequestRequestTypeDef = {  # (1)
    "Name": ...,
}

parent.create_http_namespace(**kwargs)
  1. See CreateHttpNamespaceRequestRequestTypeDef

create_private_dns_namespace

Creates a private namespace based on DNS, which is visible only inside a specified Amazon VPC.

Type annotations and code completion for boto3.client("servicediscovery").create_private_dns_namespace method. boto3 documentation

Method definition
def create_private_dns_namespace(
    self,
    *,
    Name: str,
    Vpc: str,
    CreatorRequestId: str = ...,
    Description: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
    Properties: PrivateDnsNamespacePropertiesTypeDef = ...,  # (2)
) -> CreatePrivateDnsNamespaceResponseTypeDef:  # (3)
    ...
  1. See TagTypeDef
  2. See PrivateDnsNamespacePropertiesTypeDef
  3. See CreatePrivateDnsNamespaceResponseTypeDef
Usage example with kwargs
kwargs: CreatePrivateDnsNamespaceRequestRequestTypeDef = {  # (1)
    "Name": ...,
    "Vpc": ...,
}

parent.create_private_dns_namespace(**kwargs)
  1. See CreatePrivateDnsNamespaceRequestRequestTypeDef

create_public_dns_namespace

Creates a public namespace based on DNS, which is visible on the internet.

Type annotations and code completion for boto3.client("servicediscovery").create_public_dns_namespace method. boto3 documentation

Method definition
def create_public_dns_namespace(
    self,
    *,
    Name: str,
    CreatorRequestId: str = ...,
    Description: str = ...,
    Tags: Sequence[TagTypeDef] = ...,  # (1)
    Properties: PublicDnsNamespacePropertiesTypeDef = ...,  # (2)
) -> CreatePublicDnsNamespaceResponseTypeDef:  # (3)
    ...
  1. See TagTypeDef
  2. See PublicDnsNamespacePropertiesTypeDef
  3. See CreatePublicDnsNamespaceResponseTypeDef
Usage example with kwargs
kwargs: CreatePublicDnsNamespaceRequestRequestTypeDef = {  # (1)
    "Name": ...,
}

parent.create_public_dns_namespace(**kwargs)
  1. See CreatePublicDnsNamespaceRequestRequestTypeDef

create_service

Creates a service.

Type annotations and code completion for boto3.client("servicediscovery").create_service method. boto3 documentation

Method definition
def create_service(
    self,
    *,
    Name: str,
    NamespaceId: str = ...,
    CreatorRequestId: str = ...,
    Description: str = ...,
    DnsConfig: DnsConfigTypeDef = ...,  # (1)
    HealthCheckConfig: HealthCheckConfigTypeDef = ...,  # (2)
    HealthCheckCustomConfig: HealthCheckCustomConfigTypeDef = ...,  # (3)
    Tags: Sequence[TagTypeDef] = ...,  # (4)
    Type: ServiceTypeOptionType = ...,  # (5)
) -> CreateServiceResponseTypeDef:  # (6)
    ...
  1. See DnsConfigTypeDef
  2. See HealthCheckConfigTypeDef
  3. See HealthCheckCustomConfigTypeDef
  4. See TagTypeDef
  5. See ServiceTypeOptionType
  6. See CreateServiceResponseTypeDef
Usage example with kwargs
kwargs: CreateServiceRequestRequestTypeDef = {  # (1)
    "Name": ...,
}

parent.create_service(**kwargs)
  1. See CreateServiceRequestRequestTypeDef

delete_namespace

Deletes a namespace from the current account.

Type annotations and code completion for boto3.client("servicediscovery").delete_namespace method. boto3 documentation

Method definition
def delete_namespace(
    self,
    *,
    Id: str,
) -> DeleteNamespaceResponseTypeDef:  # (1)
    ...
  1. See DeleteNamespaceResponseTypeDef
Usage example with kwargs
kwargs: DeleteNamespaceRequestRequestTypeDef = {  # (1)
    "Id": ...,
}

parent.delete_namespace(**kwargs)
  1. See DeleteNamespaceRequestRequestTypeDef

delete_service

Deletes a specified service.

Type annotations and code completion for boto3.client("servicediscovery").delete_service method. boto3 documentation

Method definition
def delete_service(
    self,
    *,
    Id: str,
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: DeleteServiceRequestRequestTypeDef = {  # (1)
    "Id": ...,
}

parent.delete_service(**kwargs)
  1. See DeleteServiceRequestRequestTypeDef

deregister_instance

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

Type annotations and code completion for boto3.client("servicediscovery").deregister_instance method. boto3 documentation

Method definition
def deregister_instance(
    self,
    *,
    ServiceId: str,
    InstanceId: str,
) -> DeregisterInstanceResponseTypeDef:  # (1)
    ...
  1. See DeregisterInstanceResponseTypeDef
Usage example with kwargs
kwargs: DeregisterInstanceRequestRequestTypeDef = {  # (1)
    "ServiceId": ...,
    "InstanceId": ...,
}

parent.deregister_instance(**kwargs)
  1. See DeregisterInstanceRequestRequestTypeDef

discover_instances

Discovers registered instances for a specified namespace and service.

Type annotations and code completion for boto3.client("servicediscovery").discover_instances method. boto3 documentation

Method definition
def discover_instances(
    self,
    *,
    NamespaceName: str,
    ServiceName: str,
    MaxResults: int = ...,
    QueryParameters: Mapping[str, str] = ...,
    OptionalParameters: Mapping[str, str] = ...,
    HealthStatus: HealthStatusFilterType = ...,  # (1)
) -> DiscoverInstancesResponseTypeDef:  # (2)
    ...
  1. See HealthStatusFilterType
  2. See DiscoverInstancesResponseTypeDef
Usage example with kwargs
kwargs: DiscoverInstancesRequestRequestTypeDef = {  # (1)
    "NamespaceName": ...,
    "ServiceName": ...,
}

parent.discover_instances(**kwargs)
  1. See DiscoverInstancesRequestRequestTypeDef

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for boto3.client("servicediscovery").generate_presigned_url method. boto3 documentation

Method definition
def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_instance

Gets information about a specified instance.

Type annotations and code completion for boto3.client("servicediscovery").get_instance method. boto3 documentation

Method definition
def get_instance(
    self,
    *,
    ServiceId: str,
    InstanceId: str,
) -> GetInstanceResponseTypeDef:  # (1)
    ...
  1. See GetInstanceResponseTypeDef
Usage example with kwargs
kwargs: GetInstanceRequestRequestTypeDef = {  # (1)
    "ServiceId": ...,
    "InstanceId": ...,
}

parent.get_instance(**kwargs)
  1. See GetInstanceRequestRequestTypeDef

get_instances_health_status

Gets the current health status (Healthy , Unhealthy , or Unknown ) of one or more instances that are associated with a specified service.

Type annotations and code completion for boto3.client("servicediscovery").get_instances_health_status method. boto3 documentation

Method definition
def get_instances_health_status(
    self,
    *,
    ServiceId: str,
    Instances: Sequence[str] = ...,
    MaxResults: int = ...,
    NextToken: str = ...,
) -> GetInstancesHealthStatusResponseTypeDef:  # (1)
    ...
  1. See GetInstancesHealthStatusResponseTypeDef
Usage example with kwargs
kwargs: GetInstancesHealthStatusRequestRequestTypeDef = {  # (1)
    "ServiceId": ...,
}

parent.get_instances_health_status(**kwargs)
  1. See GetInstancesHealthStatusRequestRequestTypeDef

get_namespace

Gets information about a namespace.

Type annotations and code completion for boto3.client("servicediscovery").get_namespace method. boto3 documentation

Method definition
def get_namespace(
    self,
    *,
    Id: str,
) -> GetNamespaceResponseTypeDef:  # (1)
    ...
  1. See GetNamespaceResponseTypeDef
Usage example with kwargs
kwargs: GetNamespaceRequestRequestTypeDef = {  # (1)
    "Id": ...,
}

parent.get_namespace(**kwargs)
  1. See GetNamespaceRequestRequestTypeDef

get_operation

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

Type annotations and code completion for boto3.client("servicediscovery").get_operation method. boto3 documentation

Method definition
def get_operation(
    self,
    *,
    OperationId: str,
) -> GetOperationResponseTypeDef:  # (1)
    ...
  1. See GetOperationResponseTypeDef
Usage example with kwargs
kwargs: GetOperationRequestRequestTypeDef = {  # (1)
    "OperationId": ...,
}

parent.get_operation(**kwargs)
  1. See GetOperationRequestRequestTypeDef

get_service

Gets the settings for a specified service.

Type annotations and code completion for boto3.client("servicediscovery").get_service method. boto3 documentation

Method definition
def get_service(
    self,
    *,
    Id: str,
) -> GetServiceResponseTypeDef:  # (1)
    ...
  1. See GetServiceResponseTypeDef
Usage example with kwargs
kwargs: GetServiceRequestRequestTypeDef = {  # (1)
    "Id": ...,
}

parent.get_service(**kwargs)
  1. See GetServiceRequestRequestTypeDef

list_instances

Lists summary information about the instances that you registered by using a specified service.

Type annotations and code completion for boto3.client("servicediscovery").list_instances method. boto3 documentation

Method definition
def list_instances(
    self,
    *,
    ServiceId: str,
    NextToken: str = ...,
    MaxResults: int = ...,
) -> ListInstancesResponseTypeDef:  # (1)
    ...
  1. See ListInstancesResponseTypeDef
Usage example with kwargs
kwargs: ListInstancesRequestRequestTypeDef = {  # (1)
    "ServiceId": ...,
}

parent.list_instances(**kwargs)
  1. See ListInstancesRequestRequestTypeDef

list_namespaces

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

Type annotations and code completion for boto3.client("servicediscovery").list_namespaces method. boto3 documentation

Method definition
def list_namespaces(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
    Filters: Sequence[NamespaceFilterTypeDef] = ...,  # (1)
) -> ListNamespacesResponseTypeDef:  # (2)
    ...
  1. See NamespaceFilterTypeDef
  2. See ListNamespacesResponseTypeDef
Usage example with kwargs
kwargs: ListNamespacesRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_namespaces(**kwargs)
  1. See ListNamespacesRequestRequestTypeDef

list_operations

Lists operations that match the criteria that you specify.

Type annotations and code completion for boto3.client("servicediscovery").list_operations method. boto3 documentation

Method definition
def list_operations(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
    Filters: Sequence[OperationFilterTypeDef] = ...,  # (1)
) -> ListOperationsResponseTypeDef:  # (2)
    ...
  1. See OperationFilterTypeDef
  2. See ListOperationsResponseTypeDef
Usage example with kwargs
kwargs: ListOperationsRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_operations(**kwargs)
  1. See ListOperationsRequestRequestTypeDef

list_services

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

Type annotations and code completion for boto3.client("servicediscovery").list_services method. boto3 documentation

Method definition
def list_services(
    self,
    *,
    NextToken: str = ...,
    MaxResults: int = ...,
    Filters: Sequence[ServiceFilterTypeDef] = ...,  # (1)
) -> ListServicesResponseTypeDef:  # (2)
    ...
  1. See ServiceFilterTypeDef
  2. See ListServicesResponseTypeDef
Usage example with kwargs
kwargs: ListServicesRequestRequestTypeDef = {  # (1)
    "NextToken": ...,
}

parent.list_services(**kwargs)
  1. See ListServicesRequestRequestTypeDef

list_tags_for_resource

Lists tags for the specified resource.

Type annotations and code completion for boto3.client("servicediscovery").list_tags_for_resource method. boto3 documentation

Method definition
def list_tags_for_resource(
    self,
    *,
    ResourceARN: str,
) -> ListTagsForResourceResponseTypeDef:  # (1)
    ...
  1. See ListTagsForResourceResponseTypeDef
Usage example with kwargs
kwargs: ListTagsForResourceRequestRequestTypeDef = {  # (1)
    "ResourceARN": ...,
}

parent.list_tags_for_resource(**kwargs)
  1. See ListTagsForResourceRequestRequestTypeDef

register_instance

Creates or updates one or more records and, optionally, creates a health check based on the settings in a specified service.

Type annotations and code completion for boto3.client("servicediscovery").register_instance method. boto3 documentation

Method definition
def register_instance(
    self,
    *,
    ServiceId: str,
    InstanceId: str,
    Attributes: Mapping[str, str],
    CreatorRequestId: str = ...,
) -> RegisterInstanceResponseTypeDef:  # (1)
    ...
  1. See RegisterInstanceResponseTypeDef
Usage example with kwargs
kwargs: RegisterInstanceRequestRequestTypeDef = {  # (1)
    "ServiceId": ...,
    "InstanceId": ...,
    "Attributes": ...,
}

parent.register_instance(**kwargs)
  1. See RegisterInstanceRequestRequestTypeDef

tag_resource

Adds one or more tags to the specified resource.

Type annotations and code completion for boto3.client("servicediscovery").tag_resource method. boto3 documentation

Method definition
def tag_resource(
    self,
    *,
    ResourceARN: str,
    Tags: Sequence[TagTypeDef],  # (1)
) -> Dict[str, Any]:
    ...
  1. See TagTypeDef
Usage example with kwargs
kwargs: TagResourceRequestRequestTypeDef = {  # (1)
    "ResourceARN": ...,
    "Tags": ...,
}

parent.tag_resource(**kwargs)
  1. See TagResourceRequestRequestTypeDef

untag_resource

Removes one or more tags from the specified resource.

Type annotations and code completion for boto3.client("servicediscovery").untag_resource method. boto3 documentation

Method definition
def untag_resource(
    self,
    *,
    ResourceARN: str,
    TagKeys: Sequence[str],
) -> Dict[str, Any]:
    ...
Usage example with kwargs
kwargs: UntagResourceRequestRequestTypeDef = {  # (1)
    "ResourceARN": ...,
    "TagKeys": ...,
}

parent.untag_resource(**kwargs)
  1. See UntagResourceRequestRequestTypeDef

update_http_namespace

Updates an HTTP namespace.

Type annotations and code completion for boto3.client("servicediscovery").update_http_namespace method. boto3 documentation

Method definition
def update_http_namespace(
    self,
    *,
    Id: str,
    Namespace: HttpNamespaceChangeTypeDef,  # (1)
    UpdaterRequestId: str = ...,
) -> UpdateHttpNamespaceResponseTypeDef:  # (2)
    ...
  1. See HttpNamespaceChangeTypeDef
  2. See UpdateHttpNamespaceResponseTypeDef
Usage example with kwargs
kwargs: UpdateHttpNamespaceRequestRequestTypeDef = {  # (1)
    "Id": ...,
    "Namespace": ...,
}

parent.update_http_namespace(**kwargs)
  1. See UpdateHttpNamespaceRequestRequestTypeDef

update_instance_custom_health_status

Submits a request to change the health status of a custom health check to healthy or unhealthy.

Type annotations and code completion for boto3.client("servicediscovery").update_instance_custom_health_status method. boto3 documentation

Method definition
def update_instance_custom_health_status(
    self,
    *,
    ServiceId: str,
    InstanceId: str,
    Status: CustomHealthStatusType,  # (1)
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See CustomHealthStatusType
  2. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: UpdateInstanceCustomHealthStatusRequestRequestTypeDef = {  # (1)
    "ServiceId": ...,
    "InstanceId": ...,
    "Status": ...,
}

parent.update_instance_custom_health_status(**kwargs)
  1. See UpdateInstanceCustomHealthStatusRequestRequestTypeDef

update_private_dns_namespace

Updates a private DNS namespace.

Type annotations and code completion for boto3.client("servicediscovery").update_private_dns_namespace method. boto3 documentation

Method definition
def update_private_dns_namespace(
    self,
    *,
    Id: str,
    Namespace: PrivateDnsNamespaceChangeTypeDef,  # (1)
    UpdaterRequestId: str = ...,
) -> UpdatePrivateDnsNamespaceResponseTypeDef:  # (2)
    ...
  1. See PrivateDnsNamespaceChangeTypeDef
  2. See UpdatePrivateDnsNamespaceResponseTypeDef
Usage example with kwargs
kwargs: UpdatePrivateDnsNamespaceRequestRequestTypeDef = {  # (1)
    "Id": ...,
    "Namespace": ...,
}

parent.update_private_dns_namespace(**kwargs)
  1. See UpdatePrivateDnsNamespaceRequestRequestTypeDef

update_public_dns_namespace

Updates a public DNS namespace.

Type annotations and code completion for boto3.client("servicediscovery").update_public_dns_namespace method. boto3 documentation

Method definition
def update_public_dns_namespace(
    self,
    *,
    Id: str,
    Namespace: PublicDnsNamespaceChangeTypeDef,  # (1)
    UpdaterRequestId: str = ...,
) -> UpdatePublicDnsNamespaceResponseTypeDef:  # (2)
    ...
  1. See PublicDnsNamespaceChangeTypeDef
  2. See UpdatePublicDnsNamespaceResponseTypeDef
Usage example with kwargs
kwargs: UpdatePublicDnsNamespaceRequestRequestTypeDef = {  # (1)
    "Id": ...,
    "Namespace": ...,
}

parent.update_public_dns_namespace(**kwargs)
  1. See UpdatePublicDnsNamespaceRequestRequestTypeDef

update_service

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 .

Type annotations and code completion for boto3.client("servicediscovery").update_service method. boto3 documentation

Method definition
def update_service(
    self,
    *,
    Id: str,
    Service: ServiceChangeTypeDef,  # (1)
) -> UpdateServiceResponseTypeDef:  # (2)
    ...
  1. See ServiceChangeTypeDef
  2. See UpdateServiceResponseTypeDef
Usage example with kwargs
kwargs: UpdateServiceRequestRequestTypeDef = {  # (1)
    "Id": ...,
    "Service": ...,
}

parent.update_service(**kwargs)
  1. See UpdateServiceRequestRequestTypeDef

get_paginator

Type annotations and code completion for boto3.client("servicediscovery").get_paginator method with overloads.