Get details about a policy

 

Use Get Policy to get the Recovery Services backup policy.

Request

The Get Policy can be specified as follows.

Method Request URI HTTP Version
GET https://<VaultUrl>/backupPolicies?api-version=<api-version>
https://<VaultUrl>/backupPolicies/{policyName}?api-version=<api-version>
HTTP/1.1

Request Header:

Common request headers described here.

Request Body:

None.

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Response Header:

Common response headers described here.

Response Body:

List of policy resources or a single policy resource to get a specific policy.

Example Response:

{
  "value": [
    {
      "id":
"/Subscriptions/{id}/resourceGroups/{groupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/testpolicy",
      "name": "testpolicy",
      "type": "Microsoft.RecoveryServices/vaults/backupPolicies",
      "schedulePolicy": {
        "schedulePolicyType": "SimpleSchedulePolicy",
        "scheduleRunType": "Daily",
        "scheduleRunTimes": [
          "2015-11-20T01:00:00"
         ]
        },
        "retentionPolicy": {
          "retentionPolicyType": "LongTermRetentionPolicy",
          "dailySchedule": {
            "retentionTimes": [
              "2015-08-13T08:30:00Z"
            ],
            "retentionDuration": {
              "count": 180,
              "durationType": "Days"
            }
         },
         "weeklySchedule": {
            "daysOfTheWeek": [
               "Sunday"
            ],
            "retentionTimes": [
              "2015-08-13T08:30:00Z"
            ],
            "retentionDuration": {
              "count"; 104,
              "durationType": "Months"
             }
           },
           "monthlySchedule": {
              "retentionScheduleFormat": "Weekly",
              "retentionScheduleWeekly": {
                 "daysOfTheWeek": [
                   "Sunday"
                 ],
                 "weeksOfTheMonth": [
                    "Second"
                 ]
               },
               "retentionTimes": [
                  "2015-08-13T08:30:00Z"   
               ],
               "retentionDuration": {
                  "count": 60,
                  "durationType": "Weeks"
                }
               },
               "yearlySchedule": {
                  "retentionScheduleFormat": "Weekly",
                  "monthsOfYear": [
                    "January"
                  ],
                  "retentionScheduleWeekly": {
                    "daysOfTheWeek": [
                      "Sunday"
                    ],
                    "weeksOfTheMonth": [
                      "Second"
                    ]
                   },
                   "retentionTimes": [
                      "2015-08-13T08:30:00Z"
                   ],
                   "retentionDuration": {
                      "count": 10,
                      "durationType": "Years"
                    }
                  }
               }
            }
         }
     ],
     "nextLink": "{originalRequestUrl}?$skipToken = {ContinuationToken}"
 }