Létrehozza vagy frissíti az Advanced Threat Protection beállításait egy adott erőforráson.
PUT https://management.azure.com/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/current?api-version=2019-01-01
URI-paraméterek
Name |
In |
Kötelező |
Típus |
Description |
resourceId
|
path |
True
|
string
|
Az erőforrás azonosítója.
|
settingName
|
path |
True
|
AdvancedThreatProtectionSettingName
|
Advanced Threat Protection beállítás neve.
|
api-version
|
query |
True
|
string
|
API-verzió a művelethez
|
Kérelem törzse
Name |
Típus |
Description |
properties.isEnabled
|
boolean
|
Azt jelzi, hogy az Advanced Threat Protection engedélyezve van-e.
|
Válaszok
Name |
Típus |
Description |
200 OK
|
AdvancedThreatProtectionSetting
|
Sikeres kérés az Advanced Threat Protection beállításainak megadására.
|
Other Status Codes
|
CloudError
|
Hibaválasz, amely leírja, hogy miért nem sikerült a művelet.
|
Biztonság
azure_auth
Azure Active Directory OAuth2 Flow
Típus:
oauth2
Folyamat:
implicit
Engedélyezési URL:
https://login.microsoftonline.com/common/oauth2/authorize
Hatókörök
Name |
Description |
user_impersonation
|
a felhasználói fiók megszemélyesítése
|
Példák
Creates or updates the Advanced Threat Protection settings on a specified resource.
Mintakérelem
PUT https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current?api-version=2019-01-01
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current",
"name": "current",
"type": "Microsoft.Security/advancedThreatProtectionSettings",
"properties": {
"isEnabled": true
}
}
/**
* Samples for AdvancedThreatProtection Create.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/
* PutAdvancedThreatProtectionSettings_example.json
*/
/**
* Sample code: Creates or updates the Advanced Threat Protection settings on a specified resource.
*
* @param manager Entry point to SecurityManager.
*/
public static void createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource(
com.azure.resourcemanager.security.SecurityManager manager) {
manager.advancedThreatProtections().define().withExistingResourceId(
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount")
.withIsEnabled(true).create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armsecurity_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/security/armsecurity"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json
func ExampleAdvancedThreatProtectionClient_Create() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armsecurity.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAdvancedThreatProtectionClient().Create(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", armsecurity.AdvancedThreatProtectionSetting{
Name: to.Ptr("current"),
Type: to.Ptr("Microsoft.Security/advancedThreatProtectionSettings"),
ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current"),
Properties: &armsecurity.AdvancedThreatProtectionProperties{
IsEnabled: to.Ptr(true),
},
}, 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.AdvancedThreatProtectionSetting = armsecurity.AdvancedThreatProtectionSetting{
// Name: to.Ptr("current"),
// Type: to.Ptr("Microsoft.Security/advancedThreatProtectionSettings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current"),
// Properties: &armsecurity.AdvancedThreatProtectionProperties{
// IsEnabled: 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 { SecurityCenter } = require("@azure/arm-security");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Creates or updates the Advanced Threat Protection settings on a specified resource.
*
* @summary Creates or updates the Advanced Threat Protection settings on a specified resource.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json
*/
async function createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource() {
const resourceId =
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount";
const advancedThreatProtectionSetting = {
name: "current",
type: "Microsoft.Security/advancedThreatProtectionSettings",
id: "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current",
isEnabled: true,
};
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.advancedThreatProtection.create(
resourceId,
advancedThreatProtectionSetting,
);
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 Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.SecurityCenter;
// Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json
// this example is just showing the usage of "AdvancedThreatProtection_Create" 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 AdvancedThreatProtectionSettingResource created on azure
// for more information of creating AdvancedThreatProtectionSettingResource, please refer to the document of AdvancedThreatProtectionSettingResource
string resourceId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount";
ResourceIdentifier advancedThreatProtectionSettingResourceId = AdvancedThreatProtectionSettingResource.CreateResourceIdentifier(resourceId);
AdvancedThreatProtectionSettingResource advancedThreatProtectionSetting = client.GetAdvancedThreatProtectionSettingResource(advancedThreatProtectionSettingResourceId);
// invoke the operation
AdvancedThreatProtectionSettingData data = new AdvancedThreatProtectionSettingData
{
IsEnabled = true,
};
ArmOperation<AdvancedThreatProtectionSettingResource> lro = await advancedThreatProtectionSetting.CreateOrUpdateAsync(WaitUntil.Completed, data);
AdvancedThreatProtectionSettingResource 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
AdvancedThreatProtectionSettingData 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
Mintaválasz
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current",
"name": "current",
"type": "Microsoft.Security/advancedThreatProtectionSettings",
"properties": {
"isEnabled": true
}
}
Definíciók
AdvancedThreatProtectionSetting
Objektum
Az Advanced Threat Protection erőforrás.
Name |
Típus |
Description |
id
|
string
|
Erőforrás-azonosító
|
name
|
string
|
Erőforrás neve
|
properties.isEnabled
|
boolean
|
Azt jelzi, hogy az Advanced Threat Protection engedélyezve van-e.
|
type
|
string
|
Erőforrás típusa
|
AdvancedThreatProtectionSettingName
Enumerálás
Advanced Threat Protection beállítás neve.
Érték |
Description |
current
|
|
CloudError
Objektum
Az Összes Azure Resource Manager API gyakori hibaválasza a sikertelen műveletek hibaadatainak visszaadásához. (Ez az OData hibaválasz formátumát is követi.)
Name |
Típus |
Description |
error.additionalInfo
|
ErrorAdditionalInfo[]
|
A hiba további információi.
|
error.code
|
string
|
A hibakód.
|
error.details
|
CloudErrorBody[]
|
A hiba részletei.
|
error.message
|
string
|
A hibaüzenet.
|
error.target
|
string
|
A hibacél.
|
CloudErrorBody
Objektum
A hiba részletei.
Name |
Típus |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
A hiba további információi.
|
code
|
string
|
A hibakód.
|
details
|
CloudErrorBody[]
|
A hiba részletei.
|
message
|
string
|
A hibaüzenet.
|
target
|
string
|
A hibacél.
|
ErrorAdditionalInfo
Objektum
Az erőforrás-kezelési hiba további információi.
Name |
Típus |
Description |
info
|
object
|
A további információk.
|
type
|
string
|
A további információtípus.
|