이 문서에서는 Azure Backup용 데이터 보호 REST API를 사용하여 Azure Database for PostgreSQL에서 PostgreSQL 데이터베이스에 대한 백업을 구성하는 방법을 설명합니다. Azure Portal, Azure PowerShell 및 AzureCLI for PostgreSQL 데이터베이스를 사용하여 백업을 구성할 수도 있습니다.
Azure Database for PostgreSQL에서 PostgreSQL 데이터베이스 백업에 대해 지원되는 시나리오, 제한 사항 및 인증 메커니즘에 대한 자세한 내용은 개요 문서를 참조하세요.
필수 구성 요소
백업 구성
금고 및 정책을 만든 후, Azure Database for PostgreSQL에서 PostgreSQL 데이터베이스를 백업할 때 고려해야 할 세 가지 핵심 사항이 있습니다.
주요 엔터티 이해
백업할 PostgreSQL 데이터베이스
백업할 PostgreSQL 데이터베이스의 Azure Resource Manager ID를 가져옵니다. 이 ID는 데이터베이스의 식별자 역할을 합니다. 다음 예제에서는 다른 구독의 리소스 그룹 empdb11
에 있는 PostgreSQL 서버 testposgresql
에 포함된 ossrg
라고 명명된 데이터베이스를 사용합니다. 이 예제에서는 Bash를 사용합니다.
"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx/resourcegroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql/databases/empdb11"
키 보관소
Azure Backup 서비스는 PostgreSQL 데이터베이스에 연결하기 위한 사용자 이름과 암호를 저장하지 않습니다. 대신 백업 관리자는 키를 키 보관소에 저장합니다. 그런 다음, Azure Backup 서비스는 키 자격 증명 모음에 액세스하고, 키를 읽고, 데이터베이스에 액세스합니다.
다음 예제에서는 Bash를 사용합니다. 관련 키의 비밀 식별자를 기록해 둡니다.
"https://testkeyvaulteus.vault.azure.net/secrets/ossdbkey"
Backup 자격 증명 모음
백업 볼트는 PostgreSQL 서버에 연결한 다음 키 볼트에 있는 키를 통해 데이터베이스에 액세스해야 합니다. 따라서 백업 금고에는 PostgreSQL 서버 및 키 저장소에 대한 액세스 권한이 필요합니다. 백업 금고의 관리 ID에 액세스 권한이 부여됩니다.
PostgreSQL 서버 및 데이터베이스 키를 저장하는 키 보관소에 대해 Backup 보관소의 관리 ID에 권한을 부여해야 합니다. 자세히 알아보기.
요청 준비
관련 권한을 금고와 PostgreSQL 데이터베이스에 설정하고, 금고와 정책을 구성한 후 백업 구성을 위한 요청을 준비합니다. 다음 요청 본문을 사용하여 PostgreSQL 데이터베이스에 대한 백업을 구성합니다. PostgreSQL 데이터베이스의 Resource Manager ID 및 해당 세부 정보는 섹션에 dataSourceInfo
있습니다. 정책 정보는 섹션에 있습니다 policyInfo
.
{
"backupInstance": {
"dataSourceInfo": {
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql/databases/empdb11",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceName": "empdb11",
"resourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceLocation": "westUS",
"objectType": "Datasource"
},
"dataSourceSetInfo": {
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceName": "testpostgresql",
"resourceType": "Microsoft.DBforPostgreSQL/servers",
"resourceLocation": "westUS",
"objectType": "DatasourceSet"
},
"policyInfo": {
"policyId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupPolicies/osspol3",
"policyVersion": ""
},
"objectType": "BackupInstance"
}
}
백업을 구성하기 위한 요청의 유효성 검사
백업 구성 요청이 성공했는지 확인하려면 Backup에 대한 유효성 검사 API를 사용합니다. 응답을 사용하여 필수 조건을 수행한 다음 백업 요청에 대한 구성을 제출할 수 있습니다.
백업 요청의 유효성 검사는 POST
작업입니다. URI에는 다음과 같은 {subscriptionId}
매개 변수가 포함됩니다{vaultName}
.{vaultresourceGroupName}
POST https://management.azure.com/Subscriptions/{subscriptionId}/resourceGroups/{vaultresourceGroupname}/providers/Microsoft.DataProtection/backupVaults/{backupVaultName}/validateForBackup?api-version=2021-01-01
예를 들어 앞의 API는 다음으로 변환됩니다.
POST https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/validateForBackup?api-version=2021-01-01
이전에 준비한 요청 본문 은 백업할 PostgreSQL 데이터베이스에 대한 세부 정보를 제공합니다.
요청 본문 예제
{
"backupInstance": {
"dataSourceInfo": {
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql/databases/empdb11",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceName": "empdb11",
"resourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceLocation": "westUS",
"objectType": "Datasource"
},
"dataSourceSetInfo": {
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceName": "testpostgresql",
"resourceType": "Microsoft.DBforPostgreSQL/servers",
"resourceLocation": "westUS",
"objectType": "DatasourceSet"
},
"policyInfo": {
"policyId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupPolicies/osspol3",
"policyVersion": ""
},
"objectType": "BackupInstance"
}
}
백업 요청 유효성 검사에 대한 응답
백업 요청 유효성 검사는 비동기 작업입니다. 따라서 이 작업은 별도로 추적해야 하는 다른 작업을 만듭니다.
작업은 다음 응답을 반환합니다.
이름 | 형식 | 설명 |
---|---|---|
202 Accepted |
새로운 작업이 생성됩니다. 작업이 비동기적으로 완료됩니다. | |
200 OK |
OperationJobExtendedInfo |
작업이 완료되었습니다. |
기타 상태 코드 | CloudError |
오류 응답은 작업이 실패한 이유를 설명합니다. |
오류 응답 예제
디스크가 백업용으로 이미 구성된 경우 응답을 HTTP 400 Bad request
로 반환합니다. 응답에 따르면 디스크는 볼트에 백업되고 세부 정보는 다음과 같습니다.
HTTP/1.1 400 BadRequest
Content-Length: 1012
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-writes: 1199
x-ms-correlation-request-id: 0c99ff0f-6c26-4ec7-899f-205435e89894
x-ms-routing-request-id: WESTUS:20210830T142949Z:0be72802-02ad-485d-b91f-4aadd92c059c
Cache-Control: no-cache
Date: Mon, 30 Aug 2021 14:29:49 GMT
X-Powered-By: ASP.NET
{
"error": {
"additionalInfo": [
{
"type": "UserFacingError",
"info": {
"message": "Datasource is already protected under the Backup vault /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault.",
"recommendedAction": [
"Delete the backup instance testpostgresql-empdb11-957d23b1-c679-4c94-ade6-c4d34635e149 from the Backup vault /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault to re-protect the datasource in any other vault."
],
"details": null,
"code": "UserErrorDppDatasourceAlreadyProtected",
"target": "",
"innerError": null,
"isRetryable": false,
"isUserError": false,
"properties": {
"ActivityId": "0c99ff0f-6c26-4ec7-899f-205435e89894"
}
}
}
],
"code": "UserErrorDppDatasourceAlreadyProtected",
"message": "Datasource is already protected under the Backup vault /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault.",
"target": null,
"details": null
}
}
예제 추적 응답
데이터 원본이 보호되지 않으면 API는 추가 유효성 검사를 진행하고 추적 작업을 만듭니다.
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/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==?api-version=2021-01-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: 3e7cacb3-65cd-4b3c-8145-71fe90d57327
x-ms-routing-request-id: WESTUS:20210707T124850Z:105f2105-6db1-44bf-8a34-45972a8ba861
Cache-Control: no-cache
Date: Wed, 07 Jul 2021 12:48:50 GMT
Location: https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationResults/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==?api-version=2021-01-01
X-Powered-By: ASP.NET
Azure-AsyncOperation
헤더를 사용하여 간단한 GET
명령으로 결과 작업을 추적합니다.
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==?api-version=2021-01-01
{
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==",
"name": "ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==",
"status": "Inprogress",
"startTime": "2021-07-07T12:48:50.3432229Z",
"endTime": "0001-01-01T00:00:00"
}
작업이 완료되면 200 OK
를 반환합니다. 그런 다음 응답 본문에는 다음과 같은 추가 요구 사항(예: 사용 권한)이 나열됩니다.
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==?api-version=2021-01-01
{
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==",
"name": "ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzM2NDdhZDNjLTFiNGEtNDU4YS05MGJkLTQ4NThiYjRhMWFkYg==",
"status": "Failed",
"error": {
"additionalInfo": [
{
"type": "UserFacingError",
"info": {
"message": "Appropriate permissions to perform the operation is missing.",
"recommendedAction": [
"Grant appropriate permissions to perform this operation as mentioned at https://aka.ms/UserErrorMissingRequiredPermissions and retry the operation."
],
"code": "UserErrorMissingRequiredPermissions",
"target": "",
"innerError": {
"code": "UserErrorMissingRequiredPermissions",
"additionalInfo": {
"DetailedNonLocalisedMessage": "Validate for Protection failed. Exception Message: The client '00001111-aaaa-2222-bbbb-3333cccc4444' with object id 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb' does not have authorization to perform action 'Microsoft.Authorization/roleAssignments/read' over scope '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql/providers/Microsoft.Authorization' or the scope is invalid. If access was recently granted, please refresh your credentials."
}
},
"isRetryable": false,
"isUserError": false,
"properties": {
"ActivityId": "3e7cacb3-65cd-4b3c-8145-71fe90d57327"
}
}
}
],
"code": "UserErrorMissingRequiredPermissions",
"message": "Appropriate permissions to perform the operation is missing."
},
"startTime": "2021-07-07T12:48:50.3432229Z",
"endTime": "2021-07-07T12:49:22Z"
}
모든 권한을 부여하는 경우 유효성 검사 요청을 다시 제출하고 결과 작업을 추적합니다. 모든 조건이 충족되면 성공 응답을 200 OK
반환합니다.
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzlhMjk2YWM2LWRjNDMtNGRjZS1iZTU2LTRkZDNiMDhjZDlkOA==?api-version=2021-01-01
{
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzlhMjk2YWM2LWRjNDMtNGRjZS1iZTU2LTRkZDNiMDhjZDlkOA==",
"name": "ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzlhMjk2YWM2LWRjNDMtNGRjZS1iZTU2LTRkZDNiMDhjZDlkOA==",
"status": "Succeeded",
"startTime": "2021-07-07T13:03:54.8627251Z",
"endTime": "2021-07-07T13:04:06Z"
}
백업 요청 구성
요청의 유효성을 검사한 후 Backup 인스턴스 만들기 API에 요청을 제출할 수 있습니다. Azure Backup의 데이터 보호 서비스는 백업 볼트 내에서 백업 인스턴스를 보호하는 데 도움이 됩니다. 여기서 PostgreSQL 데이터베이스는 백업 인스턴스입니다. 이전에 유효성이 검사된 요청 본문을 사소한 추가와 함께 사용합니다.
백업 인스턴스에 고유한 이름을 사용합니다. 리소스 이름과 고유 식별자의 조합을 사용하는 것이 좋습니다. 예를 들어, 다음 작업에서는 testpostgresql-empdb11-957d23b1-c679-4c94-ade6-c4d34635e149
을 사용하여 그것을 백업 인스턴스의 이름으로 지정합니다.
백업 인스턴스를 만들거나 업데이트하려면 다음 PUT
작업을 사용합니다.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/{BkpvaultName}/backupInstances/{UniqueBackupInstanceName}?api-version=2021-01-01
예를 들어 앞의 API는 다음으로 변환됩니다.
PUT https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/testpostgresql-empdb11-957d23b1-c679-4c94-ade6-c4d34635e149?api-version=2021-01-01
백업 구성 요청
백업 인스턴스를 만들려면 요청 본문에서 다음 구성 요소를 사용합니다.
이름 | 형식 | 설명 |
---|---|---|
properties |
BackupInstance |
BackupInstanceResource 속성 |
다음 예제 요청은 고유한 이름으로 백업 요청의 유효성을 검사하는 데 사용한 것과 동일한 요청 본문을 사용합니다.
{
"name": "testpostgresql-empdb11-957d23b1-c679-4c94-ade6-c4d34635e149",
"type": "Microsoft.DataProtection/backupvaults/backupInstances",
"properties": {
"dataSourceInfo": {
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql/databases/empdb11",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceName": "empdb11",
"resourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceLocation": "westUS",
"objectType": "Datasource"
},
"dataSourceSetInfo": {
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceName": "testpostgresql",
"resourceType": "Microsoft.DBforPostgreSQL/servers",
"resourceLocation": "westUS",
"objectType": "DatasourceSet"
},
"policyInfo": {
"policyId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupPolicies/osspol3",
"policyVersion": ""
}
},
"objectType": "BackupInstance"
}
}
백업 요청 구성에 대한 응답
백업 인스턴스 요청을 만드는 작업은 비동기 작업입니다. 따라서 이 작업은 별도로 추적해야 하는 다른 작업을 만듭니다.
작업은 다음 응답을 반환합니다.
이름 | 형식 | 설명 |
---|---|---|
201 Created |
백업 인스턴스 | 백업 인스턴스가 만들어지고 보호가 구성됩니다. |
200 OK |
백업 인스턴스 | 보호가 구성됩니다. |
기타 상태 코드 | CloudError | 오류 응답은 작업이 실패한 이유를 설명합니다. |
백업 인스턴스를 만들기 위한 PUT
요청을 제출하면 201 Created
헤더와 함께 Azure-asyncOperation
초기 응답이 제공됩니다. 다음 예제에서는 요청 본문에 모든 백업 인스턴스 속성이 포함되어 있습니다.
HTTP/1.1 201 Created
Content-Length: 1149
Content-Type: application/json
Expires: -1
Pragma: no-cache
Retry-After: 15
Azure-AsyncOperation: https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzI1NWUwNmFlLTI5MjUtNDBkNy1iMjMxLTM0ZWZlMDA3NjdkYQ==?api-version=2021-01-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: 5d9ccf1b-7ac1-456d-8ae3-36c93c0d2427
x-ms-routing-request-id: WESTUS:20210707T170219Z:9e897266-5d86-4d13-b298-6561c60cf043
Cache-Control: no-cache
Date: Wed, 07 Jul 2021 17:02:18 GMT
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
{
"properties": {
"friendlyName": "testpostgresql-empdb11-957d23b1-c679-4c94-ade6-c4d34635e149",
"dataSourceInfo": {
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql/databases/empdb11",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceName": "empdb11",
"resourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceLocation": "westUS",
"objectType": "Datasource"
},
"dataSourceSetInfo": {
"resourceID": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/ossdemoRG/providers/Microsoft.DBforPostgreSQL/servers/testpostgresql",
"resourceUri": "",
"datasourceType": "Microsoft.DBforPostgreSQL/servers/databases",
"resourceName": "testpostgresql",
"resourceType": "Microsoft.DBforPostgreSQL/servers",
"resourceLocation": "westUS",
"objectType": "DatasourceSet"
},
"policyInfo": {
"policyId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupPolicies/osspol3",
"policyVersion": ""
},
"protectionStatus": {
"status": "ProtectionConfigured"
},
"currentProtectionState": "ProtectionConfigured",
"provisioningState": "Succeeded",
"objectType": "BackupInstance"
},
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/testBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/testpostgresql-empdb11-957d23b1-c679-4c94-ade6-c4d34635e149",
"name": "testpostgresql-empdb11-957d23b1-c679-4c94-ade6-c4d34635e149",
"type": "Microsoft.DataProtection/backupVaults/backupInstances"
}
Azure-AsyncOperation
헤더를 사용하여 간단한 GET
명령으로 결과 작업을 추적합니다.
GET https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzI1NWUwNmFlLTI5MjUtNDBkNy1iMjMxLTM0ZWZlMDA3NjdkYQ==?api-version=2021-01-01
작업이 완료되면 200 OK
메시지가 응답 본문에 포함되어 Succeeded
로 반환됩니다.
{
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzI1NWUwNmFlLTI5MjUtNDBkNy1iMjMxLTM0ZWZlMDA3NjdkYQ==",
"name": "ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzI1NWUwNmFlLTI5MjUtNDBkNy1iMjMxLTM0ZWZlMDA3NjdkYQ==",
"status": "Succeeded",
"startTime": "2021-07-07T17:02:19.0611871Z",
"endTime": "2021-07-07T17:02:20Z"
}
보호 중지 및 데이터 삭제
PostgreSQL 데이터베이스에서 보호를 제거하고 백업 데이터를 삭제하려면 DELETE 작업을 수행합니다.
DELETE https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}?api-version=2021-01-01
예를 들어 앞의 API는 다음으로 변환됩니다.
DELETE "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/TestBkpVaultRG/providers/Microsoft.DataProtection/backupVaults/testBkpVault/backupInstances/testpostgresql-empdb11-957d23b1-c679-4c94-ade6-c4d34635e149?api-version=2021-01-01"
보호 중지 및 데이터 삭제에 대한 응답
DELETE
는 비동기 작업입니다. 따라서 이 작업은 별도로 추적해야 하는 다른 작업을 만듭니다.
작업은 다음 응답을 반환합니다.
이름 | 형식 | 설명 |
---|---|---|
200 OK |
작업이 완료되었습니다. | |
202 Accepted |
작업이 승인되었습니다. 새로운 작업이 생성됩니다. |
요청을 제출 DELETE
한 후 초기 응답은 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/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzE1ZjM4YjQ5LWZhMGQtNDMxOC1iYjQ5LTExMDJjNjUzNjM5Zg==?api-version=2021-01-01
X-Content-Type-Options: nosniff
x-ms-request-id:
Strict-Transport-Security: max-age=31536000; includeSubDomains
x-ms-ratelimit-remaining-subscription-deletes: 14999
x-ms-correlation-request-id: fee7a361-b1b3-496d-b398-60fed030d5a7
x-ms-routing-request-id: WESTUS:20210708T071330Z:5c3a9f3e-53aa-4d5d-bf9a-20de5601b090
Cache-Control: no-cache
Date: Thu, 08 Jul 2021 07:13:29 GMT
Location: https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationResults/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzE1ZjM4YjQ5LWZhMGQtNDMxOC1iYjQ5LTExMDJjNjUzNjM5Zg==?api-version=2021-01-01
X-Powered-By: ASP.NET
간단한 Azure-AsyncOperation
요청으로 GET
헤더를 추적합니다. 요청이 성공하면 상태 응답을 반환합니다 200 OK
.
GET "https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzE1ZjM4YjQ5LWZhMGQtNDMxOC1iYjQ5LTExMDJjNjUzNjM5Zg==?api-version=2021-01-01"
{
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/providers/Microsoft.DataProtection/locations/westus/operationStatus/ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzE1ZjM4YjQ5LWZhMGQtNDMxOC1iYjQ5LTExMDJjNjUzNjM5Zg==",
"name": "ZmMzNDFmYWMtZWJlMS00NGJhLWE4YTgtMDNjYjI4Y2M5OTExOzE1ZjM4YjQ5LWZhMGQtNDMxOC1iYjQ5LTExMDJjNjUzNjM5Zg==",
"status": "Succeeded",
"startTime": "2021-07-08T07:13:30.23815Z",
"endTime": "2021-07-08T07:13:46Z"
}
관련 콘텐츠
- 데이터 보호 REST API를 사용하여 PostgreSQL 데이터베이스를 복원합니다.
- Azure Portal, Azure PowerShell 및 AzureCLI를 사용하여 PostgreSQL 데이터베이스를 복원합니다.
- Azure Backup Data Protection REST API.
- Azure REST API 참조입니다.
- Azure Backup에서 REST API를 사용하여 백업 및 복원 작업을 추적합니다.