Storage rules (storagerules)

Requests

HTTP verb Endpoint Description

POST

/rest/v1/domain/storagerules

Creating a new storage rule

GET

/rest/v1/domain/storagerules

Getting the list of storage rules

GET

/rest/v1/domain/storagerules/<id>

Retrieving data storage rules

PATCH

/rest/v1/domain/storagerules/<id>

Change of storage rule data

DELETE

/rest/v1/domain/storagerules/<id>

Removal of storage rules

LOOKUP

/rest/v1/domain/storagerules

Searching for storage rule identifier


Creating a new storage rule

Request

Field Description: storagerule entity

Request example
POST /rest/v1/domain/storagerules HTTP/1.1
Content-Type: application/json; charset=utf-8

storagerule entity

Response

Field Description: storagerule entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
  "name": "Six months",
  "expires": 180,
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-26T10:50:51.80Z",
    "lwt": "2019-08-26T10:50:51.80Z"
  }
}

Getting the list of storage rules

Request

Table 1. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: id, name, expires, opts.title, ext.lwt, ext.ct.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/domain/storagerules?offset=0&limit=2 HTTP/1.1

Response

Field Description: storagerule entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "id": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
    "name": "Month",
    "expires": 30,
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-26T10:51:21.16Z",
      "lwt": "2019-08-26T10:51:21.16Z"
    }
  },
  {
    "id": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
    "name": "Six months",
    "expires": 180,
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-26T10:50:51.80Z",
      "lwt": "2019-08-26T10:50:51.80Z"
    }
  }
]

Retrieving data storage rules

Request

Table 2. Request parameters
Name Type Description

mask

str

A list of fields to output.

flat

bool

Conversion to flat form of composite fields.

Request example
GET /rest/v1/domain/storagerules/f8d1d8d6-016c-cd8c-ca1d-50e54938780c HTTP/1.1

Response

Field Description: storagerule entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
  "name": "Six months",
  "expires": 180,
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-26T10:50:51.80Z",
    "lwt": "2019-08-26T10:50:51.80Z"
  }
}

Change of storage rule data

Fields prohibited for modification: id

Request

Field Description: storagerule entity

Request example
PATCH /rest/v1/domain/storagerules/f8d1d8d6-016c-cd8c-ca1d-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8

storagerule entity

Response

Field Description: storagerule entity

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "id": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
  "name": "Six months",
  "expires": 182,
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-26T10:50:51.80Z",
    "lwt": "2019-09-11T10:31:09.55Z"
  }
}

Removal of storage rules

Request

Request example
DELETE /rest/v1/domain/storagerules/f8d1d8d6-016c-cd8c-ca1d-50e54938780c HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Searching for storage rule identifier

Searches the resource for the specified key, returns the identifier(s) to build the endpoint.

Key fields to search for: id

Request

Request example
LOOKUP /rest/v1/domain/storagerules HTTP/1.1
Content-Type: application/json; charset=utf-8

"f8d1d8d6-016c-cd8c-ca1d-50e54938780c"

Response

Example of a successful response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8

[
  "f8d1d8d6-016c-cd8c-ca1d-50e54938780c"
]
Example of an unsuccessful response
HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8

{
  "error_code": 1404,
  "error_message": "Lookup failed"
}