Aktualizace konfiguraci zabezpečení trezoru.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig?api-version=2023-02-01
Parametry identifikátoru URI
Name |
V |
Vyžadováno |
Typ |
Description |
resourceGroupName
|
path |
True
|
string
|
Název skupiny prostředků, ve které se nachází trezor služby Recovery Services.
|
subscriptionId
|
path |
True
|
string
|
ID předplatného.
|
vaultName
|
path |
True
|
string
|
Název trezoru služby Recovery Services.
|
api-version
|
query |
True
|
string
|
Verze rozhraní API klienta.
|
Text požadavku
Name |
Typ |
Description |
eTag
|
string
|
Volitelná značka ETag.
|
location
|
string
|
Umístění prostředku.
|
properties
|
BackupResourceVaultConfig
|
BackupResourceVaultConfigResource – vlastnosti
|
tags
|
object
|
Značky prostředků.
|
Odpovědi
Zabezpečení
azure_auth
Tok Azure Active Directory OAuth2
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
zosobnit svůj uživatelský účet.
|
Příklady
Update Vault Security Config
Sample Request
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig?api-version=2023-02-01
{
"properties": {
"enhancedSecurityState": "Enabled",
"softDeleteFeatureState": "Enabled"
}
}
import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.BackupResourceVaultConfigResourceInner;
import com.azure.resourcemanager.recoveryservicesbackup.models.BackupResourceVaultConfig;
import com.azure.resourcemanager.recoveryservicesbackup.models.EnhancedSecurityState;
import com.azure.resourcemanager.recoveryservicesbackup.models.SoftDeleteFeatureState;
/** Samples for BackupResourceVaultConfigs Put. */
public final class Main {
/*
* x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/BackupResourceVaultConfigs_Put.json
*/
/**
* Sample code: Update Vault Security Config.
*
* @param manager Entry point to RecoveryServicesBackupManager.
*/
public static void updateVaultSecurityConfig(
com.azure.resourcemanager.recoveryservicesbackup.RecoveryServicesBackupManager manager) {
manager
.backupResourceVaultConfigs()
.putWithResponse(
"SwaggerTest",
"SwaggerTestRg",
new BackupResourceVaultConfigResourceInner()
.withProperties(
new BackupResourceVaultConfig()
.withEnhancedSecurityState(EnhancedSecurityState.ENABLED)
.withSoftDeleteFeatureState(SoftDeleteFeatureState.ENABLED)),
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.recoveryservicesbackup import RecoveryServicesBackupClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-recoveryservicesbackup
# USAGE
python backup_resource_vault_configs_put.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 = RecoveryServicesBackupClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.backup_resource_vault_configs.put(
vault_name="SwaggerTest",
resource_group_name="SwaggerTestRg",
parameters={"properties": {"enhancedSecurityState": "Enabled", "softDeleteFeatureState": "Enabled"}},
)
print(response)
# x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/BackupResourceVaultConfigs_Put.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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/BackupResourceVaultConfigs_Put.json
func ExampleBackupResourceVaultConfigsClient_Put() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armrecoveryservicesbackup.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewBackupResourceVaultConfigsClient().Put(ctx, "SwaggerTest", "SwaggerTestRg", armrecoveryservicesbackup.BackupResourceVaultConfigResource{
Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{
EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled),
SoftDeleteFeatureState: to.Ptr(armrecoveryservicesbackup.SoftDeleteFeatureStateEnabled),
},
}, 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.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{
// Name: to.Ptr("vaultconfig"),
// Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"),
// Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{
// EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled),
// SoftDeleteFeatureState: to.Ptr(armrecoveryservicesbackup.SoftDeleteFeatureStateEnabled),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { RecoveryServicesBackupClient } = require("@azure/arm-recoveryservicesbackup");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates vault security config.
*
* @summary Updates vault security config.
* x-ms-original-file: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/BackupResourceVaultConfigs_Put.json
*/
async function updateVaultSecurityConfig() {
const subscriptionId =
process.env["RECOVERYSERVICESBACKUP_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const vaultName = "SwaggerTest";
const resourceGroupName = process.env["RECOVERYSERVICESBACKUP_RESOURCE_GROUP"] || "SwaggerTestRg";
const parameters = {
properties: {
enhancedSecurityState: "Enabled",
softDeleteFeatureState: "Enabled",
},
};
const credential = new DefaultAzureCredential();
const client = new RecoveryServicesBackupClient(credential, subscriptionId);
const result = await client.backupResourceVaultConfigs.put(
vaultName,
resourceGroupName,
parameters
);
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.RecoveryServicesBackup;
using Azure.ResourceManager.RecoveryServicesBackup.Models;
using Azure.ResourceManager.Resources;
// Generated from example definition: specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/BackupResourceVaultConfigs_Put.json
// this example is just showing the usage of "BackupResourceVaultConfigs_Put" 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 ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "00000000-0000-0000-0000-000000000000";
string resourceGroupName = "SwaggerTestRg";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this BackupResourceVaultConfigResource
BackupResourceVaultConfigCollection collection = resourceGroupResource.GetBackupResourceVaultConfigs();
// invoke the operation
string vaultName = "SwaggerTest";
BackupResourceVaultConfigData data = new BackupResourceVaultConfigData(new AzureLocation("placeholder"))
{
Properties = new BackupResourceVaultConfigProperties()
{
EnhancedSecurityState = EnhancedSecurityState.Enabled,
SoftDeleteFeatureState = SoftDeleteFeatureState.Enabled,
},
};
ArmOperation<BackupResourceVaultConfigResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data);
BackupResourceVaultConfigResource result = lro.Value;
// 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
BackupResourceVaultConfigData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
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
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig",
"name": "vaultconfig",
"type": "Microsoft.RecoveryServices/vaults/backupconfig",
"properties": {
"enhancedSecurityState": "Enabled",
"softDeleteFeatureState": "Enabled"
}
}
Definice
BackupResourceVaultConfig
Podrobnosti o konfiguraci trezoru prostředků služby Backup
Name |
Typ |
Description |
enhancedSecurityState
|
EnhancedSecurityState
|
Povoleno nebo Zakázáno.
|
isSoftDeleteFeatureStateEditable
|
boolean
|
Tento příznak se už nepoužívá. K nastavení stavu obnovitelného odstranění trezoru použijte softDeleteFeatureState.
|
resourceGuardOperationRequests
|
string[]
|
Požadavky na operaci ResourceGuard
|
softDeleteFeatureState
|
SoftDeleteFeatureState
|
Stav funkce obnovitelného odstranění
|
softDeleteRetentionPeriodInDays
|
integer
|
Doba uchovávání obnovitelného odstranění ve dnech
|
storageModelType
|
StorageType
|
Typ úložiště.
|
storageType
|
StorageType
|
Typ úložiště.
|
storageTypeState
|
StorageTypeState
|
Uzamčeno nebo Odemknuté. Jakmile je počítač zaregistrovaný pro prostředek, storageTypeState je vždy Uzamčeno.
|
BackupResourceVaultConfigResource
Podrobnosti o konfiguraci trezoru prostředků služby Backup
Name |
Typ |
Description |
eTag
|
string
|
Volitelná značka ETag.
|
id
|
string
|
ID prostředku představuje úplnou cestu k prostředku.
|
location
|
string
|
Umístění prostředku.
|
name
|
string
|
Název prostředku přidružený k prostředku.
|
properties
|
BackupResourceVaultConfig
|
BackupResourceVaultConfigResource – vlastnosti
|
tags
|
object
|
Značky prostředků.
|
type
|
string
|
Typ prostředku představuje úplnou cestu ve formátu Namespace/ResourceType/ResourceType/...
|
EnhancedSecurityState
Povoleno nebo Zakázáno.
Name |
Typ |
Description |
Disabled
|
string
|
|
Enabled
|
string
|
|
Invalid
|
string
|
|
Error
Objekt chyby.
Name |
Typ |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
Další informace o chybě.
|
code
|
string
|
Kód chyby
|
details
|
NewErrorResponse[]
|
Podrobnosti o chybě.
|
message
|
string
|
Chybová zpráva
|
target
|
string
|
Cíl chyby.
|
ErrorAdditionalInfo
Další informace o chybě správy prostředků
Name |
Typ |
Description |
info
|
object
|
Další informace.
|
type
|
string
|
Typ další informace.
|
NewErrorResponse
Odpověď na chybu správy prostředků.
Name |
Typ |
Description |
error
|
Error
|
Objekt chyby.
|
SoftDeleteFeatureState
Stav funkce obnovitelného odstranění
Name |
Typ |
Description |
AlwaysON
|
string
|
|
Disabled
|
string
|
|
Enabled
|
string
|
|
Invalid
|
string
|
|
StorageType
Typ úložiště
Name |
Typ |
Description |
GeoRedundant
|
string
|
|
Invalid
|
string
|
|
LocallyRedundant
|
string
|
|
ReadAccessGeoZoneRedundant
|
string
|
|
ZoneRedundant
|
string
|
|
StorageTypeState
Uzamčeno nebo Odemknuté. Jakmile je počítač zaregistrovaný pro prostředek, storageTypeState je vždy Uzamčeno.
Name |
Typ |
Description |
Invalid
|
string
|
|
Locked
|
string
|
|
Unlocked
|
string
|
|