get_instance
¶
get_instance(
service_id: Arn,
instance_id: ResourceId,
*,
config_overrides: Optional[ServiceDiscoveryClientConfig] = None,
) -> GetInstanceResponse
Gets information about a specified instance.
Parameters:
-
service_id(Arn) –The ID or Amazon Resource Name (ARN) of the service that the instance is associated with. For services created in a shared namespace, specify the service ARN. For more information about shared namespaces, see Cross-account Cloud Map namespace sharing in the Cloud Map Developer Guide.
-
instance_id(ResourceId) –The ID of the instance that you want to get information about.
Raises:
-
InstanceNotFound–No instance exists with the specified ID, or the instance was recently registered, and information about the instance hasn't propagated yet.
-
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.
-
ServiceNotFound–No service exists with the specified ID.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
GetInstance example This example gets information about a specified instance.
>>> client.get_instance(instance_id='i-abcd1234', service_id='srv-e4anhexample0004')
Get instance details using service ARN for shared namespace
This example gets information about an instance using a service ARN instead of service ID. This is useful for listing instances associated with shared namespaces.
>>> client.get_instance(instance_id='i-abcd1234', service_id='arn:aws:servicediscovery:us-west-2:123456789012:service/srv-e4anhexample0004')
Source code in docs_src/capo_servicediscovery/_services/service_discovery.py
1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 | |