Create Backup Policy

Creates a backup policy.

Creates a backup policy which can be associated later with a Service Fabric application, service or a partition for periodic backup.

Request

Method Request URI
POST /BackupRestore/BackupPolicies/$/Create?api-version=6.2-preview&timeout={timeout}

Parameters

Name Type Required Location
api-version string Yes Query
timeout integer (int64) No Query
BackupPolicyDescription BackupPolicyDescription Yes Body

api-version

Type: string
Required: Yes
Default: 6.2-preview

The version of the API. This parameter is required and its value must be '6.2-preview'.


timeout

Type: integer (int64)
Required: No
Default: 60
InclusiveMaximum: 4294967295
InclusiveMinimum: 1

The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds.


BackupPolicyDescription

Type: BackupPolicyDescription
Required: Yes

Describes the backup policy.

Responses

HTTP Status Code Description Response Schema
201 (Created) A successful operation returns 201 status code and creates a new backup policy.
All other status codes The detailed error response.
FabricError

Examples

Create a time based backup policy with Azure as backup location

This example shows how to create a backup policy which takes backup twice everyday at 9 AM and 5 PM UTC with Azure blob store as the backup location.

Request

POST http://localhost:19080/BackupRestore/BackupPolicies/$/Create?api-version=6.2-preview
Body
{
  "Name": "DailyAzureBackupPolicy",
  "AutoRestoreOnDataLoss": false,
  "MaxIncrementalBackups": "3",
  "Schedule": {
    "ScheduleKind": "TimeBased",
    "ScheduleFrequencyType": "Daily",
    "RunTimes": [
      "0001-01-01T09:00:00Z",
      "0001-01-01T17:00:00Z"
    ]
  },
  "Storage": {
    "StorageKind": "AzureBlobStore",
    "FriendlyName": "Azure_storagesample",
    "ConnectionString": "DefaultEndpointsProtocol=https;AccountName=storagesample;AccountKey=<PutYourAccountKeyHere>",
    "ContainerName": "BackupContainer"
  }
}

201 Response

Body

The response body is empty.

Create a frequency based backup policy with file share as backup location

This example shows how to create a backup policy which takes backup every 10 minutes with file share as the backup location.

Request

POST http://localhost:19080/BackupRestore/BackupPolicies/$/Create?api-version=6.2-preview
Body
{
  "Name": "FileShare10MinBackupPolicy",
  "AutoRestoreOnDataLoss": false,
  "MaxIncrementalBackups": "3",
  "Schedule": {
    "ScheduleKind": "FrequencyBased",
    "Interval": "PT10M"
  },
  "Storage": {
    "StorageKind": "FileShare",
    "FriendlyName": "FileShare_myshare",
    "Path": "\\\\myshare\\backupshare",
    "PrimaryUserName": "backupaccount",
    "PrimaryPassword": "abcd1234"
  }
}

201 Response

Body

The response body is empty.