Gets the list of Batch supported Cloud Service VM sizes available at the given location.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/cloudServiceSkus?api-version=2024-02-01
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/cloudServiceSkus?maxresults={maxresults}&$filter={$filter}&api-version=2024-02-01
URI Parameters
Name |
In |
Required |
Type |
Description |
locationName
|
path |
True
|
string
|
The region for which to retrieve Batch service supported SKUs.
|
subscriptionId
|
path |
True
|
string
|
The Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000)
|
api-version
|
query |
True
|
string
|
The API version to be used with the HTTP request.
|
$filter
|
query |
|
string
|
OData filter expression. Valid properties for filtering are "familyName".
|
maxresults
|
query |
|
integer
int32
|
The maximum number of items to return in the response.
|
Responses
Name |
Type |
Description |
200 OK
|
SupportedSkusResult
|
The operation was successful. The response contains the Batch service supported Cloud Service VM sizes for the subscription in the specified location.
|
Other Status Codes
|
CloudError
|
Error response describing why the operation failed.
|
Security
azure_auth
Microsoft Entra OAuth 2.0 auth code flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
LocationListCloudServiceSkus
Sample Request
GET https://management.azure.com/subscriptions/subid/providers/Microsoft.Batch/locations/japaneast/cloudServiceSkus?api-version=2024-02-01
/**
* Samples for Location ListSupportedCloudServiceSkus.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationListCloudServiceSkus.json
*/
/**
* Sample code: LocationListCloudServiceSkus.
*
* @param manager Entry point to BatchManager.
*/
public static void locationListCloudServiceSkus(com.azure.resourcemanager.batch.BatchManager manager) {
manager.locations().listSupportedCloudServiceSkus("japaneast", null, null, 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.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python location_list_cloud_service_skus.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 = BatchManagementClient(
credential=DefaultAzureCredential(),
subscription_id="subid",
)
response = client.location.list_supported_cloud_service_skus(
location_name="japaneast",
)
for item in response:
print(item)
# x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationListCloudServiceSkus.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 armbatch_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/batch/armbatch/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationListCloudServiceSkus.json
func ExampleLocationClient_NewListSupportedCloudServiceSKUsPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armbatch.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewLocationClient().NewListSupportedCloudServiceSKUsPager("japaneast", &armbatch.LocationClientListSupportedCloudServiceSKUsOptions{Maxresults: nil,
Filter: 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.SupportedSKUsResult = armbatch.SupportedSKUsResult{
// Value: []*armbatch.SupportedSKU{
// {
// Name: to.Ptr("Small"),
// Capabilities: []*armbatch.SKUCapability{
// {
// Name: to.Ptr("MaxResourceVolumeMB"),
// Value: to.Ptr("20480"),
// },
// {
// Name: to.Ptr("vCPUs"),
// Value: to.Ptr("1"),
// },
// {
// Name: to.Ptr("HyperVGenerations"),
// Value: to.Ptr("V1"),
// },
// {
// Name: to.Ptr("MemoryGB"),
// Value: to.Ptr("0.75"),
// },
// {
// Name: to.Ptr("LowPriorityCapable"),
// Value: to.Ptr("False"),
// },
// {
// Name: to.Ptr("vCPUsAvailable"),
// Value: to.Ptr("1"),
// },
// {
// Name: to.Ptr("EphemeralOSDiskSupported"),
// Value: to.Ptr("False"),
// }},
// FamilyName: to.Ptr("standardA0_A7Family"),
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { BatchManagementClient } = require("@azure/arm-batch");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets the list of Batch supported Cloud Service VM sizes available at the given location.
*
* @summary Gets the list of Batch supported Cloud Service VM sizes available at the given location.
* x-ms-original-file: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationListCloudServiceSkus.json
*/
async function locationListCloudServiceSkus() {
const subscriptionId = process.env["BATCH_SUBSCRIPTION_ID"] || "subid";
const locationName = "japaneast";
const credential = new DefaultAzureCredential();
const client = new BatchManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.location.listSupportedCloudServiceSkus(locationName)) {
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 Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Batch;
using Azure.ResourceManager.Batch.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/batch/resource-manager/Microsoft.Batch/stable/2024-02-01/examples/LocationListCloudServiceSkus.json
// this example is just showing the usage of "Location_ListSupportedCloudServiceSkus" 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 SubscriptionResource created on azure
// for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource
string subscriptionId = "subid";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// invoke the operation and iterate over the result
AzureLocation locationName = new AzureLocation("japaneast");
await foreach (BatchSupportedSku item in subscriptionResource.GetBatchSupportedCloudServiceSkusAsync(locationName))
{
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
Sample Response
{
"value": [
{
"name": "Small",
"familyName": "standardA0_A7Family",
"capabilities": [
{
"name": "MaxResourceVolumeMB",
"value": "20480"
},
{
"name": "vCPUs",
"value": "1"
},
{
"name": "HyperVGenerations",
"value": "V1"
},
{
"name": "MemoryGB",
"value": "0.75"
},
{
"name": "LowPriorityCapable",
"value": "False"
},
{
"name": "vCPUsAvailable",
"value": "1"
},
{
"name": "EphemeralOSDiskSupported",
"value": "False"
}
]
}
]
}
Definitions
CloudError
An error response from the Batch service.
Name |
Type |
Description |
error
|
CloudErrorBody
|
The body of the error response.
|
CloudErrorBody
An error response from the Batch service.
Name |
Type |
Description |
code
|
string
|
An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
|
details
|
CloudErrorBody[]
|
A list of additional details about the error.
|
message
|
string
|
A message describing the error, intended to be suitable for display in a user interface.
|
target
|
string
|
The target of the particular error. For example, the name of the property in error.
|
SkuCapability
A SKU capability, such as the number of cores.
Name |
Type |
Description |
name
|
string
|
The name of the feature.
|
value
|
string
|
The value of the feature.
|
SupportedSku
Describes a Batch supported SKU.
Name |
Type |
Description |
batchSupportEndOfLife
|
string
|
The time when Azure Batch service will retire this SKU.
|
capabilities
|
SkuCapability[]
|
A collection of capabilities which this SKU supports.
|
familyName
|
string
|
The family name of the SKU.
|
name
|
string
|
The name of the SKU.
|
SupportedSkusResult
The Batch List supported SKUs operation response.
Name |
Type |
Description |
nextLink
|
string
|
The URL to use for getting the next set of results.
|
value
|
SupportedSku[]
|
The list of SKUs available for the Batch service in the location.
|