Listy usunięte konta w ramach subskrypcji.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts?api-version=2023-01-01
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
subscriptionId
|
path |
True
|
string
|
Identyfikator subskrypcji docelowej.
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API do użycia dla tej operacji.
|
Odpowiedzi
Nazwa |
Typ |
Opis |
200 OK
|
DeletedAccountListResult
|
OK — lista usuniętych kont została pobrana i zwrócona pomyślnie.
|
Other Status Codes
|
ErrorResponse
|
Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się.
|
Zabezpieczenia
azure_auth
Przepływ OAuth2 usługi Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
DeletedAccountList
Sample Request
GET https://management.azure.com/subscriptions/{subscription-id}/providers/Microsoft.Storage/deletedAccounts?api-version=2023-01-01
/** Samples for DeletedAccounts List. */
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/DeletedAccountList.json
*/
/**
* Sample code: DeletedAccountList.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void deletedAccountList(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getDeletedAccounts().list(com.azure.core.util.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.storage import StorageManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python deleted_account_list.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 = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.deleted_accounts.list()
for item in response:
print(item)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/DeletedAccountList.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 armstorage_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0baf811c3c76c87b3c127d098519bd97141222dd/specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/DeletedAccountList.json
func ExampleDeletedAccountsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armstorage.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewDeletedAccountsClient().NewListPager(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.DeletedAccountListResult = armstorage.DeletedAccountListResult{
// Value: []*armstorage.DeletedAccount{
// {
// Name: to.Ptr("sto1125"),
// Type: to.Ptr("Microsoft.Storage/deletedAccounts"),
// ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Storage/locations/eastus/deletedAccounts/sto1125"),
// Properties: &armstorage.DeletedAccountProperties{
// CreationTime: to.Ptr("2020-08-17T03:35:37.4588848Z"),
// DeletionTime: to.Ptr("2020-08-17T04:41:37.3442475Z"),
// Location: to.Ptr("eastus"),
// RestoreReference: to.Ptr("sto1125|2020-08-17T03:35:37.4588848Z"),
// StorageAccountResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/sto/providers/Microsoft.Storage/storageAccounts/sto1125"),
// },
// },
// {
// Name: to.Ptr("sto1126"),
// Type: to.Ptr("Microsoft.Storage/deletedAccounts"),
// ID: to.Ptr("/subscriptions/{subscription-id}/providers/Microsoft.Storage/locations/eastus/deletedAccounts/sto1126"),
// Properties: &armstorage.DeletedAccountProperties{
// CreationTime: to.Ptr("2020-08-19T15:10:21.5902165Z"),
// DeletionTime: to.Ptr("2020-08-20T06:11:55.1957302Z"),
// Location: to.Ptr("eastus"),
// RestoreReference: to.Ptr("sto1126|2020-08-17T03:35:37.4588848Z"),
// StorageAccountResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/sto/providers/Microsoft.Storage/storageAccounts/sto1126"),
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists deleted accounts under the subscription.
*
* @summary Lists deleted accounts under the subscription.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-01-01/examples/DeletedAccountList.json
*/
async function deletedAccountList() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.deletedAccounts.list()) {
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": [
{
"id": "/subscriptions/{subscription-id}/providers/Microsoft.Storage/locations/eastus/deletedAccounts/sto1125",
"name": "sto1125",
"type": "Microsoft.Storage/deletedAccounts",
"properties": {
"storageAccountResourceId": "/subscriptions/{subscription-id}/resourceGroups/sto/providers/Microsoft.Storage/storageAccounts/sto1125",
"location": "eastus",
"restoreReference": "sto1125|2020-08-17T03:35:37.4588848Z",
"creationTime": "2020-08-17T03:35:37.4588848Z",
"deletionTime": "2020-08-17T04:41:37.3442475Z"
}
},
{
"id": "/subscriptions/{subscription-id}/providers/Microsoft.Storage/locations/eastus/deletedAccounts/sto1126",
"name": "sto1126",
"type": "Microsoft.Storage/deletedAccounts",
"properties": {
"storageAccountResourceId": "/subscriptions/{subscription-id}/resourceGroups/sto/providers/Microsoft.Storage/storageAccounts/sto1126",
"location": "eastus",
"restoreReference": "sto1126|2020-08-17T03:35:37.4588848Z",
"creationTime": "2020-08-19T15:10:21.5902165Z",
"deletionTime": "2020-08-20T06:11:55.1957302Z"
}
}
]
}
Definicje
DeletedAccount
Usunięte konto magazynu
Nazwa |
Typ |
Opis |
id
|
string
|
W pełni kwalifikowany identyfikator zasobu dla zasobu. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
name
|
string
|
Nazwa zasobu
|
properties.creationTime
|
string
|
Czas utworzenia usuniętego konta.
|
properties.deletionTime
|
string
|
Czas usunięcia usuniętego konta.
|
properties.location
|
string
|
Lokalizacja usuniętego konta.
|
properties.restoreReference
|
string
|
Może służyć do próby odzyskania tego usuniętego konta za pośrednictwem interfejsu API PutStorageAccount.
|
properties.storageAccountResourceId
|
string
|
Pełny identyfikator zasobu oryginalnego konta magazynu.
|
type
|
string
|
Typ zasobu. Np. "Microsoft.Compute/virtualMachines" lub "Microsoft.Storage/storageAccounts"
|
DeletedAccountListResult
Odpowiedź z operacji Listy usuniętych kont.
Nazwa |
Typ |
Opis |
nextLink
|
string
|
Adres URL żądania, którego można użyć do wysyłania zapytań do następnej strony usuniętych kont. Zwracane, gdy łączna liczba żądanych usuniętych kont przekracza maksymalny rozmiar strony.
|
value
|
DeletedAccount[]
|
Pobiera listę usuniętych kont i ich właściwości.
|
ErrorResponse
Odpowiedź o błędzie od dostawcy zasobów magazynu.
Nazwa |
Typ |
Opis |
error
|
ErrorResponseBody
|
Treść odpowiedzi dostawcy zasobów usługi Azure Storage.
|
ErrorResponseBody
Kontrakt treści odpowiedzi na błąd.
Nazwa |
Typ |
Opis |
code
|
string
|
Identyfikator błędu. Kody są niezmienne i mają być używane programowo.
|
message
|
string
|
Komunikat opisujący błąd, który ma być odpowiedni do wyświetlania w interfejsie użytkownika.
|