Mendapatkan semua penyebaran untuk remediasi di cakupan grup sumber daya.
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
Parameter URI
Nama |
Dalam |
Diperlukan |
Jenis |
Deskripsi |
remediationName
|
path |
True
|
string
|
Nama remediasi.
|
resourceGroupName
|
path |
True
|
string
|
Nama grup sumber daya.
|
subscriptionId
|
path |
True
|
string
|
ID langganan Microsoft Azure.
|
api-version
|
query |
True
|
string
|
Versi Api Klien.
|
$top
|
query |
|
integer
int32
|
Jumlah maksimum rekaman yang akan dikembalikan.
|
Respons
Keamanan
azure_auth
Alur OAuth2 Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nama |
Deskripsi |
user_impersonation
|
meniru akun pengguna Anda
|
Contoh
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"
}
]
}
Definisi
ErrorDefinition
Definisi kesalahan.
Nama |
Jenis |
Deskripsi |
additionalInfo
|
TypedErrorInfo[]
|
Detail kesalahan spesifik skenario tambahan.
|
code
|
string
|
Kode kesalahan khusus layanan yang berfungsi sebagai substatus untuk kode kesalahan HTTP.
|
details
|
ErrorDefinition[]
|
Detail kesalahan internal.
|
message
|
string
|
Deskripsi kesalahan.
|
target
|
string
|
Target kesalahan.
|
ErrorResponse
Respons kesalahan.
Detail penyebaran tunggal yang dibuat oleh remediasi.
Nama |
Jenis |
Deskripsi |
createdOn
|
string
|
Waktu di mana remediasi dibuat.
|
deploymentId
|
string
|
ID sumber daya dari penyebaran templat yang akan memulihkan sumber daya.
|
error
|
ErrorDefinition
|
Terjadi kesalahan saat memulihkan sumber daya.
|
lastUpdatedOn
|
string
|
Waktu saat penyebaran remediasi terakhir diperbarui.
|
remediatedResourceId
|
string
|
ID sumber daya dari sumber daya yang sedang diperbaiki oleh penyebaran.
|
resourceLocation
|
string
|
Lokasi sumber daya yang sedang diperbaiki.
|
status
|
string
|
Status penyebaran remediasi.
|
Daftar penyebaran untuk remediasi.
Nama |
Jenis |
Deskripsi |
nextLink
|
string
|
URL untuk mendapatkan serangkaian hasil berikutnya.
|
value
|
RemediationDeployment[]
|
Array penyebaran untuk remediasi.
|
TypedErrorInfo
Detail kesalahan spesifik skenario.
Nama |
Jenis |
Deskripsi |
info
|
|
Detail kesalahan spesifik skenario.
|
type
|
string
|
Jenis detail kesalahan yang disertakan.
|