async def test_metrics_namespaces(): client = MetricsQueryClient(_credential()) async with client: response = client.list_metric_namespaces(os.environ['METRICS_RESOURCE_URI']) assert response is not None
async def list_namespaces(self): credential = DefaultAzureCredential() client = MetricsQueryClient(credential) metrics_uri = os.environ['METRICS_RESOURCE_URI'] async with client: response = client.list_metric_namespaces(metrics_uri) async for item in response: print(item.fully_qualified_namespace) print(item.type)
async def list_namespaces(): credential = ClientSecretCredential( client_id=os.environ['AZURE_CLIENT_ID'], client_secret=os.environ['AZURE_CLIENT_SECRET'], tenant_id=os.environ['AZURE_TENANT_ID']) client = MetricsQueryClient(credential) metrics_uri = os.environ['METRICS_RESOURCE_URI'] response = client.list_metric_namespaces(metrics_uri) async for item in response: print(item.metric_namespace_name) print(item.type)