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>

Getting storage rule data

PATCH

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

Modifying storage rule data

DELETE

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

Deleting a storage rule

LOOKUP

/rest/v1/domain/storagerules

Searching for a storage rule identifier


Creating a new storage rule

Request

Field description: storagerule entity

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

storagerule entity

Response

Field description: storagerule entity

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

{
  "id": "f8d1d8d6-016c-cd8c-ca1d-50e54938780c",
"name": "Half a year",
  "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 output.

limit

int

Maximum number of resources in the list.

order

array<object|str>

Sorting order of resources in the list.

flat

bool

Transformation of composite fields to flat form.

Example request
GET /rest/v1/domain/storagerules?offset=0&limit=2 HTTP/1.1

Response

Field description: storagerule entity

Example response
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": "Half a year",
    "expires": 180,
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-26T10:50:51.80Z",
      "lwt": "2019-08-26T10:50:51.80Z"
    }
  }
]

Getting storage rule data

Request

Table 2. Request parameters
Name Type Description

mask

str

List of fields to output.

flat

bool

Transformation of composite fields to flat form.

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

Response

Field description: storagerule entity

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

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

Modifying storage rule data

Fields prohibited for modification: id

Request

Field description: storagerule entity

Example request
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

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

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

Deleting a storage rule

Request

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

Response

Example response
HTTP/1.1 204 No Content

Searching for a storage rule identifier

Searches for a resource by the specified key and returns the identifier(s) for building the endpoint.

Key fields for search: id

Request

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

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

Response

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

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

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