Skip to content

Latest commit

 

History

History
896 lines (613 loc) · 29.7 KB

FirewallApi.md

File metadata and controls

896 lines (613 loc) · 29.7 KB

OpenAPI\Client\FirewallApi

All URIs are relative to https://api.timeweb.cloud, except if the operation defines another base path.

Method HTTP request Description
addResourceToGroup() POST /api/v1/firewall/groups/{group_id}/resources/{resource_id} Линковка ресурса в firewall group
createGroup() POST /api/v1/firewall/groups Создание группы правил
createGroupRule() POST /api/v1/firewall/groups/{group_id}/rules Создание firewall правила
deleteGroup() DELETE /api/v1/firewall/groups/{group_id} Удаление группы правил
deleteGroupRule() DELETE /api/v1/firewall/groups/{group_id}/rules/{rule_id} Удаление firewall правила
deleteResourceFromGroup() DELETE /api/v1/firewall/groups/{group_id}/resources/{resource_id} Отлинковка ресурса из firewall group
getGroup() GET /api/v1/firewall/groups/{group_id} Получение информации о группе правил
getGroupResources() GET /api/v1/firewall/groups/{group_id}/resources Получение слинкованных ресурсов
getGroupRule() GET /api/v1/firewall/groups/{group_id}/rules/{rule_id} Получение информации о правиле
getGroupRules() GET /api/v1/firewall/groups/{group_id}/rules Получение списка правил
getGroups() GET /api/v1/firewall/groups Получение групп правил
getRulesForResource() GET /api/v1/firewall/service/{resource_type}/{resource_id} Получение групп правил для ресурса
updateGroup() PATCH /api/v1/firewall/groups/{group_id} Обновление группы правил
updateGroupRule() PATCH /api/v1/firewall/groups/{group_id}/rules/{rule_id} Обновление firewall правила

addResourceToGroup()

addResourceToGroup($group_id, $resource_id, $resource_type): \OpenAPI\Client\Model\FirewallGroupResourceOutResponse

Линковка ресурса в firewall group

Чтобы слинковать ресурс с группой правил, отправьте POST запрос на /api/v1/firewall/groups/{group_id}/resources/{resource_id}

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.
$resource_id = 'resource_id_example'; // string | ID ресурса
$resource_type = new \OpenAPI\Client\Model\ResourceType(); // ResourceType

