Resource Guards - Get Default Delete Protected Item Requests Object
Referenz
Service:
Data Protection
API Version:
2023-01-01
Gibt die Auflistung von Vorgangsanforderungsobjekten für einen kritischen Vorgang zurück, der durch die angegebene ResourceGuard-Ressource geschützt ist.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/resourceGuards/{resourceGuardsName}/deleteProtectedItemRequests/{requestName}?api-version=2023-01-01
URI-Parameter
Name
In
Erforderlich
Typ
Beschreibung
requestName
path
True
string
resourceGroupName
path
True
string
Der Name der Ressourcengruppe. Für den Namen wird die Groß-/Kleinschreibung nicht beachtet.
resourceGuardsName
path
True
string
subscriptionId
path
True
string
uuid
Hierbei handelt es sich um die ID des Zielabonnements. Der Wert muss eine UUID sein.
api-version
query
True
string
Hierbei handelt es sich um die für diesen Vorgang zu verwendende API-Version.
GET https://management.azure.com/subscriptions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/deleteProtectedItemRequests/default?api-version=2023-01-01
/** Samples for ResourceGuards GetDefaultDeleteProtectedItemRequestsObject. */
public final class Main {
/*
* x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json
*/
/**
* Sample code: Get DefaultOperationsRequestObject.
*
* @param manager Entry point to DataProtectionManager.
*/
public static void getDefaultOperationsRequestObject(
com.azure.resourcemanager.dataprotection.DataProtectionManager manager) {
manager
.resourceGuards()
.getDefaultDeleteProtectedItemRequestsObjectWithResponse(
"SampleResourceGroup", "swaggerExample", "default", com.azure.core.util.Context.NONE);
}
}
from azure.identity import DefaultAzureCredential
from azure.mgmt.dataprotection import DataProtectionMgmtClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-dataprotection
# USAGE
python get_default_delete_protected_item_requests.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 = DataProtectionMgmtClient(
credential=DefaultAzureCredential(),
subscription_id="0b352192-dcac-4cc7-992e-a96190ccc68c",
)
response = client.resource_guards.get_default_delete_protected_item_requests_object(
resource_group_name="SampleResourceGroup",
resource_guards_name="swaggerExample",
request_name="default",
)
print(response)
# x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json
if __name__ == "__main__":
main()
package armdataprotection_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1b33e81bbdc28fcd6644a1315b8d7b1b6d030590/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json
func ExampleResourceGuardsClient_GetDefaultDeleteProtectedItemRequestsObject() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armdataprotection.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewResourceGuardsClient().GetDefaultDeleteProtectedItemRequestsObject(ctx, "SampleResourceGroup", "swaggerExample", "default", 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.DppBaseResource = armdataprotection.DppBaseResource{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteProtectedItemRequests"),
// ID: to.Ptr("subscriotions/0b352192-dcac-4cc7-992e-a96190ccc68c/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/resourceGuards/swaggerExample/deleteProtectedItemRequests/default"),
// }
}