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

# ServiceDiscoveryClient 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.

# Exceptions.exceptions usage example

client = boto3.client("servicediscovery")

try:
    do_something(client)
except (
    client.exceptions.ClientError,
    client.exceptions.CustomHealthNotFound,
    client.exceptions.DuplicateRequest,
    client.exceptions.InstanceNotFound,
    client.exceptions.InvalidInput,
    client.exceptions.NamespaceAlreadyExists,
    client.exceptions.NamespaceNotFound,
    client.exceptions.OperationNotFound,
    client.exceptions.RequestLimitExceeded,
    client.exceptions.ResourceInUse,
    client.exceptions.ResourceLimitExceeded,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ServiceAlreadyExists,
    client.exceptions.ServiceNotFound,
    client.exceptions.TooManyTagsException,
) as e:
    print(e)
# Exceptions.exceptions 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

# can_paginate 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

# close 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

# create_http_namespace 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
# create_http_namespace method usage example with argument unpacking

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

# create_private_dns_namespace 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
# create_private_dns_namespace method usage example with argument unpacking

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

# create_public_dns_namespace 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
# create_public_dns_namespace method usage example with argument unpacking

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

# create_service 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
# create_service method usage example with argument unpacking

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

# delete_namespace method definition

def delete_namespace(
    self,
    *,
    Id: str,
) -> DeleteNamespaceResponseTypeDef:  # (1)
    ...
  1. See DeleteNamespaceResponseTypeDef
# delete_namespace method usage example with argument unpacking

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

# delete_service method definition

def delete_service(
    self,
    *,
    Id: str,
) -> Dict[str, Any]:
    ...
# delete_service method usage example with argument unpacking

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

# deregister_instance method definition

def deregister_instance(
    self,
    *,
    ServiceId: str,
    InstanceId: str,
) -> DeregisterInstanceResponseTypeDef:  # (1)
    ...
  1. See DeregisterInstanceResponseTypeDef
# deregister_instance method usage example with argument unpacking

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

# discover_instances 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
# discover_instances method usage example with argument unpacking

kwargs: DiscoverInstancesRequestRequestTypeDef = {  # (1)
    "NamespaceName": ...,
    "ServiceName": ...,
}

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

discover_instances_revision#

Discovers the increasing revision associated with an instance.

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

# discover_instances_revision method definition

def discover_instances_revision(
    self,
    *,
    NamespaceName: str,
    ServiceName: str,
) -> DiscoverInstancesRevisionResponseTypeDef:  # (1)
    ...
  1. See DiscoverInstancesRevisionResponseTypeDef
# discover_instances_revision method usage example with argument unpacking

kwargs: DiscoverInstancesRevisionRequestRequestTypeDef = {  # (1)
    "NamespaceName": ...,
    "ServiceName": ...,
}

parent.discover_instances_revision(**kwargs)
  1. See DiscoverInstancesRevisionRequestRequestTypeDef

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

# generate_presigned_url 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

# get_instance method definition

def get_instance(
    self,
    *,
    ServiceId: str,
    InstanceId: str,
) -> GetInstanceResponseTypeDef:  # (1)
    ...
  1. See GetInstanceResponseTypeDef
# get_instance method usage example with argument unpacking

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

# get_instances_health_status method definition

def get_instances_health_status(
    self,
    *,
    ServiceId: str,
    Instances: Sequence[str] = ...,
    MaxResults: int = ...,
    NextToken: str = ...,
) -> GetInstancesHealthStatusResponseTypeDef:  # (1)
    ...
  1. See GetInstancesHealthStatusResponseTypeDef
# get_instances_health_status method usage example with argument unpacking

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

# get_namespace method definition

def get_namespace(
    self,
    *,
    Id: str,
) -> GetNamespaceResponseTypeDef:  # (1)
    ...
  1. See GetNamespaceResponseTypeDef
# get_namespace method usage example with argument unpacking

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 CreateHttpNamespace request.

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

# get_operation method definition

def get_operation(
    self,
    *,
    OperationId: str,
) -> GetOperationResponseTypeDef:  # (1)
    ...
  1. See GetOperationResponseTypeDef
# get_operation method usage example with argument unpacking

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.