try {
    $result = $apiInstance->addResourceToGroup($group_id, $resource_id, $resource_type);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->addResourceToGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.
resource_id string ID ресурса
resource_type ResourceType [optional]

Return type

\OpenAPI\Client\Model\FirewallGroupResourceOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createGroup()

createGroup($firewall_group_in_api, $policy): \OpenAPI\Client\Model\FirewallGroupOutResponse

Создание группы правил

Чтобы создать группу правил, отправьте POST запрос на /api/v1/firewall/groups

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$firewall_group_in_api = new \OpenAPI\Client\Model\FirewallGroupInAPI(); // \OpenAPI\Client\Model\FirewallGroupInAPI
$policy = 'policy_example'; // string | Тип группы правил.

try {
    $result = $apiInstance->createGroup($firewall_group_in_api, $policy);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->createGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
firewall_group_in_api \OpenAPI\Client\Model\FirewallGroupInAPI
policy string Тип группы правил. [optional]

Return type

\OpenAPI\Client\Model\FirewallGroupOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createGroupRule()

createGroupRule($group_id, $firewall_rule_in_api): \OpenAPI\Client\Model\FirewallRuleOutResponse

Создание firewall правила

Чтобы создать правило в группе, отправьте POST запрос на /api/v1/firewall/groups/{group_id}/rules

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.
$firewall_rule_in_api = new \OpenAPI\Client\Model\FirewallRuleInAPI(); // \OpenAPI\Client\Model\FirewallRuleInAPI

try {
    $result = $apiInstance->createGroupRule($group_id, $firewall_rule_in_api);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->createGroupRule: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.
firewall_rule_in_api \OpenAPI\Client\Model\FirewallRuleInAPI

Return type

\OpenAPI\Client\Model\FirewallRuleOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteGroup()

deleteGroup($group_id)

Удаление группы правил

Чтобы удалить группу правил, отправьте DELETE запрос на /api/v1/firewall/groups/{group_id}

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.

try {
    $apiInstance->deleteGroup($group_id);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->deleteGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteGroupRule()

deleteGroupRule($group_id, $rule_id)

Удаление firewall правила

Чтобы удалить правило, отправьте DELETE запрос на /api/v1/firewall/groups/{group_id}/rules/{rule_id}

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.
$rule_id = 'rule_id_example'; // string | ID правила

try {
    $apiInstance->deleteGroupRule($group_id, $rule_id);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->deleteGroupRule: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.
rule_id string ID правила

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteResourceFromGroup()

deleteResourceFromGroup($group_id, $resource_id, $resource_type)

Отлинковка ресурса из firewall group

Чтобы отлинковать ресурс от группы правил, отправьте DELETE запрос на /api/v1/firewall/groups/{group_id}/resources/{resource_id}

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.
$resource_id = 'resource_id_example'; // string | ID ресурса
$resource_type = new \OpenAPI\Client\Model\ResourceType(); // ResourceType

try {
    $apiInstance->deleteResourceFromGroup($group_id, $resource_id, $resource_type);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->deleteResourceFromGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.
resource_id string ID ресурса
resource_type ResourceType [optional]

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGroup()

getGroup($group_id): \OpenAPI\Client\Model\FirewallGroupOutResponse

Получение информации о группе правил

Чтобы получить информацию о группе правил, отправьте GET запрос на /api/v1/firewall/groups/{group_id}

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.

try {
    $result = $apiInstance->getGroup($group_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->getGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.

Return type

\OpenAPI\Client\Model\FirewallGroupOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGroupResources()

getGroupResources($group_id, $limit, $offset): \OpenAPI\Client\Model\FirewallGroupResourcesOutResponse

Получение слинкованных ресурсов

Чтобы получить слинкованных ресурсов для группы правил, отправьте GET запрос на /api/v1/firewall/groups/{group_id}/resources

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.
$limit = 100; // int | Обозначает количество записей, которое необходимо вернуть.
$offset = 0; // int | Указывает на смещение относительно начала списка.

try {
    $result = $apiInstance->getGroupResources($group_id, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->getGroupResources: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.
limit int Обозначает количество записей, которое необходимо вернуть. [optional] [default to 100]
offset int Указывает на смещение относительно начала списка. [optional] [default to 0]

Return type

\OpenAPI\Client\Model\FirewallGroupResourcesOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGroupRule()

getGroupRule($rule_id, $group_id): \OpenAPI\Client\Model\FirewallRuleOutResponse

Получение информации о правиле

Чтобы получить инфомрацию о правиле, отправьте GET запрос на /api/v1/firewall/groups/{group_id}/rules/{rule_id}

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$rule_id = 'rule_id_example'; // string | ID правила.
$group_id = 'group_id_example'; // string | ID группы правил.

try {
    $result = $apiInstance->getGroupRule($rule_id, $group_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->getGroupRule: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
rule_id string ID правила.
group_id string ID группы правил.

Return type

\OpenAPI\Client\Model\FirewallRuleOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGroupRules()

getGroupRules($group_id, $limit, $offset): \OpenAPI\Client\Model\FirewallRulesOutResponse

Получение списка правил

Чтобы получить список правил в группе, отправьте GET запрос на /api/v1/firewall/groups/{group_id}/rules

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.
$limit = 100; // int | Обозначает количество записей, которое необходимо вернуть.
$offset = 0; // int | Указывает на смещение относительно начала списка.

try {
    $result = $apiInstance->getGroupRules($group_id, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->getGroupRules: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.
limit int Обозначает количество записей, которое необходимо вернуть. [optional] [default to 100]
offset int Указывает на смещение относительно начала списка. [optional] [default to 0]

Return type

\OpenAPI\Client\Model\FirewallRulesOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getGroups()

getGroups($limit, $offset): \OpenAPI\Client\Model\FirewallGroupsOutResponse

Получение групп правил

Чтобы получить групп правил для аккаунта, отправьте GET запрос на /api/v1/firewall/groups

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$limit = 100; // int | Обозначает количество записей, которое необходимо вернуть.
$offset = 0; // int | Указывает на смещение относительно начала списка.

try {
    $result = $apiInstance->getGroups($limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->getGroups: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
limit int Обозначает количество записей, которое необходимо вернуть. [optional] [default to 100]
offset int Указывает на смещение относительно начала списка. [optional] [default to 0]

Return type

\OpenAPI\Client\Model\FirewallGroupsOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getRulesForResource()

getRulesForResource($resource_id, $resource_type, $limit, $offset): \OpenAPI\Client\Model\FirewallGroupsOutResponse

Получение групп правил для ресурса

Чтобы получить список групп правил, с которыми слинкован ресурс, отправьте GET запрос на /api/v1/firewall/service/{resource_type}/{resource_id}

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$resource_id = 'resource_id_example'; // string | ID ресурса
$resource_type = new \OpenAPI\Client\Model\ResourceType(); // ResourceType
$limit = 100; // int | Обозначает количество записей, которое необходимо вернуть.
$offset = 0; // int | Указывает на смещение относительно начала списка.

try {
    $result = $apiInstance->getRulesForResource($resource_id, $resource_type, $limit, $offset);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->getRulesForResource: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
resource_id string ID ресурса
resource_type ResourceType
limit int Обозначает количество записей, которое необходимо вернуть. [optional] [default to 100]
offset int Указывает на смещение относительно начала списка. [optional] [default to 0]

Return type

\OpenAPI\Client\Model\FirewallGroupsOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateGroup()

updateGroup($group_id, $firewall_group_in_api): \OpenAPI\Client\Model\FirewallGroupOutResponse

Обновление группы правил

Чтобы изменить группу правил, отправьте PATCH запрос на /api/v1/firewall/groups/{group_id}

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.
$firewall_group_in_api = new \OpenAPI\Client\Model\FirewallGroupInAPI(); // \OpenAPI\Client\Model\FirewallGroupInAPI

try {
    $result = $apiInstance->updateGroup($group_id, $firewall_group_in_api);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->updateGroup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.
firewall_group_in_api \OpenAPI\Client\Model\FirewallGroupInAPI

Return type

\OpenAPI\Client\Model\FirewallGroupOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateGroupRule()

updateGroupRule($group_id, $rule_id, $firewall_rule_in_api): \OpenAPI\Client\Model\FirewallRuleOutResponse

Обновление firewall правила

Чтобы изменить правило, отправьте PATCH запрос на /api/v1/firewall/groups/{group_id}/rules/{rule_id}

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\FirewallApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$group_id = 'group_id_example'; // string | ID группы правил.
$rule_id = 'rule_id_example'; // string | ID правила
$firewall_rule_in_api = new \OpenAPI\Client\Model\FirewallRuleInAPI(); // \OpenAPI\Client\Model\FirewallRuleInAPI

try {
    $result = $apiInstance->updateGroupRule($group_id, $rule_id, $firewall_rule_in_api);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FirewallApi->updateGroupRule: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
group_id string ID группы правил.
rule_id string ID правила
firewall_rule_in_api \OpenAPI\Client\Model\FirewallRuleInAPI

Return type

\OpenAPI\Client\Model\FirewallRuleOutResponse

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]