# Recovery Plan Rule Controller Resource

The API allows you to list, view, create and edit recovery plan rules.

### GET /rules/recovery-plan

Returns list of recovery plan rules.

Request Parameters
name | type | description
--- | --- | ---
direction | query |
filter | query |
nameLike | query |
orderBy | query |
page | query |
policy | query |
size | query |

Response Body
media type | data type | description
--- | --- | ---
application/json | array of RecoveryPlanRuleReducedListRecord (JSON) | list of recovery plan rules

#### Example

##### Request

    GET /rules/recovery-plan
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ { } ]

### POST /rules/recovery-plan

Create recovery plan rule.

Request Body
media type | data type | description
--- | --- | ---
application/json | RecoveryPlanRuleRequest (JSON) | specify details for new recovery plan rule

Response Body
media type | data type | description
--- | --- | ---
application/json | RecoveryPlanRuleDetails (JSON) | details of newly created recovery plan rule

#### Example

##### Request

    POST /rules/recovery-plan
    Content-Type: application/json
    Accept: application/json

    {
      "powerOnAfterRestore" : true,
      "failTaskAfterPowerOnFail" : true
    }

##### Response

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

    { }

### GET /rules/recovery-plan/detailed

Returns list of recovery plan rules filtered by specified query parameters.

Request Parameters
name | type | description
--- | --- | ---
direction | query |
filter | query |
nameLike | query |
orderBy | query |
page | query |
policy | query |
size | query |

Response Body
media type | data type | description
--- | --- | ---
application/json | array of RecoveryPlanRuleDetails (JSON) | list of recovery plan rules filtered by specified query parameters

#### Example

##### Request

    GET /rules/recovery-plan/detailed
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ { } ]

### DELETE /rules/recovery-plan/{guid}

Remove recovery plan rule.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for recovery plan rule (use by vProtect)

#### Example

##### Request

    DELETE /rules/recovery-plan/{guid}
    Content-Type: */*

    ...

##### Response

    HTTP/1.1 204 No Content

### GET /rules/recovery-plan/{guid}

Get a single recovery plan rule.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for recovery plan rule (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | RecoveryPlanRuleListRecord (JSON) | a single recovery plan rule details

#### Example

##### Request

    GET /rules/recovery-plan/{guid}
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    { }

### PUT /rules/recovery-plan/{guid}

Change recovery plan rule details.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for recovery plan rule (use by vProtect)

Request Body
media type | data type | description
--- | --- | ---
application/json | RecoveryPlanRuleRequest (JSON) | specify recovery plan rule details to update

Response Body
media type | data type | description
--- | --- | ---
application/json | RecoveryPlanRuleDetails (JSON) | updated details of recovery plan rule

#### Example

##### Request

    PUT /rules/recovery-plan/{guid}
    Content-Type: application/json
    Accept: application/json

    {
      "powerOnAfterRestore" : true,
      "failTaskAfterPowerOnFail" : true
    }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

    { }

### GET /rules/recovery-plan/{guid}/detailed

Get detailed information about recovery plan rule.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for recovery plan rule (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | RecoveryPlanRuleDetails (JSON) | a single recovery plan rule details

#### Example

##### Request

    GET /rules/recovery-plan/{guid}/detailed
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    { }