Získejte cenové konfigurace plánů Defenderu pro vybraný obor (platné obory jsou ID prostředku nebo ID předplatného). Na úrovni prostředků jsou podporované typy prostředků VirtualMachines, VMSS a ARC Machines.
GET https://management.azure.com/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}?api-version=2024-01-01
Parametry identifikátoru URI
Name |
V |
Vyžadováno |
Typ |
Description |
pricingName
|
path |
True
|
string
|
název konfigurace cen
|
scopeId
|
path |
True
|
string
|
ID rozsahu cen. Platné obory jsou: předplatné (formát: subscriptions/{subscriptionId}) nebo konkrétní prostředek (formát: subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}) – Podporované prostředky jsou (VirtualMachines).
|
api-version
|
query |
True
|
string
|
Verze rozhraní API pro operaci
|
Odpovědi
Name |
Typ |
Description |
200 OK
|
Pricing
|
OK
|
Other Status Codes
|
CloudError
|
Chybová odpověď popisující, proč operace selhala.
|
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
|
zosobnění uživatelského účtu
|
Příklady
Get pricings on resource - VirtualMachines plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/VirtualMachines?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"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/2024-01-01/examples/Pricings/GetResourcePricingByNameVirtualMachines_example.json
func ExamplePricingsClient_Get_getPricingsOnResourceVirtualMachinesPlan() {
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.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", "VirtualMachines", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("VirtualMachines"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/VirtualMachines"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// Inherited: to.Ptr(armsecurity.InheritedTrue),
// InheritedFrom: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// SubPlan: to.Ptr("P2"),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("AgentlessVmScanning"),
// AdditionalExtensionProperties: map[string]any{
// "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]",
// },
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("MdeDesignatedSubscription"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
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 Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetResourcePricingByNameVirtualMachines_example.json
*/
async function getPricingsOnResourceVirtualMachinesPlan() {
const scopeId =
"subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1";
const pricingName = "VirtualMachines";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
Sample Response
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/VirtualMachines",
"name": "VirtualMachines",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"subPlan": "P2",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"inherited": "True",
"inheritedFrom": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23",
"extensions": [
{
"name": "AgentlessVmScanning",
"isEnabled": "True",
"additionalExtensionProperties": {
"ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]"
}
},
{
"name": "MdeDesignatedSubscription",
"isEnabled": "True"
}
]
}
}
Get pricings on subscription - CloudPosture plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"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/2024-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionCloudPosturePlan() {
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.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("CloudPosture"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("AgentlessVmScanning"),
// AdditionalExtensionProperties: map[string]any{
// "ExclusionTags": "[]",
// },
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("AgentlessDiscoveryForKubernetes"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("SensitiveDataDiscovery"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("EntraPermissionsManagement"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
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 Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json
*/
async function getPricingsOnSubscriptionCloudPosturePlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "CloudPosture";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
Sample Response
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture",
"name": "CloudPosture",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"enforce": "False",
"resourcesCoverageStatus": "FullyCovered",
"extensions": [
{
"name": "AgentlessVmScanning",
"isEnabled": "True",
"additionalExtensionProperties": {
"ExclusionTags": "[]"
}
},
{
"name": "AgentlessDiscoveryForKubernetes",
"isEnabled": "True"
},
{
"name": "SensitiveDataDiscovery",
"isEnabled": "True"
},
{
"name": "ContainerRegistriesVulnerabilityAssessments",
"isEnabled": "True"
},
{
"name": "EntraPermissionsManagement",
"isEnabled": "True"
}
]
}
}
Get pricings on subscription - Containers plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Containers?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"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/2024-01-01/examples/Pricings/GetPricingByNameContainers_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionContainersPlan() {
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.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Containers", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("Containers"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Containers"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
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 Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameContainers_example.json
*/
async function getPricingsOnSubscriptionContainersPlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "Containers";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
Sample Response
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Containers",
"name": "Containers",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"enforce": "False",
"resourcesCoverageStatus": "FullyCovered",
"extensions": [
{
"name": "ContainerRegistriesVulnerabilityAssessments",
"isEnabled": "True"
}
]
}
}
Get pricings on subscription - Dns plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Dns?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"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/2024-01-01/examples/Pricings/GetPricingByNameDns_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionDnsPlan() {
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.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Dns", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("Dns"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Dns"),
// Properties: &armsecurity.PricingProperties{
// Deprecated: to.Ptr(true),
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ReplacedBy: []*string{
// to.Ptr("VirtualMachines")},
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered),
// },
// }
}
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 Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameDns_example.json
*/
async function getPricingsOnSubscriptionDnsPlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "Dns";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
Sample Response
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Dns",
"name": "Dns",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"deprecated": true,
"replacedBy": [
"VirtualMachines"
],
"enforce": "False",
"resourcesCoverageStatus": "FullyCovered"
}
}
Get pricings on subscription - StorageAccounts plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"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/2024-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionStorageAccountsPlan() {
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.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "StorageAccounts", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("StorageAccounts"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered),
// SubPlan: to.Ptr("PerStorageAccount"),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("OnUploadMalwareScanning"),
// AdditionalExtensionProperties: map[string]any{
// "capGBPerMonthPerStorageAccount": float64(10),
// },
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("SensitiveDataDiscovery"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
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 Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json
*/
async function getPricingsOnSubscriptionStorageAccountsPlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "StorageAccounts";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
Sample Response
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts",
"name": "StorageAccounts",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"subPlan": "PerStorageAccount",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"enforce": "False",
"resourcesCoverageStatus": "FullyCovered",
"extensions": [
{
"name": "OnUploadMalwareScanning",
"isEnabled": "True",
"additionalExtensionProperties": {
"capGBPerMonthPerStorageAccount": 10
}
},
{
"name": "SensitiveDataDiscovery",
"isEnabled": "True"
}
]
}
}
Get pricings on subscription - VirtualMachines plan
Sample Request
GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines?api-version=2024-01-01
package armsecurity_test
import (
"context"
"log"
"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/2024-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json
func ExamplePricingsClient_Get_getPricingsOnSubscriptionVirtualMachinesPlan() {
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.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", 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.Pricing = armsecurity.Pricing{
// Name: to.Ptr("VirtualMachines"),
// Type: to.Ptr("Microsoft.Security/pricings"),
// ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"),
// Properties: &armsecurity.PricingProperties{
// EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()),
// Enforce: to.Ptr(armsecurity.EnforceFalse),
// FreeTrialRemainingTime: to.Ptr("PT0S"),
// PricingTier: to.Ptr(armsecurity.PricingTierStandard),
// ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusPartiallyCovered),
// SubPlan: to.Ptr("P2"),
// Extensions: []*armsecurity.Extension{
// {
// Name: to.Ptr("AgentlessVmScanning"),
// AdditionalExtensionProperties: map[string]any{
// "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]",
// },
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// },
// {
// Name: to.Ptr("MdeDesignatedSubscription"),
// IsEnabled: to.Ptr(armsecurity.IsEnabledTrue),
// }},
// },
// }
}
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 Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
*
* @summary Get the Defender plans pricing configurations of the selected scope (valid scopes are resource id or a subscription id). At the resource level, supported resource types are 'VirtualMachines, VMSS and ARC Machines'.
* x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json
*/
async function getPricingsOnSubscriptionVirtualMachinesPlan() {
const scopeId = "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23";
const pricingName = "VirtualMachines";
const credential = new DefaultAzureCredential();
const client = new SecurityCenter(credential);
const result = await client.pricings.get(scopeId, pricingName);
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
Sample Response
{
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines",
"name": "VirtualMachines",
"type": "Microsoft.Security/pricings",
"properties": {
"pricingTier": "Standard",
"subPlan": "P2",
"freeTrialRemainingTime": "PT0S",
"enablementTime": "2023-03-01T12:42:42.1921106Z",
"enforce": "False",
"resourcesCoverageStatus": "PartiallyCovered",
"extensions": [
{
"name": "AgentlessVmScanning",
"isEnabled": "True",
"additionalExtensionProperties": {
"ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]"
}
},
{
"name": "MdeDesignatedSubscription",
"isEnabled": "True"
}
]
}
}
Definice
Name |
Description |
CloudError
|
Běžná chybová odpověď pro všechna rozhraní API azure Resource Manager, která vrací podrobnosti o chybě pro neúspěšné operace. (Tento formát také odpovídá formátu odpovědi na chybu OData.)
|
CloudErrorBody
|
Podrobnosti o chybě
|
code
|
Stavový kód operace.
|
enforce
|
Pokud je nastavená hodnota False, umožní potomkům tohoto oboru přepsat konfiguraci cen nastavenou pro tento obor (umožňuje nastavení zděděno="False"). Pokud je nastavená hodnota True, zabrání přepsání a vynutí tuto konfiguraci cen u všech potomků tohoto oboru. Toto pole je dostupné jenom pro ceny na úrovni předplatného.
|
ErrorAdditionalInfo
|
Další informace o chybě správy prostředků
|
Extension
|
Vlastnosti rozšíření plánu
|
inherited
|
Výraz "zděděný" = "True" označuje, že aktuální obor dědí konfiguraci cen z nadřazeného objektu. ID nadřazeného oboru, který poskytuje zděděnou konfiguraci, se zobrazí v poli "inheritedFrom". Na druhou stranu výraz "zděděný" = "Nepravda" označuje, že aktuální obor má explicitně nastavenou vlastní konfiguraci cen a nedědí se z nadřazeného objektu. Toto pole je jen pro čtení a je k dispozici pouze pro ceny na úrovni prostředků.
|
isEnabled
|
Určuje, jestli je rozšíření povolené.
|
OperationStatus
|
Stav popisující úspěch nebo selhání operace povolení/zakázání rozšíření.
|
Pricing
|
Microsoft Defender for Cloud je k dispozici ve dvou cenových úrovních: Free a Standard. Úroveň Standard nabízí pokročilé možnosti zabezpečení, zatímco úroveň Free nabízí základní funkce zabezpečení.
|
pricingTier
|
Určuje, jestli je ve vybraném oboru povolený plán Defenderu. Microsoft Defender for Cloud je k dispozici ve dvou cenových úrovních: Free a Standard. Úroveň Standard nabízí pokročilé možnosti zabezpečení, zatímco úroveň Free nabízí základní funkce zabezpečení.
|
resourcesCoverageStatus
|
Toto pole je dostupné jenom na úrovni předplatného a odráží stav pokrytí prostředků v rámci předplatného. Poznámka: Pole pricingTier odráží stav plánu předplatného. Vzhledem k tomu, že stav plánu je možné definovat také na úrovni prostředku, může dojít k neshodě mezi stavem plánu předplatného a stavem prostředku. Toto pole pomáhá určit stav pokrytí prostředků.
|
CloudError
Běžná chybová odpověď pro všechna rozhraní API azure Resource Manager, která vrací podrobnosti o chybě pro neúspěšné operace. (Tento formát také odpovídá formátu odpovědi na chybu OData.)
Name |
Typ |
Description |
error.additionalInfo
|
ErrorAdditionalInfo[]
|
Další informace o chybě.
|
error.code
|
string
|
Kód chyby
|
error.details
|
CloudErrorBody[]
|
Podrobnosti o chybě.
|
error.message
|
string
|
Chybová zpráva
|
error.target
|
string
|
Cíl chyby.
|
CloudErrorBody
Podrobnosti o chybě
Name |
Typ |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
Další informace o chybě.
|
code
|
string
|
Kód chyby
|
details
|
CloudErrorBody[]
|
Podrobnosti o chybě.
|
message
|
string
|
Chybová zpráva
|
target
|
string
|
Cíl chyby.
|
code
Stavový kód operace.
Name |
Typ |
Description |
Failed
|
string
|
Rozšíření nebylo úspěšně vytvořeno nebo aktualizováno. Další podrobnosti najdete v tématu Zpráva o stavu operace.
|
Succeeded
|
string
|
Rozšíření bylo úspěšně vytvořeno nebo aktualizováno.
|
enforce
Pokud je nastavená hodnota False, umožní potomkům tohoto oboru přepsat konfiguraci cen nastavenou pro tento obor (umožňuje nastavení zděděno="False"). Pokud je nastavená hodnota True, zabrání přepsání a vynutí tuto konfiguraci cen u všech potomků tohoto oboru. Toto pole je dostupné jenom pro ceny na úrovni předplatného.
Name |
Typ |
Description |
False
|
string
|
Umožňuje potomkům tohoto oboru přepsat cenovou konfiguraci nastavenou pro tento obor (umožňuje nastavení zděděné="False").
|
True
|
string
|
Zabrání přepsání a vynutí konfiguraci cen aktuálního oboru pro všechny potomky.
|
ErrorAdditionalInfo
Další informace o chybě správy prostředků
Name |
Typ |
Description |
info
|
object
|
Další informace.
|
type
|
string
|
Typ další informace.
|
Extension
Vlastnosti rozšíření plánu
Name |
Typ |
Description |
additionalExtensionProperties
|
|
Hodnoty vlastností přidružené k rozšíření.
|
isEnabled
|
isEnabled
|
Určuje, jestli je rozšíření povolené.
|
name
|
string
|
Název rozšíření. Podporované hodnoty jsou:
AgentlessDiscoveryForKubernetes – zjišťování informací o architektuře clusteru Kubernetes, objektech úloh a nastavení na základě rozhraní API. Vyžaduje se pro inventář Kubernetes, detekci identity a ohrožení sítě, analýzu cest útoku a proaktivní vyhledávání rizik v rámci Průzkumníka zabezpečení cloudu.
K dispozici pro plán CloudPosture.
OnUploadMalwareScanning – pro každý účet úložiště v rámci předplatného omezuje velikost GB, která se má každý měsíc zkontrolovat. Jakmile v daném účtu úložiště dosáhnete tohoto limitu, nebudou se objekty blob během aktuálního kalendářního měsíce kontrolovat.
K dispozici pro plán StorageAccounts.
SensitiveDataDiscovery – zjišťování citlivých dat identifikuje kontejner úložiště objektů blob s citlivými daty, jako jsou přihlašovací údaje, platební karty a další, a pomáhá tak určit prioritu a prozkoumat události zabezpečení.
K dispozici pro plány StorageAccounts a CloudPosture.
ContainerRegistriesVulnerabilityAssessments – poskytuje správu ohrožení zabezpečení pro image uložené v registrech kontejnerů.
K dispozici pro plány CloudPosture a Containers.
|
operationStatus
|
OperationStatus
|
Nepovinný parametr. Stav popisující úspěch nebo selhání operace povolení/zakázání rozšíření.
|
inherited
Výraz "zděděný" = "True" označuje, že aktuální obor dědí konfiguraci cen z nadřazeného objektu. ID nadřazeného oboru, který poskytuje zděděnou konfiguraci, se zobrazí v poli "inheritedFrom". Na druhou stranu výraz "zděděný" = "Nepravda" označuje, že aktuální obor má explicitně nastavenou vlastní konfiguraci cen a nedědí se z nadřazeného objektu. Toto pole je jen pro čtení a je k dispozici pouze pro ceny na úrovni prostředků.
Name |
Typ |
Description |
False
|
string
|
Označuje, že aktuální obor nastavuje vlastní cenovou konfiguraci a nedědí ji z nadřazeného objektu.
|
True
|
string
|
Označuje, že aktuální obor dědí cenovou konfiguraci z nadřazeného oboru.
|
isEnabled
Určuje, jestli je rozšíření povolené.
Name |
Typ |
Description |
False
|
string
|
Označuje, že rozšíření je zakázané.
|
True
|
string
|
Označuje, že rozšíření je povolené.
|
OperationStatus
Stav popisující úspěch nebo selhání operace povolení/zakázání rozšíření.
Name |
Typ |
Description |
code
|
code
|
Stavový kód operace.
|
message
|
string
|
Další informace týkající se úspěchu nebo selhání operace
|
Pricing
Microsoft Defender for Cloud je k dispozici ve dvou cenových úrovních: Free a Standard. Úroveň Standard nabízí pokročilé možnosti zabezpečení, zatímco úroveň Free nabízí základní funkce zabezpečení.
Name |
Typ |
Description |
id
|
string
|
ID prostředku
|
name
|
string
|
Název prostředku
|
properties.deprecated
|
boolean
|
Nepovinný parametr. Hodnota True, pokud je plán zastaralý. Pokud se plány nahrazují, zobrazí se ve replacedBy vlastnosti.
|
properties.enablementTime
|
string
|
Nepovinný parametr. Pokud pricingTier je, pak tato vlastnost obsahuje datum posledního nastavení pricingTier na , pokud je Standard Standard k dispozici (například 2023-03-01T12:42:42.1921106Z).
|
properties.enforce
|
enforce
|
Pokud je nastavená hodnota False, umožní potomkům tohoto oboru přepsat konfiguraci cen nastavenou pro tento obor (umožňuje nastavení zděděno="False"). Pokud je nastavená hodnota True, zabrání přepsání a vynutí tuto konfiguraci cen u všech potomků tohoto oboru. Toto pole je dostupné jenom pro ceny na úrovni předplatného.
|
properties.extensions
|
Extension[]
|
Nepovinný parametr. Seznam rozšíření nabízených v rámci plánu
|
properties.freeTrialRemainingTime
|
string
|
Zbývající doba platnosti bezplatného zkušebního období předplatných ve formátu ISO 8601 (např. P3Y6M4DT12H30M5S).
|
properties.inherited
|
inherited
|
Výraz "zděděný" = "True" označuje, že aktuální obor dědí konfiguraci cen z nadřazeného objektu. ID nadřazeného oboru, který poskytuje zděděnou konfiguraci, se zobrazí v poli "inheritedFrom". Na druhou stranu výraz "zděděný" = "Nepravda" označuje, že aktuální obor má explicitně nastavenou vlastní konfiguraci cen a nedědí se z nadřazeného objektu. Toto pole je jen pro čtení a je k dispozici pouze pro ceny na úrovni prostředků.
|
properties.inheritedFrom
|
string
|
ID oboru zděděného z. "Null", pokud není zděděno. Toto pole je k dispozici pouze pro ceny na úrovni prostředků.
|
properties.pricingTier
|
pricingTier
|
Určuje, jestli je ve vybraném oboru povolený plán Defenderu. Microsoft Defender for Cloud je k dispozici ve dvou cenových úrovních: Free a Standard. Úroveň Standard nabízí pokročilé možnosti zabezpečení, zatímco úroveň Free nabízí základní funkce zabezpečení.
|
properties.replacedBy
|
string[]
|
Nepovinný parametr. Seznam plánů, které tento plán nahrazují Tato vlastnost existuje pouze v případě, že je tento plán zastaralý.
|
properties.resourcesCoverageStatus
|
resourcesCoverageStatus
|
Toto pole je dostupné jenom na úrovni předplatného a odráží stav pokrytí prostředků v rámci předplatného. Poznámka: Pole pricingTier odráží stav plánu předplatného. Vzhledem k tomu, že stav plánu je možné definovat také na úrovni prostředku, může dojít k neshodě mezi stavem plánu předplatného a stavem prostředku. Toto pole pomáhá určit stav pokrytí prostředků.
|
properties.subPlan
|
string
|
Dílčí plán vybraný pro konfiguraci cen Standard, pokud je k dispozici více než jeden dílčí plán. Každý dílčí plán umožňuje sadu funkcí zabezpečení. Pokud není zadaný, použije se úplný plán. Pro plán VirtualMachines jsou dostupné dílčí plány P1 & P2, kde pro úroveň prostředků se podporuje pouze podplán P1.
|
type
|
string
|
Typ prostředku
|
pricingTier
Určuje, jestli je ve vybraném oboru povolený plán Defenderu. Microsoft Defender for Cloud je k dispozici ve dvou cenových úrovních: Free a Standard. Úroveň Standard nabízí pokročilé možnosti zabezpečení, zatímco úroveň Free nabízí základní funkce zabezpečení.
Name |
Typ |
Description |
Free
|
string
|
Získejte bezplatné Microsoft Defender pro cloudové prostředí se základními funkcemi zabezpečení
|
Standard
|
string
|
Získejte standardní Microsoft Defender pro cloudové prostředí s pokročilými funkcemi zabezpečení.
|
resourcesCoverageStatus
Toto pole je dostupné jenom na úrovni předplatného a odráží stav pokrytí prostředků v rámci předplatného. Poznámka: Pole pricingTier odráží stav plánu předplatného. Vzhledem k tomu, že stav plánu je možné definovat také na úrovni prostředku, může dojít k neshodě mezi stavem plánu předplatného a stavem prostředku. Toto pole pomáhá určit stav pokrytí prostředků.
Name |
Typ |
Description |
FullyCovered
|
string
|
Tato hodnota označuje, že všechny prostředky přidružené k předplatnému mají povolený plán Defender.
|
NotCovered
|
string
|
Tato hodnota označuje, že plán Defenderu je zakázaný pro všechny prostředky v rámci předplatného. Žádný z prostředků není chráněný plánem Defender.
|
PartiallyCovered
|
string
|
Tato hodnota označuje, že některé prostředky v rámci předplatného mají plán Defender povolený, zatímco jiné ho mají zakázaný. Mezi prostředky existuje smíšený stav pokrytí.
|