Obtém SKUs disponíveis para Gestão de API serviço
Obtém todos os SKU disponíveis para um determinado serviço Gestão de API
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/skus?api-version=2021-08-01
Parâmetros do URI
Name |
Em |
Necessário |
Tipo |
Description |
resourceGroupName
|
path |
True
|
string
|
O nome do grupo de recursos.
|
serviceName
|
path |
True
|
string
|
O nome do serviço Gestão de API.
Padrão Regex: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$
|
subscriptionId
|
path |
True
|
string
|
Credenciais de subscrição que identificam exclusivamente a subscrição do Microsoft Azure. O ID da subscrição faz parte do URI para cada chamada de serviço.
|
api-version
|
query |
True
|
string
|
Versão da API a utilizar com o pedido de cliente.
|
Respostas
Name |
Tipo |
Description |
200 OK
|
ResourceSkuResults
|
Com êxito. A resposta descreve a lista de SKUs.
|
Other Status Codes
|
ErrorResponse
|
Resposta de erro que descreve o motivo pela qual a operação falhou.
|
Segurança
azure_auth
Fluxo OAuth2 do Azure Active Directory.
Tipo:
oauth2
Fluxo:
implicit
URL de Autorização:
https://login.microsoftonline.com/common/oauth2/authorize
Âmbitos
Name |
Description |
user_impersonation
|
representar a sua conta de utilizador
|
Exemplos
ApiManagementListSKUs-Consumption
Pedido de amostra
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/skus?api-version=2021-08-01
import com.azure.core.util.Context;
/** Samples for ApiManagementServiceSkus ListAvailableServiceSkus. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Consumption.json
*/
/**
* Sample code: ApiManagementListSKUs-Consumption.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementListSKUsConsumption(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager.apiManagementServiceSkus().listAvailableServiceSkus("rg1", "apimService1", 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.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_list_sk_us_consumption.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 = ApiManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.api_management_service_skus.list_available_service_skus(
resource_group_name="rg1",
service_name="apimService1",
)
for item in response:
print(item)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Consumption.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 armapimanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Consumption.json
func ExampleServiceSKUsClient_NewListAvailableServiceSKUsPager_apiManagementListSkUsConsumption() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewServiceSKUsClient().NewListAvailableServiceSKUsPager("rg1", "apimService1", 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.ResourceSKUResults = armapimanagement.ResourceSKUResults{
// Value: []*armapimanagement.ResourceSKUResult{
// {
// ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
// SKU: &armapimanagement.ResourceSKU{
// Name: to.Ptr(armapimanagement.SKUTypeConsumption),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ApiManagementClient } = require("@azure/arm-apimanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets all available SKU for a given API Management service
*
* @summary Gets all available SKU for a given API Management service
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Consumption.json
*/
async function apiManagementListSkUsConsumption() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.apiManagementServiceSkus.listAvailableServiceSkus(
resourceGroupName,
serviceName
)) {
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
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.ApiManagement;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Consumption.json
// this example is just showing the usage of "ApiManagementServiceSkus_ListAvailableServiceSkus" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ApiManagementServiceResource created on azure
// for more information of creating ApiManagementServiceResource, please refer to the document of ApiManagementServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string serviceName = "apimService1";
ResourceIdentifier apiManagementServiceResourceId = ApiManagementServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serviceName);
ApiManagementServiceResource apiManagementService = client.GetApiManagementServiceResource(apiManagementServiceResourceId);
// invoke the operation and iterate over the result
await foreach (AvailableApiManagementServiceSkuResult item in apiManagementService.GetAvailableApiManagementServiceSkusAsync())
{
Console.WriteLine($"Succeeded: {item}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"value": [
{
"resourceType": "Microsoft.ApiManagement/service",
"sku": {
"name": "Consumption"
},
"capacity": null
}
],
"nextLink": null
}
ApiManagementListSKUs-Dedicated
Pedido de amostra
GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/skus?api-version=2021-08-01
import com.azure.core.util.Context;
/** Samples for ApiManagementServiceSkus ListAvailableServiceSkus. */
public final class Main {
/*
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Dedicated.json
*/
/**
* Sample code: ApiManagementListSKUs-Dedicated.
*
* @param manager Entry point to ApiManagementManager.
*/
public static void apiManagementListSKUsDedicated(
com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {
manager.apiManagementServiceSkus().listAvailableServiceSkus("rg1", "apimService1", 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.apimanagement import ApiManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-apimanagement
# USAGE
python api_management_list_sk_us_dedicated.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 = ApiManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.api_management_service_skus.list_available_service_skus(
resource_group_name="rg1",
service_name="apimService1",
)
for item in response:
print(item)
# x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Dedicated.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 armapimanagement_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Dedicated.json
func ExampleServiceSKUsClient_NewListAvailableServiceSKUsPager_apiManagementListSkUsDedicated() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapimanagement.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewServiceSKUsClient().NewListAvailableServiceSKUsPager("rg1", "apimService1", 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.ResourceSKUResults = armapimanagement.ResourceSKUResults{
// Value: []*armapimanagement.ResourceSKUResult{
// {
// Capacity: &armapimanagement.ResourceSKUCapacity{
// Default: to.Ptr[int32](1),
// Maximum: to.Ptr[int32](1),
// Minimum: to.Ptr[int32](1),
// ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeNone),
// },
// ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
// SKU: &armapimanagement.ResourceSKU{
// Name: to.Ptr(armapimanagement.SKUTypeDeveloper),
// },
// },
// {
// Capacity: &armapimanagement.ResourceSKUCapacity{
// Default: to.Ptr[int32](1),
// Maximum: to.Ptr[int32](2),
// Minimum: to.Ptr[int32](1),
// ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeManual),
// },
// ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
// SKU: &armapimanagement.ResourceSKU{
// Name: to.Ptr(armapimanagement.SKUTypeBasic),
// },
// },
// {
// Capacity: &armapimanagement.ResourceSKUCapacity{
// Default: to.Ptr[int32](1),
// Maximum: to.Ptr[int32](4),
// Minimum: to.Ptr[int32](1),
// ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeAutomatic),
// },
// ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
// SKU: &armapimanagement.ResourceSKU{
// Name: to.Ptr(armapimanagement.SKUTypeStandard),
// },
// },
// {
// Capacity: &armapimanagement.ResourceSKUCapacity{
// Default: to.Ptr[int32](1),
// Maximum: to.Ptr[int32](10),
// Minimum: to.Ptr[int32](1),
// ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeAutomatic),
// },
// ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
// SKU: &armapimanagement.ResourceSKU{
// Name: to.Ptr(armapimanagement.SKUTypePremium),
// },
// },
// {
// Capacity: &armapimanagement.ResourceSKUCapacity{
// Default: to.Ptr[int32](1),
// Maximum: to.Ptr[int32](1),
// Minimum: to.Ptr[int32](1),
// ScaleType: to.Ptr(armapimanagement.ResourceSKUCapacityScaleTypeAutomatic),
// },
// ResourceType: to.Ptr("Microsoft.ApiManagement/service"),
// SKU: &armapimanagement.ResourceSKU{
// Name: to.Ptr(armapimanagement.SKUTypeIsolated),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ApiManagementClient } = require("@azure/arm-apimanagement");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets all available SKU for a given API Management service
*
* @summary Gets all available SKU for a given API Management service
* x-ms-original-file: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Dedicated.json
*/
async function apiManagementListSkUsDedicated() {
const subscriptionId = process.env["APIMANAGEMENT_SUBSCRIPTION_ID"] || "subid";
const resourceGroupName = process.env["APIMANAGEMENT_RESOURCE_GROUP"] || "rg1";
const serviceName = "apimService1";
const credential = new DefaultAzureCredential();
const client = new ApiManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.apiManagementServiceSkus.listAvailableServiceSkus(
resourceGroupName,
serviceName
)) {
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
using System;
using System.Threading.Tasks;
using System.Xml;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.ApiManagement;
using Azure.ResourceManager.ApiManagement.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSKUs-Dedicated.json
// this example is just showing the usage of "ApiManagementServiceSkus_ListAvailableServiceSkus" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ApiManagementServiceResource created on azure
// for more information of creating ApiManagementServiceResource, please refer to the document of ApiManagementServiceResource
string subscriptionId = "subid";
string resourceGroupName = "rg1";
string serviceName = "apimService1";
ResourceIdentifier apiManagementServiceResourceId = ApiManagementServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serviceName);
ApiManagementServiceResource apiManagementService = client.GetApiManagementServiceResource(apiManagementServiceResourceId);
// invoke the operation and iterate over the result
await foreach (AvailableApiManagementServiceSkuResult item in apiManagementService.GetAvailableApiManagementServiceSkusAsync())
{
Console.WriteLine($"Succeeded: {item}");
}
Console.WriteLine($"Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Resposta da amostra
{
"value": [
{
"resourceType": "Microsoft.ApiManagement/service",
"sku": {
"name": "Developer"
},
"capacity": {
"minimum": 1,
"maximum": 1,
"default": 1,
"scaleType": "none"
}
},
{
"resourceType": "Microsoft.ApiManagement/service",
"sku": {
"name": "Basic"
},
"capacity": {
"minimum": 1,
"maximum": 2,
"default": 1,
"scaleType": "manual"
}
},
{
"resourceType": "Microsoft.ApiManagement/service",
"sku": {
"name": "Standard"
},
"capacity": {
"minimum": 1,
"maximum": 4,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.ApiManagement/service",
"sku": {
"name": "Premium"
},
"capacity": {
"minimum": 1,
"maximum": 10,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.ApiManagement/service",
"sku": {
"name": "Isolated"
},
"capacity": {
"minimum": 1,
"maximum": 1,
"default": 1,
"scaleType": "automatic"
}
}
],
"nextLink": null
}
Definições
ErrorFieldContract
Contrato de Campo de Erro.
Name |
Tipo |
Description |
code
|
string
|
Código de erro de nível de propriedade.
|
message
|
string
|
Representação legível por humanos do erro ao nível da propriedade.
|
target
|
string
|
Nome da propriedade.
|
ErrorResponse
Resposta do Erro.
Name |
Tipo |
Description |
error.code
|
string
|
Código de erro definido pelo serviço. Este código serve como um subestado para o código de erro HTTP especificado na resposta.
|
error.details
|
ErrorFieldContract[]
|
A lista de campos inválidos enviados no pedido, em caso de erro de validação.
|
error.message
|
string
|
Representação legível por humanos do erro.
|
ResourceSku
Descreve um SKU de Gestão de API disponível.
Name |
Tipo |
Description |
name
|
SkuType
|
Nome do SKU.
|
ResourceSkuCapacity
Descreve as informações de dimensionamento de um SKU.
Name |
Tipo |
Description |
default
|
integer
|
A capacidade predefinida.
|
maximum
|
integer
|
A capacidade máxima que pode ser definida.
|
minimum
|
integer
|
A capacidade mínima.
|
scaleType
|
ResourceSkuCapacityScaleType
|
O tipo de dimensionamento aplicável ao SKU.
|
ResourceSkuCapacityScaleType
O tipo de dimensionamento aplicável ao SKU.
Name |
Tipo |
Description |
automatic
|
string
|
Tipo de dimensionamento suportado automático.
|
manual
|
string
|
Manual de tipo de dimensionamento suportado.
|
none
|
string
|
O dimensionamento não é suportado.
|
ResourceSkuResult
Descreve um SKU do serviço Gestão de API disponível.
Name |
Tipo |
Description |
capacity
|
ResourceSkuCapacity
|
Especifica o número de unidades de Gestão de API.
|
resourceType
|
string
|
O tipo de recurso a que o SKU se aplica.
|
sku
|
ResourceSku
|
Especifica Gestão de API SKU.
|
ResourceSkuResults
A resposta da operação skUs do serviço Gestão de API.
Name |
Tipo |
Description |
nextLink
|
string
|
O URI para obter a página seguinte dos SKU do serviço Gestão de API.
|
value
|
ResourceSkuResult[]
|
A lista de skUs disponíveis para o serviço.
|
SkuType
Nome do SKU.
Name |
Tipo |
Description |
Basic
|
string
|
SKU Básico da Gestão de API.
|
Consumption
|
string
|
SKU de Consumo da Gestão de API.
|
Developer
|
string
|
SKU de Programador da Gestão de API.
|
Isolated
|
string
|
SKU isolado da Gestão de API.
|
Premium
|
string
|
SKU Premium da Gestão de API.
|
Standard
|
string
|
SKU Standard da Gestão de API.
|