getServiceAttributes
inline suspend fun ServiceDiscoveryClient.getServiceAttributes(crossinline block: GetServiceAttributesRequest.Builder.() -> Unit): GetServiceAttributesResponse
Returns the attributes associated with a specified service.
Samples
fun main() {
//sampleStart
// Gets service attributes using a service ARN instead of service ID, useful when working with shared
// namespaces. Shows attributes for a service created by a sharee in a namespace owned by another account.
val resp = serviceDiscoveryClient.getServiceAttributes {
serviceId = "arn:aws:servicediscovery:us-west-2:123456789012:service/srv-abcd1234xmpl5678"
}
//sampleEnd
}
fun main() {
//sampleStart
// This example gets the attributes for a specified service.
val resp = serviceDiscoveryClient.getServiceAttributes {
serviceId = "srv-e4anhexample0004"
}
//sampleEnd
}