borderrules (borderrules)
Requests
| HTTP verb | Endpoint | Description | 
|---|---|---|
| 
 | 
 | |
| 
 | 
 | |
| 
 | 
 | |
| 
 | 
 | |
| 
 | 
 | |
| 
 | 
 | 
Creating a new rule
Request
Field Description: borderrule entity
POST /rest/v1/master/borderrules HTTP/1.1
Content-Type: application/json; charset=utf-8
borderrule entityResponse
Field Description: borderrule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "id": "9a7a73b7-016c-cd10-9ca9-50e54938780c",
  "enabled": 1,
  "priority": 91,
  "site": "*",
  "service": "sip",
  "domain": "docs[.]rootdomain[.]ru",
  "username": "",
  "useragent": "",
  "remoteipmask": "0.0.0.0/0",
  "action": "allow",
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-26T08:35:13.70Z",
    "lwt": "2019-08-26T08:35:13.70Z"
  }
}Getting the list of rules
Request
| Name | Type | Description | 
|---|---|---|
| 
 | 
 | Filter by field values. | 
| 
 | 
 | List of fields to output. Available fields for output: id, priority, site, domain, username, useragent, remoteipmask, opts.title, ext.lwt, ext.ct. | 
| 
 | 
 | Offset in the list of resources to be issued. | 
| 
 | 
 | The maximum number of resources in the list. | 
| 
 | 
 | The sort order of the resources in the list. | 
| 
 | 
 | Conversion to flat form of composite fields. | 
GET /rest/v1/master/borderrules?offset=0&limit=5 HTTP/1.1Response
Field Description: borderrule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
  {
    "id": "9a7a73b7-016c-cd10-9ca9-50e54938780c",
    "enabled": 1,
    "priority": 91,
    "site": "",
    "service": "sip",
    "domain": "docs[.]rootdomain[.]ru",
    "username": "",
    "useragent": "",
    "remoteipmask": "0.0.0.0/0",
    "action": "allow",
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-26T08:35:13.70Z",
      "lwt": "2019-08-26T08:35:13.70Z"
    }
  },
  {
    "id": "592aac52-016c-cd11-5ca7-50e54938780c",
    "enabled": 1,
    "priority": 92,
    "site": "",
    "service": "sip",
    "domain": "",
    "username": "abcde",
    "useragent": "",
    "remoteipmask": "0.0.0.0/0",
    "action": "deny",
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-27T09:36:14.81Z",
      "lwt": "2019-08-27T09:36:14.81Z"
    }
  },
  {
    "id": "50b2cff8-016d-1bb6-0054-02004c4f4f50",
    "enabled": 1,
    "priority": 93,
    "site": "",
    "service": "sip",
    "domain": "",
    "username": "",
    "useragent": "friendly-scanner.\",
    "remoteipmask": "0.0.0.0/0",
    "action": "drop",
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-28T10:37:15.92Z",
      "lwt": "2019-08-28T10:37:15.92Z"
    }
  },
  {
    "id": "9f2605a4-016d-1bb7-d504-02004c4f4f50",
    "enabled": 1,
    "priority": 94,
    "site": "SITE1",
    "service": "sip",
    "domain": "",
    "username": "",
    "useragent": "",
    "remoteipmask": "212.53.40.40/4",
    "action": "allow",
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-29T11:38:16.03Z",
      "lwt": "2019-08-29T11:38:16.03Z"
    }
  },
  {
    "id": "0a2cce0d-016d-1bb7-f46b-02004c4f4f50",
    "enabled": 1,
    "priority": 95,
    "site": "SITE2",
    "service": "sip",
    "domain": "^.test.$",
    "username": "test[A-Z]*",
    "useragent": "...endly-scann..",
    "remoteipmask": "192.168.0.0/24",
    "action": "drop",
    "opts": {
      "title": ""
    },
    "ext": {
      "ct": "2019-08-30T12:39:17.14Z",
      "lwt": "2019-08-30T12:39:17.14Z"
    }
  }
]Obtaining rule data
Request
| Name | Type | Description | 
|---|---|---|
| 
 | 
 | A list of fields to output. | 
| 
 | 
 | Conversion to flat form of composite fields. | 
GET /rest/v1/master/borderrules/9a7a73b7-016c-cd10-9ca9-50e54938780c HTTP/1.1Response
Field Description: borderrule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "id": "9a7a73b7-016c-cd10-9ca9-50e54938780c",
  "enabled": 1,
  "priority": 91,
  "site": "*",
  "service": "sip",
  "domain": "docs[.]rootdomain[.]ru",
  "username": "",
  "useragent": "",
  "remoteipmask": "0.0.0.0/0",
  "action": "allow",
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-26T08:35:13.70Z",
    "lwt": "2019-08-26T08:35:13.70Z"
  }
}Changing the rule data
Fields prohibited for modification: id
Request
Field Description: borderrule entity
PATCH /rest/v1/master/borderrules/9a7a73b7-016c-cd10-9ca9-50e54938780c HTTP/1.1
Content-Type: application/json; charset=utf-8
borderrule entityResponse
Field Description: borderrule entity
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "id": "9a7a73b7-016c-cd10-9ca9-50e54938780c",
  "enabled": 1,
  "priority": 91,
  "site": "",
  "service": "sip",
  "domain": "docs[.]rootdomain[.]ru",
  "username": "",
  "useragent": "friendly-scanner.",
  "remoteipmask": "0.0.0.0/0",
  "action": "allow",
  "opts": {
    "title": "",
    "comment": ""
  },
  "ext": {
    "ct": "2019-08-26T08:35:13.70Z",
    "lwt": "2019-09-10T15:20:51.48Z"
  }
}Deleting a rule
Searching for a rule identifier
Searches the resource for the specified key, returns the identifier(s) to build the endpoint.
Key fields to search for: id
Request
LOOKUP /rest/v1/master/borderrules HTTP/1.1
Content-Type: application/json; charset=utf-8
"9a7a73b7-016c-cd10-9ca9-50e54938780c"Response
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
[
  "9a7a73b7-016c-cd10-9ca9-50e54938780c"
]HTTP/1.1 404 Not Found
Content-Type: application/json; charset=utf-8
{
  "error_code": 1404,
  "error_message": "Lookup failed"
}