# Retention Controller Resource

The API allows you to get backup file versions to remove based on posted remoteversions, retention config for backup destination and retention logic

### POST /retention

Returns list of version to remove, based on input params

Request Body
media type | data type | description
--- | --- | ---
application/json | LegacyRetentionQueryParameters (JSON) | specify remote backup file versions

Response Body
media type | data type | description
--- | --- | ---
application/json | LegacyRemoteVersionsObject (JSON) | object with versions to remove: map of protectedEntity-> (backupfile-> versions)

#### Example

##### Request

    POST /retention
    Content-Type: application/json
    Accept: application/json

    {
      "legacyRemoteVersionsObject" : {
        "versionsMap" : {
          "property1" : { },
          "property2" : { }
        },
        "backupDestination" : "..."
      },
      "backupDestination" : "..."
    }

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

    {
      "versionsMap" : {
        "property1" : { },
        "property2" : { }
      },
      "backupDestination" : "..."
    }

### POST /retention/mark-backups

Request Body
media type | data type
--- | ---
application/json | array of BackupRetentionHintRequest (JSON)

Response Body
media type | data type | description
--- | --- | ---
application/json | array of MarkBackupsPreviewResponse (JSON) |

#### Example

##### Request

    POST /retention/mark-backups
    Content-Type: application/json
    Accept: application/json

    [ { } ]

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

    [ { } ]

### POST /retention/mark-backups/preview

Request Body
media type | data type
--- | ---
application/json | array of BackupRetentionHintRequest (JSON)

Response Body
media type | data type | description
--- | --- | ---
application/json | array of MarkBackupsPreviewResponse (JSON) |

#### Example

##### Request

    POST /retention/mark-backups/preview
    Content-Type: application/json
    Accept: application/json

    [ { } ]

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

    [ { } ]