# Virtual Machine Backup Rule Controller Resource

The API allows you to list, view, create and edit virtual machine backup rule.

### GET /rules/vm-backup

Returns list of virtual machine backup 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 VmBackupRuleDetails (JSON) | list of virtual machine backup rules filtered by specified query parameters

#### Example

##### Request

    GET /rules/vm-backup
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    [ { } ]

### POST /rules/vm-backup

Create virtual machine backup rule.

Request Body
media type | data type | description
--- | --- | ---
application/json | VmBackupRuleRequest (JSON) | specify details for new virtual machine backup rule

Response Body
media type | data type | description
--- | --- | ---
application/json | VmBackupRuleDetails (JSON) | details of newly created virtual machine backup rule

#### Example

##### Request

    POST /rules/vm-backup
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

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

    { }

### DELETE /rules/vm-backup/{guid}

Remove virtual machine backup rule.

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

#### Example

##### Request

    DELETE /rules/vm-backup/{guid}
    Content-Type: */*

    ...

##### Response

    HTTP/1.1 204 No Content

### GET /rules/vm-backup/{guid}

Get a single virtual machine backup rule.

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

Response Body
media type | data type | description
--- | --- | ---
application/json | VmBackupRuleDetails (JSON) | a single virtual machine backup rule details

#### Example

##### Request

    GET /rules/vm-backup/{guid}
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    { }

### PUT /rules/vm-backup/{guid}

Change virtual machine backup rule details.

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

Request Body
media type | data type | description
--- | --- | ---
application/json | VmBackupRuleRequest (JSON) | specify virtual machine backup rule details to update

Response Body
media type | data type | description
--- | --- | ---
application/json | VmBackupRuleDetails (JSON) | updated details of virtual machine backup rule

#### Example

##### Request

    PUT /rules/vm-backup/{guid}
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

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

    { }