Lekéri a szervizeléshez szükséges összes üzembe helyezést az erőforráscsoport hatókörében.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments?api-version=2021-10-01
With optional parameters:
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/remediations/{remediationName}/listDeployments?$top={$top}&api-version=2021-10-01
URI-paraméterek
Name |
In |
Kötelező |
Típus |
Description |
remediationName
|
path |
True
|
string
|
A szervizelés neve.
|
resourceGroupName
|
path |
True
|
string
|
Az erőforráscsoport neve.
|
subscriptionId
|
path |
True
|
string
|
Microsoft Azure-előfizetés azonosítója.
|
api-version
|
query |
True
|
string
|
Ügyfél API-verziója.
|
$top
|
query |
|
integer
int32
|
A visszaadandó rekordok maximális száma.
|
Válaszok
Biztonság
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
|
felhasználói fiók megszemélyesítése
|
Példák
Sample Request
POST https://management.azure.com/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourceGroups/myResourceGroup/providers/Microsoft.PolicyInsights/remediations/myRemediation/listDeployments?api-version=2021-10-01
import com.azure.core.util.Context;
/** Samples for Remediations ListDeploymentsAtResourceGroup. */
public final class Main {
/*
* x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json
*/
/**
* Sample code: List deployments for a remediation at resource group scope.
*
* @param manager Entry point to PolicyInsightsManager.
*/
public static void listDeploymentsForARemediationAtResourceGroupScope(
com.azure.resourcemanager.policyinsights.PolicyInsightsManager manager) {
manager.remediations().listDeploymentsAtResourceGroup("myResourceGroup", "myRemediation", null, 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.policyinsights import PolicyInsightsClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-policyinsights
# USAGE
python remediations_list_deployments_resource_group_scope.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 = PolicyInsightsClient(
credential=DefaultAzureCredential(),
subscription_id="35ee058e-5fa0-414c-8145-3ebb8d09b6e2",
)
response = client.remediations.list_deployments_at_resource_group(
resource_group_name="myResourceGroup",
remediation_name="myRemediation",
)
for item in response:
print(item)
# x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.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 armpolicyinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/policyinsights/armpolicyinsights"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/05a9cdab363b8ec824094ee73950c04594325172/specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json
func ExampleRemediationsClient_NewListDeploymentsAtResourceGroupPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armpolicyinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRemediationsClient().NewListDeploymentsAtResourceGroupPager("myResourceGroup", "myRemediation", &armpolicyinsights.QueryOptions{Top: nil,
Filter: nil,
OrderBy: nil,
Select: nil,
From: nil,
To: nil,
Apply: nil,
SkipToken: nil,
Expand: nil,
}, nil)
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.RemediationDeploymentsListResult = armpolicyinsights.RemediationDeploymentsListResult{
// Value: []*armpolicyinsights.RemediationDeployment{
// {
// CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T21:51:09.075Z"); return t}()),
// DeploymentID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.resources/deployments/a088e8fd-8600-4126-8d74-fc7ead0e9ae4"),
// LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T21:52:09.891Z"); return t}()),
// RemediatedResourceID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1"),
// ResourceLocation: to.Ptr("eastus"),
// Status: to.Ptr("Succeeded"),
// },
// {
// CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T21:51:09.075Z"); return t}()),
// DeploymentID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.resources/deployments/6b8898c0-18a2-449e-987a-8d4d4f634f56"),
// LastUpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-09-13T21:52:09.876Z"); return t}()),
// RemediatedResourceID: to.Ptr("/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/stor2"),
// ResourceLocation: to.Ptr("westus"),
// Status: to.Ptr("Succeeded"),
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { PolicyInsightsClient } = require("@azure/arm-policyinsights");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets all deployments for a remediation at resource group scope.
*
* @summary Gets all deployments for a remediation at resource group scope.
* x-ms-original-file: specification/policyinsights/resource-manager/Microsoft.PolicyInsights/stable/2021-10-01/examples/Remediations_ListDeploymentsResourceGroupScope.json
*/
async function listDeploymentsForARemediationAtResourceGroupScope() {
const subscriptionId =
process.env["POLICYINSIGHTS_SUBSCRIPTION_ID"] || "35ee058e-5fa0-414c-8145-3ebb8d09b6e2";
const resourceGroupName = process.env["POLICYINSIGHTS_RESOURCE_GROUP"] || "myResourceGroup";
const remediationName = "myRemediation";
const credential = new DefaultAzureCredential();
const client = new PolicyInsightsClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.remediations.listDeploymentsAtResourceGroup(
resourceGroupName,
remediationName
)) {
resArray.push(item);
}
console.log(resArray);
}
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
{
"value": [
{
"remediatedResourceId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/storAc1",
"deploymentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.resources/deployments/a088e8fd-8600-4126-8d74-fc7ead0e9ae4",
"status": "Succeeded",
"resourceLocation": "eastus",
"createdOn": "2018-09-13T21:51:09.075918Z",
"lastUpdatedOn": "2018-09-13T21:52:09.8919106Z"
},
{
"remediatedResourceId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.storage/storageaccounts/stor2",
"deploymentId": "/subscriptions/35ee058e-5fa0-414c-8145-3ebb8d09b6e2/resourcegroups/myResourceGroup/providers/microsoft.resources/deployments/6b8898c0-18a2-449e-987a-8d4d4f634f56",
"status": "Succeeded",
"resourceLocation": "westus",
"createdOn": "2018-09-13T21:51:09.075918Z",
"lastUpdatedOn": "2018-09-13T21:52:09.8761679Z"
}
]
}
Definíciók
ErrorDefinition
Hibadefiníció.
Name |
Típus |
Description |
additionalInfo
|
TypedErrorInfo[]
|
További forgatókönyvspecifikus hibaadatok.
|
code
|
string
|
Szolgáltatásspecifikus hibakód, amely a HTTP-hibakód alállapotaként szolgál.
|
details
|
ErrorDefinition[]
|
Belső hiba részletei.
|
message
|
string
|
A hiba leírása.
|
target
|
string
|
A hiba célja.
|
ErrorResponse
Hibaválasz.
A szervizelés által létrehozott egyetlen üzembe helyezés részletei.
Name |
Típus |
Description |
createdOn
|
string
|
A szervizelés létrehozásának időpontja.
|
deploymentId
|
string
|
Az erőforrást javító sablontelepítés erőforrás-azonosítója.
|
error
|
ErrorDefinition
|
Hiba történt az erőforrás szervizelése közben.
|
lastUpdatedOn
|
string
|
A szervizelési üzembe helyezés utolsó frissítésének időpontja.
|
remediatedResourceId
|
string
|
Az üzembe helyezés által szervizelt erőforrás erőforrás-azonosítója.
|
resourceLocation
|
string
|
A szervizelendő erőforrás helye.
|
status
|
string
|
A szervizelési üzembe helyezés állapota.
|
A szervizeléshez szükséges üzemelő példányok listája.
Name |
Típus |
Description |
nextLink
|
string
|
A következő eredményhalmaz lekéréséhez tartozó URL-cím.
|
value
|
RemediationDeployment[]
|
Üzembe helyezések tömbje a szervizeléshez.
|
TypedErrorInfo
Esetspecifikus hiba részletei.
Name |
Típus |
Description |
info
|
|
A forgatókönyv konkrét hibaadatai.
|
type
|
string
|
A hiba részleteinek típusa.
|