你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Backup Policies - Get
Reference
Service:
Azure NetApp Files
API Version:
2023-05-01
Get a backup Policy
Get a particular backup Policy
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}?api-version=2023-05-01
URI Parameters
Name
In
Required
Type
Description
accountName
path
True
string
The name of the NetApp account
Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,127}$
backupPolicyName
path
True
string
Backup policy Name which uniquely identify backup policy.
resourceGroupName
path
True
string
The name of the resource group. The name is case insensitive.
GET https://management.azure.com/subscriptions/D633CC2E-722B-4AE1-B636-BBD9E4C60ED9/resourceGroups/myRG/providers/Microsoft.NetApp/netAppAccounts/account1/backupPolicies/backupPolicyName?api-version=2023-05-01
/** Samples for BackupPolicies Get. */
public final class Main {
/*
* x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/BackupPolicies_Get.json
*/
/**
* Sample code: Backups_Get.
*
* @param manager Entry point to NetAppFilesManager.
*/
public static void backupsGet(com.azure.resourcemanager.netapp.NetAppFilesManager manager) {
manager
.backupPolicies()
.getWithResponse("myRG", "account1", "backupPolicyName", com.azure.core.util.Context.NONE);
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.netapp import NetAppManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-netapp
# USAGE
python backup_policies_get.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 = NetAppManagementClient(
credential=DefaultAzureCredential(),
subscription_id="D633CC2E-722B-4AE1-B636-BBD9E4C60ED9",
)
response = client.backup_policies.get(
resource_group_name="myRG",
account_name="account1",
backup_policy_name="backupPolicyName",
)
print(response)
# x-ms-original-file: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/BackupPolicies_Get.json
if __name__ == "__main__":
main()
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;
// Generated from example definition: specification/netapp/resource-manager/Microsoft.NetApp/stable/2023-05-01/examples/BackupPolicies_Get.json
// this example is just showing the usage of "BackupPolicies_Get" 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 NetAppBackupPolicyResource created on azure
// for more information of creating NetAppBackupPolicyResource, please refer to the document of NetAppBackupPolicyResource
string subscriptionId = "D633CC2E-722B-4AE1-B636-BBD9E4C60ED9";
string resourceGroupName = "myRG";
string accountName = "account1";
string backupPolicyName = "backupPolicyName";
ResourceIdentifier netAppBackupPolicyResourceId = NetAppBackupPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, backupPolicyName);
NetAppBackupPolicyResource netAppBackupPolicy = client.GetNetAppBackupPolicyResource(netAppBackupPolicyResourceId);
// invoke the operation
NetAppBackupPolicyResource result = await netAppBackupPolicy.GetAsync();
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
NetAppBackupPolicyData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
A unique read-only string that changes whenever the resource is updated.
id
string
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}