按位置列出资源使用配额。
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages?api-version=2023-02-01
URI 参数
名称 |
在 |
必需 |
类型 |
说明 |
location
|
path |
True
|
string
|
位置,如“eastus”
|
subscriptionId
|
path |
True
|
string
|
获取唯一标识 Microsoft Azure 订阅的订阅 ID。 此订阅 ID 是每个服务调用的 URI 的一部分。
|
api-version
|
query |
True
|
string
|
客户端 API 版本。
|
响应
安全性
azure_auth
Azure Active Directory OAuth2 流
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
名称 |
说明 |
user_impersonation
|
模拟用户帐户
|
示例
Usages_List
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SignalRService/locations/eastus/usages?api-version=2023-02-01
/** Samples for Usages List. */
public final class Main {
/*
* x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/Usages_List.json
*/
/**
* Sample code: Usages_List.
*
* @param manager Entry point to SignalRManager.
*/
public static void usagesList(com.azure.resourcemanager.signalr.SignalRManager manager) {
manager.usages().list("eastus", com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.signalr import SignalRManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-signalr
# USAGE
python usages_list.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = SignalRManagementClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.usages.list(
location="eastus",
)
for item in response:
print(item)
# x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/Usages_List.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsignalr_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/signalr/armsignalr"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/signalr/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/Usages_List.json
func ExampleUsagesClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsignalr.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewUsagesClient().NewListPager("eastus", nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.UsageList = armsignalr.UsageList{
// Value: []*armsignalr.Usage{
// {
// Name: &armsignalr.UsageName{
// LocalizedValue: to.Ptr("Usage1"),
// Value: to.Ptr("Usage1"),
// },
// CurrentValue: to.Ptr[int64](0),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SignalRService/locations/eastus/usages/Usage1"),
// Limit: to.Ptr[int64](100),
// Unit: to.Ptr("Count"),
// },
// {
// Name: &armsignalr.UsageName{
// LocalizedValue: to.Ptr("Usage2"),
// Value: to.Ptr("Usage2"),
// },
// CurrentValue: to.Ptr[int64](0),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SignalRService/locations/eastus/usages/Usage2"),
// Limit: to.Ptr[int64](100),
// Unit: to.Ptr("Count"),
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { SignalRManagementClient } = require("@azure/arm-signalr");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to List resource usage quotas by location.
*
* @summary List resource usage quotas by location.
* x-ms-original-file: specification/signalr/resource-manager/Microsoft.SignalRService/stable/2023-02-01/examples/Usages_List.json
*/
async function usagesList() {
const subscriptionId =
process.env["SIGNALR_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const location = "eastus";
const credential = new DefaultAzureCredential();
const client = new SignalRManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.usages.list(location)) {
resArray.push(item);
}
console.log(resArray);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"value": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SignalRService/locations/eastus/usages/Usage1",
"currentValue": 0,
"limit": 100,
"name": {
"value": "Usage1",
"localizedValue": "Usage1"
},
"unit": "Count"
},
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.SignalRService/locations/eastus/usages/Usage2",
"currentValue": 0,
"limit": 100,
"name": {
"value": "Usage2",
"localizedValue": "Usage2"
},
"unit": "Count"
}
],
"nextLink": "https://management.azure.com/subscriptions/subid/providers/Microsoft.SignalRService/...pathToMoreResults..."
}
定义
ErrorAdditionalInfo
资源管理错误附加信息。
名称 |
类型 |
说明 |
info
|
object
|
其他信息。
|
type
|
string
|
其他信息类型。
|
ErrorDetail
错误详细信息。
ErrorResponse
错误响应
SignalRUsage
描述资源的特定使用情况的对象。
名称 |
类型 |
说明 |
currentValue
|
integer
|
使用配额的当前值。
|
id
|
string
|
完全限定的 ARM 资源 ID
|
limit
|
integer
|
使用配额允许的最大值。 如果没有限制,则此值将为 -1。
|
name
|
SignalRUsageName
|
包含名称和本地化值的可本地化 String 对象。
|
unit
|
string
|
表示使用配额的单位。 可能的值包括:Count、Bytes、Seconds、Percent、CountPerSecond、BytesPerSecond。
|
SignalRUsageList
对象,其中包含资源使用情况的数组和下一个集的可能链接。
名称 |
类型 |
说明 |
nextLink
|
string
|
客户端用于提取每个服务器端分页) (下一页的 URL。
它目前为 null,已添加供将来使用。
|
value
|
SignalRUsage[]
|
资源使用情况列表
|
SignalRUsageName
包含名称和本地化值的可本地化 String 对象。
名称 |
类型 |
说明 |
localizedValue
|
string
|
用法的本地化名称。
|
value
|
string
|
用法的标识符。
|