ServiceDiscovery.Client.
get_namespace
(**kwargs)¶Gets information about a namespace.
See also: AWS API Documentation
Request Syntax
response = client.get_namespace(
Id='string'
)
[REQUIRED]
The ID of the namespace that you want to get information about.
{
'Namespace': {
'Id': 'string',
'Arn': 'string',
'Name': 'string',
'Type': 'DNS_PUBLIC'|'DNS_PRIVATE'|'HTTP',
'Description': 'string',
'ServiceCount': 123,
'Properties': {
'DnsProperties': {
'HostedZoneId': 'string',
'SOA': {
'TTL': 123
}
},
'HttpProperties': {
'HttpName': 'string'
}
},
'CreateDate': datetime(2015, 1, 1),
'CreatorRequestId': 'string'
}
}
Response Structure
A complex type that contains information about the specified namespace.
The ID of a namespace.
The Amazon Resource Name (ARN) that Cloud Map assigns to the namespace when you create it.
The name of the namespace, such as example.com
.
The type of the namespace. The methods for discovering instances depends on the value that you specify:
HTTP
Instances can be discovered only programmatically, using the Cloud Map DiscoverInstances
API.
DNS_PUBLIC
Instances can be discovered using public DNS queries and using the DiscoverInstances
API.
DNS_PRIVATE
Instances can be discovered using DNS queries in VPCs and using the DiscoverInstances
API.
The description that you specify for the namespace when you create it.
The number of services that are associated with the namespace.
A complex type that contains information that's specific to the type of the namespace.
A complex type that contains the ID for the Route 53 hosted zone that Cloud Map creates when you create a namespace.
The ID for the Route 53 hosted zone that Cloud Map creates when you create a namespace.
Start of Authority (SOA) record for the hosted zone.
The time to live (TTL) for purposes of negative caching.
A complex type that contains the name of an HTTP namespace.
The name of an HTTP namespace.
The date that the namespace was created, in Unix date/time format and Coordinated Universal Time (UTC). The value of CreateDate
is accurate to milliseconds. For example, the value 1516925490.087
represents Friday, January 26, 2018 12:11:30.087 AM.
A unique string that identifies the request and that allows failed requests to be retried without the risk of running an operation twice.
Exceptions
ServiceDiscovery.Client.exceptions.InvalidInput
ServiceDiscovery.Client.exceptions.NamespaceNotFound
Examples
This example gets information about a specified namespace.
response = client.get_namespace(
Id='ns-e4anhexample0004',
)
print(response)
Expected Output:
{
'Namespace': {
'Arn': 'arn:aws:servicediscovery:us-west-2: 123456789120:namespace/ns-e1tpmexample0001',
'CreateDate': datetime(2018, 11, 18, 21, 17, 12, 6, 322, 0),
'CreatorRequestId': 'example-creator-request-id-0001',
'Description': 'Example.com AWS Cloud Map HTTP Namespace',
'Id': 'ns-e1tpmexample0001',
'Name': 'example-http.com',
'Properties': {
'DnsProperties': {
},
'HttpProperties': {
'HttpName': 'example-http.com',
},
},
'Type': 'HTTP',
},
'ResponseMetadata': {
'...': '...',
},
}