# Snapshot Management Rule Controller Resource

The API allows you to list, view, create and edit snapshot management rules for VMs.

### GET /rules/vm-snapshot

Returns list of snapshot management 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 SnapshotMgmtRuleDetails (JSON) | list of snapshot management rules

#### Example

##### Request

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

    ...

##### Response

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

    [ { } ]

### POST /rules/vm-snapshot

Create snapshot management rule.

Request Body
media type | data type | description
--- | --- | ---
application/json | SnapshotMgmtRuleRequest (JSON) | specify details for new snapshot management rule

Response Body
media type | data type | description
--- | --- | ---
application/json | SnapshotMgmtRuleDetails (JSON) | details of newly created snapshot management rule

#### Example

##### Request

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

    { }

##### Response

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

    { }

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

Remove snapshot management rule.

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

#### Example

##### Request

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

    ...

##### Response

    HTTP/1.1 204 No Content

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

Get a single snapshot management rule.

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

Response Body
media type | data type | description
--- | --- | ---
application/json | SnapshotMgmtRuleDetails (JSON) | a single snapshot management rule details

#### Example

##### Request

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

    ...

##### Response

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

    { }

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

Change snapshot management rule details.

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

Request Body
media type | data type | description
--- | --- | ---
application/json | SnapshotMgmtRuleRequest (JSON) | specify snapshot management rule details to update

Response Body
media type | data type | description
--- | --- | ---
application/json | SnapshotMgmtRuleDetails (JSON) | updated details of snapshot management rule

#### Example

##### Request

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

    { }

##### Response

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

    { }