복원 가능한 계정 아래의 모든 Azure Cosmos DB Gremlin 데이터베이스에서 수행된 모든 돌연변이의 이벤트 피드를 표시합니다. 이렇게 하면 삭제 시간을 얻기 위해 데이터베이스가 실수로 삭제된 시나리오에 도움이 됩니다. 이 API에는 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' 권한이 필요합니다.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases?api-version=2024-11-15
URI 매개 변수
Name |
In(다음 안에) |
필수 |
형식 |
Description |
instanceId
|
path |
True
|
string
|
복원 가능한 데이터베이스 계정의 instanceId GUID입니다.
|
location
|
path |
True
|
string
|
단어와 각 단어 사이의 공백이 대문자로 표시된 Cosmos DB 영역입니다.
|
subscriptionId
|
path |
True
|
string
|
대상 구독의 ID입니다.
|
api-version
|
query |
True
|
string
|
이 작업에 사용할 API 버전입니다.
|
응답
보안
azure_auth
Azure Active Directory OAuth2 Flow
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
Name |
Description |
user_impersonation
|
사용자 계정 가장
|
예제
CosmosDBRestorableGremlinDatabaseList
샘플 요청
GET https://management.azure.com/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinDatabases?api-version=2024-11-15
/**
* Samples for RestorableGremlinDatabases List.
*/
public final class Main {
/*
* x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/
* CosmosDBRestorableGremlinDatabaseList.json
*/
/**
* Sample code: CosmosDBRestorableGremlinDatabaseList.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void cosmosDBRestorableGremlinDatabaseList(com.azure.resourcemanager.AzureResourceManager azure) {
azure.cosmosDBAccounts().manager().serviceClient().getRestorableGremlinDatabases().list("WestUS",
"d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.cosmosdb import CosmosDBManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cosmosdb
# USAGE
python cosmos_db_restorable_gremlin_database_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 = CosmosDBManagementClient(
credential=DefaultAzureCredential(),
subscription_id="2296c272-5d55-40d9-bc05-4d56dc2d7588",
)
response = client.restorable_gremlin_databases.list(
location="WestUS",
instance_id="d9b26648-2f53-4541-b3d8-3044f4f9810d",
)
for item in response:
print(item)
# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.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 armcosmos_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ded6306d00ae294c24211e5069c1f56b15ba8ef5/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json
func ExampleRestorableGremlinDatabasesClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcosmos.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewRestorableGremlinDatabasesClient().NewListPager("WestUS", "d9b26648-2f53-4541-b3d8-3044f4f9810d", 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.RestorableGremlinDatabasesListResult = armcosmos.RestorableGremlinDatabasesListResult{
// Value: []*armcosmos.RestorableGremlinDatabaseGetResult{
// {
// Name: to.Ptr("59c21367-b98b-4a8e-abb7-b6f46600decc"),
// Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases"),
// ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableGremlinDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc"),
// Properties: &armcosmos.RestorableGremlinDatabaseProperties{
// Resource: &armcosmos.RestorableGremlinDatabasePropertiesResource{
// Rid: to.Ptr("DLB14gAAAA=="),
// CanUndelete: to.Ptr("invalid"),
// EventTimestamp: to.Ptr("2020-09-02T19:45:03Z"),
// OperationType: to.Ptr(armcosmos.OperationTypeCreate),
// OwnerID: to.Ptr("Database1"),
// OwnerResourceID: to.Ptr("PD5DALigDgw="),
// },
// },
// },
// {
// Name: to.Ptr("8456cb17-cdb0-4c6a-8db8-d0ff3f886257"),
// Type: to.Ptr("Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases"),
// ID: to.Ptr("/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257"),
// Properties: &armcosmos.RestorableGremlinDatabaseProperties{
// Resource: &armcosmos.RestorableGremlinDatabasePropertiesResource{
// Rid: to.Ptr("ESXNLAAAAA=="),
// CanUndelete: to.Ptr("notRestorable"),
// CanUndeleteReason: to.Ptr("Database already exists. Only deleted resources can be restored within same account."),
// EventTimestamp: to.Ptr("2020-09-02T19:53:42Z"),
// OperationType: to.Ptr(armcosmos.OperationTypeDelete),
// OwnerID: to.Ptr("Database1"),
// OwnerResourceID: to.Ptr("PD5DALigDgw="),
// },
// },
// }},
// }
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { CosmosDBManagementClient } = require("@azure/arm-cosmosdb");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission
*
* @summary Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable account. This helps in scenario where database was accidentally deleted to get the deletion time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read' permission
* x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json
*/
async function cosmosDbRestorableGremlinDatabaseList() {
const subscriptionId =
process.env["COSMOSDB_SUBSCRIPTION_ID"] || "2296c272-5d55-40d9-bc05-4d56dc2d7588";
const location = "WestUS";
const instanceId = "d9b26648-2f53-4541-b3d8-3044f4f9810d";
const credential = new DefaultAzureCredential();
const client = new CosmosDBManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (let item of client.restorableGremlinDatabases.list(location, instanceId)) {
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
샘플 응답
{
"value": [
{
"id": "/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/36f09704-6be3-4f33-aa05-17b73e504c75/restorableGremlinDatabases/59c21367-b98b-4a8e-abb7-b6f46600decc",
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases",
"name": "59c21367-b98b-4a8e-abb7-b6f46600decc",
"properties": {
"resource": {
"_rid": "DLB14gAAAA==",
"eventTimestamp": "2020-09-02T19:45:03Z",
"ownerId": "Database1",
"ownerResourceId": "PD5DALigDgw=",
"operationType": "Create",
"canUndelete": "invalid"
}
}
},
{
"id": "/subscriptions/2296c272-5d55-40d9-bc05-4d56dc2d7588/providers/Microsoft.DocumentDb/locations/westus/restorableDatabaseAccounts/d9b26648-2f53-4541-b3d8-3044f4f9810d/restorableGremlinDatabases/8456cb17-cdb0-4c6a-8db8-d0ff3f886257",
"type": "Microsoft.DocumentDB/locations/restorableDatabaseAccounts/restorableGremlinDatabases",
"name": "8456cb17-cdb0-4c6a-8db8-d0ff3f886257",
"properties": {
"resource": {
"_rid": "ESXNLAAAAA==",
"eventTimestamp": "2020-09-02T19:53:42Z",
"ownerId": "Database1",
"ownerResourceId": "PD5DALigDgw=",
"operationType": "Delete",
"canUndelete": "notRestorable",
"canUndeleteReason": "Database already exists. Only deleted resources can be restored within same account."
}
}
}
]
}
정의
CloudError
서비스의 오류 응답입니다.
ErrorResponse
오류 응답입니다.
Name |
형식 |
Description |
code
|
string
|
오류 코드입니다.
|
message
|
string
|
작업이 실패한 이유를 나타내는 오류 메시지입니다.
|
OperationType
이벤트의 작업 유형을 나타내는 열거형입니다.
Name |
형식 |
Description |
Create
|
string
|
|
Delete
|
string
|
|
Recreate
|
string
|
|
Replace
|
string
|
|
SystemOperation
|
string
|
|
Resource
Azure Cosmos DB Gremlin 데이터베이스 이벤트의 리소스
Name |
형식 |
Description |
_rid
|
string
|
시스템 생성 속성입니다. 고유 식별자입니다.
|
canUndelete
|
string
|
동일한 계정에서 이 데이터베이스를 복원할 수 있는지 식별하는 이 데이터베이스의 상태입니다.
|
canUndeleteReason
|
string
|
이 데이터베이스를 동일한 계정으로 복원할 수 없는 이유입니다.
|
eventTimestamp
|
string
|
이 데이터베이스 이벤트가 발생한 시간입니다.
|
operationType
|
OperationType
|
이 데이터베이스 이벤트의 작업 유형입니다.
|
ownerId
|
string
|
이 Gremlin 데이터베이스의 이름입니다.
|
ownerResourceId
|
string
|
이 Gremlin 데이터베이스의 리소스 ID입니다.
|
RestorableGremlinDatabaseGetResult
Azure Cosmos DB Gremlin 데이터베이스 이벤트
Name |
형식 |
Description |
id
|
string
|
ARM 리소스의 고유 리소스 식별자입니다.
|
name
|
string
|
ARM 리소스의 이름입니다.
|
properties.resource
|
Resource
|
Azure Cosmos DB Gremlin 데이터베이스 이벤트의 리소스
|
type
|
string
|
Azure 리소스의 유형입니다.
|
RestorableGremlinDatabasesListResult
Gremlin 데이터베이스 이벤트 및 해당 속성을 포함하는 목록 작업 응답입니다.