Kontrollera kvottillgänglighet
Kontrollera om en kvot är tillgänglig.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/checkQuotaAvailability?api-version=2023-07-01
URI-parametrar
Name |
I |
Obligatorisk |
Typ |
Description |
location
|
path |
True
|
string
|
Namnet på Azure-regionen.
|
subscriptionId
|
path |
True
|
string
uuid
|
ID för målprenumerationen. Värdet måste vara ett UUID.
|
api-version
|
query |
True
|
string
|
Den API-version som ska användas för den här åtgärden.
|
Begärandetext
Name |
Obligatorisk |
Typ |
Description |
name
|
True
|
string
|
Namnet på resursen som ska verifieras.
|
resourceGroup
|
True
|
string
|
Namn på resursgrupp.
|
type
|
True
|
CheckQuotaNameResourceTypes
|
Resurstyp som används för verifiering.
|
Svar
Säkerhet
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
personifiera ditt användarkonto
|
Exempel
CheckQuotaAvailability
Sample Request
POST https://management.azure.com/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/providers/Microsoft.NetApp/locations/eastus/checkQuotaAvailability?api-version=2023-07-01
{
"name": "resource1",
"type": "Microsoft.NetApp/netAppAccounts",
"resourceGroup": "myRG"
}
import com.azure.resourcemanager.netapp.models.CheckQuotaNameResourceTypes;
import com.azure.resourcemanager.netapp.models.QuotaAvailabilityRequest;
/**
* Samples for NetAppResource CheckQuotaAvailability.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-07-01/examples/CheckQuotaAvailability.json
*/
/**
* Sample code: CheckQuotaAvailability.
*
* @param manager Entry point to NetAppFilesManager.
*/
public static void checkQuotaAvailability(com.azure.resourcemanager.netapp.NetAppFilesManager manager) {
manager.netAppResources().checkQuotaAvailabilityWithResponse("eastus",
new QuotaAvailabilityRequest().withName("resource1")
.withType(CheckQuotaNameResourceTypes.MICROSOFT_NET_APP_NET_APP_ACCOUNTS).withResourceGroup("myRG"),
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
package armnetapp_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/netapp/armnetapp/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-07-01/examples/CheckQuotaAvailability.json
func ExampleResourceClient_CheckQuotaAvailability() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armnetapp.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewResourceClient().CheckQuotaAvailability(ctx, "eastus", armnetapp.QuotaAvailabilityRequest{
Name: to.Ptr("resource1"),
Type: to.Ptr(armnetapp.CheckQuotaNameResourceTypesMicrosoftNetAppNetAppAccounts),
ResourceGroup: to.Ptr("myRG"),
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.CheckAvailabilityResponse = armnetapp.CheckAvailabilityResponse{
// IsAvailable: to.Ptr(true),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { NetAppManagementClient } = require("@azure/arm-netapp");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Check if a quota is available.
*
* @summary Check if a quota is available.
* x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-07-01/examples/CheckQuotaAvailability.json
*/
async function checkQuotaAvailability() {
const subscriptionId =
process.env["NETAPP_SUBSCRIPTION_ID"] || "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9";
const location = "eastus";
const name = "resource1";
const typeParam = "Microsoft.NetApp/netAppAccounts";
const resourceGroup = "myRG";
const credential = new DefaultAzureCredential();
const client = new NetAppManagementClient(credential, subscriptionId);
const result = await client.netAppResource.checkQuotaAvailability(
location,
name,
typeParam,
resourceGroup,
);
console.log(result);
}
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;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.NetApp;
using Azure.ResourceManager.NetApp.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-07-01/examples/CheckQuotaAvailability.json
// this example is just showing the usage of "NetAppResource_CheckQuotaAvailability" 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 = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9";
ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
// invoke the operation
AzureLocation location = new AzureLocation("eastus");
NetAppQuotaAvailabilityContent content = new NetAppQuotaAvailabilityContent("resource1", NetAppQuotaAvailabilityResourceType.MicrosoftNetAppNetAppAccounts, "myRG");
NetAppCheckAvailabilityResult result = await subscriptionResource.CheckNetAppQuotaAvailabilityAsync(location, content);
Console.WriteLine($"Succeeded: {result}");
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
{
"isAvailable": true
}
Definitioner
CheckAvailabilityResponse
Information om tillgänglighet för en resurs.
Name |
Typ |
Description |
isAvailable
|
boolean
|
true anger att namnet är giltigt och tillgängligt. false anger att namnet är ogiltigt, otillgängligt eller både och.
|
message
|
string
|
Om orsak == är ogiltig anger du orsaken till att det angivna namnet är ogiltigt och anger kraven för resursnamngivning så att användaren kan välja ett giltigt namn. Om orsak == RedanExisterar förklarar du att resursnamnet redan används och instruerar dem att välja ett annat namn.
|
reason
|
InAvailabilityReasonType
|
Invalid anger att det angivna namnet inte matchar Azure App Service namngivningskrav. AlreadyExists anger att namnet redan används och därför inte är tillgängligt.
|
CheckQuotaNameResourceTypes
Resurstyp som används för verifiering.
Name |
Typ |
Description |
Microsoft.NetApp/netAppAccounts
|
string
|
|
Microsoft.NetApp/netAppAccounts/capacityPools
|
string
|
|
Microsoft.NetApp/netAppAccounts/capacityPools/volumes
|
string
|
|
Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots
|
string
|
|
ErrorAdditionalInfo
Ytterligare information om resurshanteringsfelet.
Name |
Typ |
Description |
info
|
object
|
Ytterligare information.
|
type
|
string
|
Den ytterligare informationstypen.
|
ErrorDetail
Felinformationen.
Name |
Typ |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
Ytterligare information om felet.
|
code
|
string
|
Felkoden.
|
details
|
ErrorDetail[]
|
Felinformationen.
|
message
|
string
|
Felmeddelandet.
|
target
|
string
|
Felmålet.
|
ErrorResponse
Felsvar
InAvailabilityReasonType
Invalid
anger att det angivna namnet inte matchar Azure App Service namngivningskrav. AlreadyExists
anger att namnet redan används och därför inte är tillgängligt.
Name |
Typ |
Description |
AlreadyExists
|
string
|
|
Invalid
|
string
|
|
QuotaAvailabilityRequest
Begäran om innehåll för begäran om kvottillgänglighet.
Name |
Typ |
Description |
name
|
string
|
Namnet på resursen som ska verifieras.
|
resourceGroup
|
string
|
Namn på resursgrupp.
|
type
|
CheckQuotaNameResourceTypes
|
Resurstyp som används för verifiering.
|