Discovers the increasing revision associated with an instance.
Parameters:
-
namespace_name
(NamespaceName)
–
The HttpName name of the namespace. The HttpName is found in the HttpProperties member of the Properties member of the namespace.
-
service_name
(ServiceName)
–
The name of the service that you specified when you registered the instance.
-
owner_account
(Optional[AWSAccountId], default:
None
)
–
The ID of the Amazon Web Services account that owns the namespace associated with the instance, as specified in the namespace ResourceOwner field. For instances associated with namespaces that are shared with your account, you must specify an OwnerAccount. For more information about shared namespaces, see Cross-account Cloud Map namespace sharing in the Cloud Map Developer Guide.
Raises:
-
InvalidInput
–
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.
-
NamespaceNotFound
–
No namespace exists with the specified ID.
-
RequestLimitExceeded
–
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.
-
ServiceNotFound
–
No service exists with the specified ID.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
Discover instances revision using owner account
Discovers the instances revision in a shared namespace by specifying the OwnerAccount parameter, useful when working with shared namespaces.
>>> client.discover_instances_revision(namespace_name='example-shared-namespace', service_name='shared-service', owner_account='123456789012')
To discover the revision for a registered instance
The following example discovers the revision ID for a registered instance.
>>> client.discover_instances_revision(namespace_name='example-namespace', service_name='example-service')
Source code in docs_src/capo_servicediscovery/_services/service_discovery.py
| def discover_instances_revision(
self,
namespace_name: "capo_servicediscovery.types.namespace_name.NamespaceName",
service_name: "capo_servicediscovery.types.service_name.ServiceName",
*,
config_overrides: Optional[ServiceDiscoveryClientConfig] = None,
owner_account: Optional[
"capo_servicediscovery.types.aws_account_id.AWSAccountId"
] = None,
) -> "capo_servicediscovery.types.discover_instances_revision_response.DiscoverInstancesRevisionResponse":
"""<p>Discovers the increasing revision associated with an instance.</p>
Args:
namespace_name: <p>The <code>HttpName</code> name of the namespace. The <code>HttpName</code> is found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace.</p>
service_name: <p>The name of the service that you specified when you registered the instance.</p>
owner_account: <p>The ID of the Amazon Web Services account that owns the namespace associated with the instance, as specified in the namespace <code>ResourceOwner</code> field. For instances associated with namespaces that are shared with your account, you must specify an <code>OwnerAccount</code>. For more information about shared namespaces, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html">Cross-account Cloud Map namespace sharing</a> in the <i>Cloud Map Developer Guide</i>.</p>
Raises:
capo_servicediscovery.errors.invalid_input.InvalidInput: <p>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.</p>
capo_servicediscovery.errors.namespace_not_found.NamespaceNotFound: <p>No namespace exists with the specified ID.</p>
capo_servicediscovery.errors.request_limit_exceeded.RequestLimitExceeded: <p>The operation can't be completed because you've reached the quota for the number of requests. For more information, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/throttling.html">Cloud Map API request throttling quota</a> in the <i>Cloud Map Developer Guide</i>.</p>
capo_servicediscovery.errors.service_not_found.ServiceNotFound: <p>No service exists with the specified ID.</p>
capo_servicediscovery.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
Discover instances revision using owner account
Discovers the instances revision in a shared namespace by specifying the OwnerAccount parameter, useful when working with shared namespaces.
>>> client.discover_instances_revision(namespace_name='example-shared-namespace', service_name='shared-service', owner_account='123456789012')
To discover the revision for a registered instance
The following example discovers the revision ID for a registered instance.
>>> client.discover_instances_revision(namespace_name='example-namespace', service_name='example-service')
"""
def _handler(
req: "OperationRequest[capo_servicediscovery.types.discover_instances_revision_request.DiscoverInstancesRevisionRequest]",
) -> OperationResponse[
"capo_servicediscovery.types.discover_instances_revision_response.DiscoverInstancesRevisionResponse"
]:
import capo_servicediscovery._operations.route53_auto_naming_v20170314.discover_instances_revision
output, http_response = (
capo_servicediscovery._operations.route53_auto_naming_v20170314.discover_instances_revision.discover_instances_revision(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DiscoverInstancesRevision")
)
input_: capo_servicediscovery.types.discover_instances_revision_request.DiscoverInstancesRevisionRequest = {
"namespace_name": namespace_name,
"service_name": service_name,
}
if owner_account is not None:
input_["owner_account"] = owner_account
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|