この記事では、Data Protection REST API を使用して、Azure Backup 経由でバックアップした Azure Database for PostgreSQL サーバーに PostgreSQL データベースを復元する方法について説明します。 Azure portal、Azure PowerShell、Azure CLI を使用して PostgreSQL データベースを復元することもできます。
PostgreSQL データベースはサービスとしてのプラットフォーム (PaaS) データベースであるため、既存のデータベース (バックアップが作成された場所) を置き換えて復元する Original-Location Recovery (OLR) オプションはサポートされていません。 復旧ポイントから復元して、同じ Azure Database for PostgreSQL サーバーまたは他の PostgreSQL サーバーに新しいデータベースを作成できます。 このオプションは、Alternate-Location Recovery (ALR) と呼ばれます。 ALR は、ソース データベースと復元された (新しい) データベースの両方を保持するのに役立ちます。
前提条件
この記事の例では、リソース グループ TestBkpVault
の下にある testBkpVaultRG
という名前の既存の Backup コンテナーを参照します。
バックアップされた PostgreSQL データベースを復元する
アクセス許可の設定
Backup コンテナーでは、マネージド ID を使用して他の Azure リソースにアクセスします。 バックアップから復元するには、Backup コンテナーのマネージド ID には、データベースの復元先となる Azure Database for PostgreSQL サーバーに対する一連のアクセス許可が必要です。
ターゲット PostgreSQL サーバーでボールトのシステム割り当てマネージド ID に関連するアクセス許可を割り当てるには、PostgreSQL データベースのバックアップに必要なアクセス許可を参照してください。
復旧ポイントをファイルとしてストレージ アカウントに復元するには、バックアップ コンテナーのシステム割り当てマネージド ID が ターゲット ストレージ アカウントにアクセスする必要があります。
適切な回復ポイントを取得する
バックアップ インスタンスで使用可能なすべての復旧ポイントを一覧表示するには、 復旧ポイントの一覧表示 API を使用します。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints?api-version=2021-07-01
たとえば、API は下記のように変換されます。
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/testpostgresql-empdb11-aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/recoveryPoints?api-version=2021-07-01
復旧ポイントの一覧の応答
GET
要求を送信すると、次の応答が返されます。 また、関連する詳細を含むすべての個別の復旧ポイントの一覧も返します。
名前 | 種類 | 説明 |
---|---|---|
200 OK |
AzureBackupRecoveryPointResourceList | 要求が完了しました。 |
その他の状態コード | CloudError | エラー応答は、操作の失敗の理由を示します。 |
応答の例を次に示します。
HTTP/1.1 200 OK
Content-Length: 53396
Content-Type: application/json
Expires: -1
Pragma: no-cache
X-Content-Type-Options: nosniff
x-ms-request-id:
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 11999
x-ms-correlation-request-id: 41f7ef85-f31e-4db7-87ef-115e3ca65b93
x-ms-routing-request-id: SOUTHINDIA:20211022T200018Z:ba3bc1ce-c081-4895-a292-beeeb6eb22cc
Cache-Control: no-cache
Date: Fri, 22 Oct 2021 20:00:18 GMT
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
{
"value": [
{
"properties": {
"objectType": "AzureBackupDiscreteRecoveryPoint",
"recoveryPointId": "eb006fde78cb47198be5a320fbe45e9b",
"recoveryPointTime": "2021-10-21T16:31:16.8316716Z",
"recoveryPointType": "Full",
"friendlyName": "794ead7c7661410da03997d210d469e7",
"recoveryPointDataStoresDetails": [
{
"id": "9ea7eaf4-eeb8-4c8f-90a7-7f04b60bf075",
"type": "VaultStore",
"creationTime": "2021-10-21T16:31:16.8316716Z",
"expiryTime": "2022-10-21T16:31:16.8316716Z",
"metaData": null,
"visible": true,
"state": "COMMITTED",
"rehydrationExpiryTime": null,
"rehydrationStatus": null
}
],
"retentionTagName": "Default",
"retentionTagVersion": "637212748405148394",
"policyName": "osspol3",
"policyVersion": null
},
.
.
.
.
アーカイブ層から復旧ポイントをフェッチするには、type
のrecoveryPointDataStoreDetails
変数をArchiveStore
として変更します。
前の一覧から関連する復旧ポイントを選択し、復元要求を準備します。 この記事では、前の一覧の 794ead7c7661410da03997d210d469e7
という名前の復旧ポイントを使用して復元します。
復元要求を準備する
PostgreSQL データベースにはさまざまな復元オプションがあります。 回復ポイントを別のデータベースとして復元したり、ファイルとして復元したりすることができます。 復旧ポイントは、アーカイブ層に配置することもできます。
データベースとして復元する
アクセス許可が割り当てられたターゲット PostgreSQL サーバーを使用して、作成する新しい PostgreSQL データベースの Azure Resource Manager ID を構築します (前述)。 必要な PostgreSQL データベース名を含めます。 たとえば、PostgreSQL データベースは、別のサブスクリプションを持つリソース グループ emprestored21
の targetossserver
という名前のターゲット PostgreSQL サーバーの下にtargetrg
名前を付けることができます。
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx/resourceGroups/targetrg/providers/providers/Microsoft.DBforPostgreSQL/servers/targetossserver/databases/emprestored21"
次の要求本文には、復旧ポイント ID と復元ターゲットの詳細が含まれています。
{
"restoreRequestObject": {
"objectType": "AzureBackupRecoveryPointBasedRestoreRequest",
"sourceDataStoreType": "VaultStore",
"restoreTargetInfo": {
"objectType": "restoreTargetInfo",
"recoveryOption": "FailIfExists",
"dataSourceInfo": {
"objectType": "Datasource",
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver/databases/emprestored21",
"resourceName": "emprestored21",
"resourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceLocation": "westus",
"resourceUri": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver/databases/emprestored21",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases"
},
"dataSourceSetInfo": {
"objectType": "DatasourceSet",
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver",
"resourceName": "targetossserver",
"resourceType": "Microsoft.DBforPostgreSQL/servers",
"resourceLocation": "westus",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases"
},
"datasourceAuthCredentials": {
"objectType": "SecretStoreBasedAuthCredentials",
"secretStoreResource": {
"secretStoreType": "AzureKeyVault",
"uri": "https://vikottur-test.vault.azure.net/secrets/dbauth3",
"value": null
}
},
"restoreLocation": "westus"
},
"recoveryPointId": "eb006fde78cb47198be5a320fbe45e9b"
}
}
アーカイブ ベースの復旧ポイントの場合は、次の手順を実行する必要があります。
- アーカイブ データストアからコンテナー データストアにリハイドレートします。
- ソース データストアを変更します。
- リハイドレートの優先度を指定するための他のパラメーターを追加します。
- リハイドレートされた復旧ポイントをコンテナー データストアに保持する期間を指定します。
{
"restoreRequestObject": {
"objectType": "AzureBackupRecoveryPointBasedRestoreRequest",
"sourceDataStoreType": "ArchiveStore",
"restoreTargetInfo": {
"objectType": "restoreTargetInfo",
"recoveryOption": "FailIfExists",
"dataSourceInfo": {
"objectType": "Datasource",
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver/databases/emprestored21",
"resourceName": "emprestored21",
"resourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceLocation": "westus",
"resourceUri": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver/databases/emprestored21",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases"
},
"dataSourceSetInfo": {
"objectType": "DatasourceSet",
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver",
"resourceName": "targetossserver",
"resourceType": "Microsoft.DBforPostgreSQL/servers",
"resourceLocation": "westus",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases"
},
"datasourceAuthCredentials": {
"objectType": "SecretStoreBasedAuthCredentials",
"secretStoreResource": {
"secretStoreType": "AzureKeyVault",
"uri": "https://vikottur-test.vault.azure.net/secrets/dbauth3",
"value": null
}
},
"restoreLocation": "westus"
},
"recoveryPointId": "eb006fde78cb47198be5a320fbe45e9b",
"rehydration_priority": "Standard",
"rehydration_retention_duration": "P15D",
}
}
ファイルとして復元
前述のように、アクセス許可が割り当てられたストレージ アカウント内のコンテナーの URI をフェッチします。 たとえば、別のサブスクリプションを持つ testcontainerrestore
という名前のストレージ アカウントの下に、testossstorageaccount
という名前のコンテナーを使用します。
"https://testossstorageaccount.blob.core.windows.net/testcontainerrestore"
{
"objectType": "ValidateRestoreRequestObject",
"restoreRequestObject": {
"objectType": "AzureBackupRecoveryPointBasedRestoreRequest",
"sourceDataStoreType": "VaultStore",
"restoreTargetInfo": {
"targetDetails": {
"url": "https://testossstorageaccount.blob.core.windows.net/testcontainerrestore",
"filePrefix": "empdb11_postgresql-westus_1628853549768",
"restoreTargetLocationType": "AzureBlobs"
},
"restoreLocation": "westus",
"recoveryOption": "FailIfExists",
"objectType": "RestoreFilesTargetInfo"
},
"recoveryPointId": "eb006fde78cb47198be5a320fbe45e9b"
}
}
アーカイブ ベースの復旧ポイントの場合は、ソース データストアを変更します。 リハイドレートされた復元ポイントのリハイドレーションの優先順位とリテンション期間 (日数) を追加します。
{
"objectType": "ValidateRestoreRequestObject",
"restoreRequestObject": {
"objectType": "AzureBackupRecoveryPointBasedRestoreRequest",
"sourceDataStoreType": "ArchiveStore",
"restoreTargetInfo": {
"targetDetails": {
"url": "https://testossstorageaccount.blob.core.windows.net/testcontainerrestore",
"filePrefix": "empdb11_postgresql-westus_1628853549768",
"restoreTargetLocationType": "AzureBlobs"
},
"restoreLocation": "westus",
"recoveryOption": "FailIfExists",
"objectType": "RestoreFilesTargetInfo"
},
"recoveryPointId": "eb006fde78cb47198be5a320fbe45e9b",
"rehydration_priority": "Standard",
"rehydration_retention_duration": "P15D",
}
}
復元要求を検証する
要求本文を準備したら、 Validate For Restore API を使用して検証します。 バックアップの検証 API と同様に、この API は POST
操作です。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore?api-version=2021-07-01
たとえば、上記の API は次のように変換されます。
POST "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/testpostgresql-empdb11-aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/ValidateRestore?api-version=2021-07-01"
復元要求を検証するためのリクエスト本文
前のセクションで要求本文を作成しました。 次に、オブジェクトの種類を追加し、それを使用して検証操作をトリガーします。
{
"objectType": "ValidateRestoreRequestObject",
"recoveryPointId": "eb006fde78cb47198be5a320fbe45e9b",
"restoreRequestObject": {
"objectType": "AzureBackupRecoveryPointBasedRestoreRequest",
"sourceDataStoreType": "VaultStore",
"restoreTargetInfo": {
"objectType": "restoreTargetInfo",
"recoveryOption": "FailIfExists",
"dataSourceInfo": {
"objectType": "Datasource",
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver/databases/emprestored21",
"resourceName": "emprestored21",
"resourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceLocation": "westus",
"resourceUri": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver/databases/emprestored21",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases"
},
"dataSourceSetInfo": {
"objectType": "DatasourceSet",
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver",
"resourceName": "targetossserver",
"resourceType": "Microsoft.DBforPostgreSQL/servers",
"resourceLocation": "westus",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases"
},
"datasourceAuthCredentials": {
"objectType": "SecretStoreBasedAuthCredentials",
"secretStoreResource": {
"secretStoreType": "AzureKeyVault",
"uri": "https://vikottur-test.vault.azure.net/secrets/dbauth3",
"value": null
}
},
"restoreLocation": "westus"
}
}
}
復元要求を検証するための応答
復元要求の検証は 非同期操作です。 そのため、この操作は、個別に追跡する必要がある別の操作を作成します。
この操作では、次の応答が返されます。
名前 | 種類 | 説明 |
---|---|---|
200 OK(正常に処理されました) | 操作が完了しました。 | |
202 承認されました | 要求は受け入れられます。 別の操作が作成されます。 |
POST
操作が送信されると、次の応答例に示すように、202 Accepted
ヘッダーを含むAzure-asyncOperation
として最初の応答が返されます。
HTTP/1.1 202 Accepted
Content-Length: 0
Expires: -1
Pragma: no-cache
Retry-After: 10
Azure-AsyncOperation: https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzVlNzMxZDBiLTQ3MDQtNDkzNS1hYmNjLWY4YWEzY2UzNTk1ZQ==?api-version=2021-07-01
X-Content-Type-Options: nosniff
x-ms-request-id:
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-writes: 1199
x-ms-correlation-request-id: bae60c92-669d-45a4-aed9-8392cca7cc8d
x-ms-routing-request-id: CENTRALUSEUAP:20210708T205935Z:f51db7a4-9826-4084-aa3b-ae640dc78af6
Cache-Control: no-cache
Date: Thu, 08 Jul 2021 20:59:35 GMT
Location: https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationResults/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzVlNzMxZDBiLTQ3MDQtNDkzNS1hYmNjLWY4YWEzY2UzNTk1ZQ==?api-version=2021-07-01
X-Powered-By: ASP.NET
単純なAzure-AsyncOperation
要求を使用して、GET
ヘッダーを追跡します。 要求が成功すると、状態応答を含む 200 OK
が返されます。
GET https://management.azure.com/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/providers/Microsoft.DataProtection/locations/westus/operationStatus/YWJjMGRmMzQtNTY1NS00MGMyLTg4YmUtMTUyZDE3ZjdiNzMyOzY4NDNmZWZkLWU4ZTMtNDM4MC04ZTJhLWUzMTNjMmNhNjI1NA==?api-version=2021-07-01
{
"id": "/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/providers/Microsoft.DataProtection/locations/westus/operationStatus/YWJjMGRmMzQtNTY1NS00MGMyLTg4YmUtMTUyZDE3ZjdiNzMyOzY4NDNmZWZkLWU4ZTMtNDM4MC04ZTJhLWUzMTNjMmNhNjI1NA==",
"name": "YWJjMGRmMzQtNTY1NS00MGMyLTg4YmUtMTUyZDE3ZjdiNzMyOzY4NDNmZWZkLWU4ZTMtNDM4MC04ZTJhLWUzMTNjMmNhNjI1NA==",
"status": "Inprogress",
"startTime": "2021-10-22T20:22:41.0305623Z",
"endTime": "0001-01-01T00:00:00Z"
}
応答は、復元要求を送信する前に解決する必要があるエラーを示します。 次の例は、ターゲット データベースが下位バージョンであるため、復元できない場合の動作を表しています。
---------- Response (1892 ms) ------------
HTTP/1.1 200 OK
Content-Length: 1236
Content-Type: application/json
Expires: -1
Pragma: no-cache
X-Content-Type-Options: nosniff
x-ms-request-id:
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 11999
x-ms-correlation-request-id: 784764f8-941d-4f05-8d8c-c02d2c05f799
x-ms-routing-request-id: SOUTHINDIA:20211022T202725Z:e109a061-a09e-4f13-acd0-9b9833f851ac
Cache-Control: no-cache
Date: Fri, 22 Oct 2021 20:27:25 GMT
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
{
"id": "/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/providers/Microsoft.DataProtection/locations/westus/operationStatus/YWJjMGRmMzQtNTY1NS00MGMyLTg4YmUtMTUyZDE3ZjdiNzMyOzY4NDNmZWZkLWU4ZTMtNDM4MC04ZTJhLWUzMTNjMmNhNjI1NA==",
"name": "YWJjMGRmMzQtNTY1NS00MGMyLTg4YmUtMTUyZDE3ZjdiNzMyOzY4NDNmZWZkLWU4ZTMtNDM4MC04ZTJhLWUzMTNjMmNhNjI1NA==",
"status": "Failed",
"error": {
"additionalInfo": [
{
"type": "UserFacingError",
"info": {
"message": "Restoring backups of a higher PostgreSQL version to a lower version is not supported.",
"recommendedAction": [
"Restore to the same or a higher PostgreSQL version from which the backup was taken."
],
"code": "UserErrorRestoreToLowerVersion",
"target": "",
"innerError": {
"code": "InnerErrorCodeUnavailable",
"additionalInfo": {
"DetailedNonLocalisedMessage": "Restoring backup from version:10 of PostgreSQL to 9.5 of PostgreSQL not supported, as the restore server version is lower."
}
},
"isRetryable": false,
"isUserError": false,
"properties": {
"ActivityId": "2a23524f-0217-4bc1-bbe8-1546d2e6204d-Ibz"
}
}
}
],
"code": "UserErrorRestoreToLowerVersion",
"message": "Restoring backups of a higher PostgreSQL version to a lower version is not supported."
},
"startTime": "2021-10-22T20:22:41.0305623Z",
"endTime": "2021-10-22T20:23:11Z"
}
エラーを修正して要求を再検証すると、 200 OK
と成功応答が返されます。
HTTP/1.1 200 OK
Content-Length: 443
Content-Type: application/json
Expires: -1
Pragma: no-cache
X-Content-Type-Options: nosniff
x-ms-request-id:
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-reads: 11999
x-ms-correlation-request-id: 61d62dd8-8e1a-473c-bcc6-c6a7a19fb035
x-ms-routing-request-id: SOUTHINDIA:20211022T203846Z:89af04a6-4e91-4b64-8998-a369dc763408
Cache-Control: no-cache
Date: Fri, 22 Oct 2021 20:38:46 GMT
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
{
"id": "/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/providers/Microsoft.DataProtection/locations/westus/operationStatus/YWJjMGRmMzQtNTY1NS00MGMyLTg4YmUtMTUyZDE3ZjdiNzMyOzU0NDI4YzdhLTJjNWEtNDNiOC05ZjBjLTM2NmQ3ZWVjZDUxOQ==",
"name": "YWJjMGRmMzQtNTY1NS00MGMyLTg4YmUtMTUyZDE3ZjdiNzMyOzU0NDI4YzdhLTJjNWEtNDNiOC05ZjBjLTM2NmQ3ZWVjZDUxOQ==",
"status": "Succeeded",
"startTime": "2021-10-22T20:28:24.3820169Z",
"endTime": "2021-10-22T20:28:49Z"
}
復元要求をトリガーする
復元要求をトリガーする操作は、 POST
API です。
この操作の詳細については、こちらを参照してください。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore?api-version=2021-07-01
たとえば、API は下記のように変換されます。
POST "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/testpostgresql-empdb11-aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/restore?api-version=2021-07-01"
復元操作のための要求本文を作成する
要求が検証されたら、同じ要求本文 (小さな変更あり) を使用して復元要求をトリガーします。
次の例に示すように、復元要求を検証するための要求本文からの唯一の変更は、開始時に restoreRequest
オブジェクトを削除することです。
{
"objectType": "AzureBackupRecoveryPointBasedRestoreRequest",
"sourceDataStoreType": "VaultStore",
"restoreTargetInfo": {
"objectType": "restoreTargetInfo",
"recoveryOption": "FailIfExists",
"dataSourceInfo": {
"objectType": "Datasource",
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver/databases/emprestored21",
"resourceName": "emprestored21",
"resourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceLocation": "westus",
"resourceUri": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver/databases/emprestored21",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases"
},
"dataSourceSetInfo": {
"objectType": "DatasourceSet",
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/targetrg/providers/Microsoft.DBforPostgreSQL/servers/targetossserver",
"resourceName": "targetossserver",
"resourceType": "Microsoft.DBforPostgreSQL/servers",
"resourceLocation": "westus",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases"
},
"datasourceAuthCredentials": {
"objectType": "SecretStoreBasedAuthCredentials",
"secretStoreResource": {
"secretStoreType": "AzureKeyVault",
"uri": "https://vikottur-test.vault.azure.net/secrets/dbauth3",
"value": null
}
},
"restoreLocation": "westus"
},
"recoveryPointId": "eb006fde78cb47198be5a320fbe45e9b"
}
復元要求のトリガーに対する応答
復元要求をトリガーする操作は 非同期です。 そのため、この操作では、個別に追跡する必要がある別の操作が作成されます。
この操作では、次の応答が返されます。
名前 | 種類 | 説明 |
---|---|---|
200 OK |
操作が完了しました。 | |
202 Accepted |
要求は受け入れられます。 別の操作が作成されます。 |
POST
操作が送信されると、次の応答例に示すように、202 Accepted
ヘッダーを含むAzure-asyncOperation
として最初の応答が返されます。
HTTP/1.1 202 Accepted
Content-Length: 0
Expires: -1
Pragma: no-cache
Retry-After: 30
Azure-AsyncOperation: https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExO2Q1NDIzY2VjLTczYjYtNDY5ZC1hYmRjLTc1N2Q0ZTJmOGM5OQ==?api-version=2021-07-01
X-Content-Type-Options: nosniff
x-ms-request-id:
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-writes: 1197
x-ms-correlation-request-id: 8661209c-5b6a-44fe-b676-4e2b9c296593
x-ms-routing-request-id: CENTRALUSEUAP:20210708T204652Z:69e3fa4b-c5d9-4601-9410-598006ada187
Cache-Control: no-cache
Date: Thu, 08 Jul 2021 20:46:52 GMT
Location: https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationResults/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExO2Q1NDIzY2VjLTczYjYtNDY5ZC1hYmRjLTc1N2Q0ZTJmOGM5OQ==?api-version=2021-07-01
X-Powered-By: ASP.NET
単純なAzure-AsyncOperation
要求を使用して、GET
ヘッダーを追跡します。 要求が成功すると、復元要求の完了のためにさらに追跡する必要があるジョブ ID を持つ 200 OK
が返されます。
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExO2Q1NDIzY2VjLTczYjYtNDY5ZC1hYmRjLTc1N2Q0ZTJmOGM5OQ==?api-version=2021-07-01
{
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExO2Q1NDIzY2VjLTczYjYtNDY5ZC1hYmRjLTc1N2Q0ZTJmOGM5OQ==",
"name": "ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExO2Q1NDIzY2VjLTczYjYtNDY5ZC1hYmRjLTc1N2Q0ZTJmOGM5OQ==",
"status": "Succeeded",
"startTime": "2021-07-08T20:46:52.4110868Z",
"endTime": "2021-07-08T20:46:56Z",
"properties": {
"jobId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupJobs/cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a",
"objectType": "OperationJobExtendedInfo"
}
}
ジョブを追跡する
復元ジョブがトリガーされたら、 GET ジョブ API を使用して、結果のジョブ ID を追跡できます。
トリガーGET
でjobId
値を追跡するには、次の コマンドを使用します。
GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupJobs/cccc2c2c-dd3d-ee4e-ff5f-aaaaaa6a6a6a?api-version=2021-07-01
ジョブの状態は、復元ジョブが完了していることを示します。