Перейти к основному содержимому

Сетевые инструменты API 1.7.0

Методы API для работы с разделом «Сетевые инструменты».

Базовый путь: https://{IP_контроллера}/api/v1. Версия описания API: 1.7.0.

Примеры используют placeholder-значения для паролей, token, UUID, адресов и секретов. Перед выполнением запроса замените их на значения вашего контроллера.

Методы раздела

МетодПуть
GET/network_tools/ping
GET/network_tools/ping_stop
GET/network_tools/scan_port

GET /network_tools/ping

Раздел: Сетевые инструменты.

Возвращает данные ресурса /network_tools/ping в разделе «Сетевые инструменты».

Параметры и ответы по OpenAPI
{
"summary": "Ping device",
"description": "Returns output of ping command",
"parameters": [
{
"in": "query",
"name": "host",
"required": true,
"description": "ip address of host",
"schema": {
"type": "string",
"pattern": "^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$"
}
},
{
"in": "query",
"name": "c",
"required": true,
"description": "replies count",
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 100
}
},
{
"in": "query",
"name": "s",
"required": true,
"description": "number of data bytes to be send",
"schema": {
"type": "integer",
"minimum": 32,
"maximum": 65507
}
}
],
"responses": {
"200": {
"description": "Successfully got ping output",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}

Примеры по OpenAPI

Сформированы по схеме контроллера; значения полей необходимо заменить.

Пример запроса

curl -k -X GET "https://{IP_контроллера}/api/v1/network_tools/ping?host=<host>&c=1&s=32" \
-H "Authorization: Bearer <token>"

Пример ответа

{
"success": false,
"message": "string",
"data": {}
}

GET /network_tools/ping_stop

Раздел: Сетевые инструменты.

Останавливает проверку сетевой доступности.

Параметры и ответы по OpenAPI
{
"summary": "Stop ping",
"description": "Stop ping",
"responses": {
"200": {
"description": "Ping has been stopped",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}

Примеры по OpenAPI

Сформированы по схеме контроллера; значения полей необходимо заменить.

Пример запроса

curl -k -X GET "https://{IP_контроллера}/api/v1/network_tools/ping_stop" \
-H "Authorization: Bearer <token>"

Пример ответа

{
"success": false,
"message": "string",
"data": {}
}

GET /network_tools/scan_port

Раздел: Сетевые инструменты.

Возвращает данные ресурса /network_tools/scan_port в разделе «Сетевые инструменты».

Параметры и ответы по OpenAPI
{
"summary": "Scan port",
"description": "Returns output of nc command",
"parameters": [
{
"in": "query",
"name": "host",
"required": true,
"description": "IP address of host",
"schema": {
"type": "string",
"pattern": "^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$"
}
},
{
"in": "query",
"name": "port",
"required": true,
"description": "Port number",
"schema": {
"type": "integer",
"minimum": 0,
"maximum": 65535
}
}
],
"responses": {
"200": {
"description": "Successfully got nc output",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"400": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
},
"500": {
"description": "Something went wrong. It seems there is a bug on server",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"type": "boolean",
"example": false
},
"message": {
"type": "string"
},
"data": {
"type": "object"
}
}
}
}
}
}
}
}

Примеры по OpenAPI

Сформированы по схеме контроллера; значения полей необходимо заменить.

Пример запроса

curl -k -X GET "https://{IP_контроллера}/api/v1/network_tools/scan_port?host=<host>&port=1" \
-H "Authorization: Bearer <token>"

Пример ответа

{
"success": false,
"message": "string",
"data": {}
}