Esta é uma API de gerenciamento de configurações das conexões para o módulo firewall.
API de listagem de configurações de conexões do firewall.
Exemplo de requisição
GET /api/firewall/connections HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.firewall.get_connections()
print(response.payload)
const response = sdk.firewall.getConnections();
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"connections": [
{
"id": "iface:1",
"name": "connection01",
"type": "lan",
"out_masquerade": false,
"out_rfc_networks_block": false,
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00",
},
],
}
[
Connection(
id="iface:1",
name="connection01",
type="lan",
out_masquerade=False,
out_rfc_networks_block=False,
created_at=DateTime(2017, 10, 5, 15, 20, 2, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2017, 10, 5, 15, 20, 2, tzinfo=Timezone('+00:00'))
)
]
[
{
id: "iface:1",
name: "connection01",
type: "lan",
outMasquerade: false,
outRfcNetworksBlock: false,
createdAt: "2017-10-05T15:20:02.000Z",
updatedAt: "2017-11-05T15:20:02.000Z"
}
];
API de busca de uma configuração de conexão existente.
id
Exemplo de requisição
GET /api/firewall/connections/iface:1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.firewall.get_connection(id="iface:1")
print(response.payload)
const response = sdk.firewall.getConnection({ id: "iface:1" });
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "iface:1",
"name": "connection01",
"type": "lan",
"out_masquerade": false,
"out_rfc_networks_block": false,
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00",
}
Connection(
id="iface:1",
name="connection01",
type="lan",
out_masquerade=False,
out_rfc_networks_block=False,
created_at=DateTime(2017, 10, 5, 15, 20, 2, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2017, 10, 5, 15, 20, 2, tzinfo=Timezone('+00:00'))
)
{
id: "iface:1",
name: "connection01",
type: "lan",
outMasquerade: false,
outRfcNetworksBlock: false,
createdAt: "2017-10-05T15:20:02.000Z",
updatedAt: "2017-11-05T15:20:02.000Z"
}
API de edição de uma configuração de conexão existente.
id
Exemplo de requisição
PUT /api/firewall/connections/iface:1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
{
"out_masquerade": false,
"out_rfc_networks_block": false,
"apply": false,
}
from itflex_sdk.firewall.types import UpdateConnectionRequest
request = UpdateConnectionRequest(
id="iface:1",
out_masquerade=False,
out_rfc_networks_block=False,
apply=False,
)
response = sdk.firewall.update_connection(request)
print(response.payload)
const connection = {
id: "iface:1",
outMasquerade: false,
outRfcNetworksBlock: false,
apply: false,
};
const response = sdk.firewall.updateConnection(connection);
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "iface:1",
"name": "connection01",
"type": "lan",
"out_masquerade": false,
"out_rfc_networks_block": false,
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00"
}
Connection(
id="iface:1",
name="connection01",
type="lan",
out_masquerade=False,
out_rfc_networks_block=False,
created_at=DateTime(2017, 10, 5, 15, 20, 2, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2017, 11, 5, 15, 20, 2, tzinfo=Timezone('+00:00'))
)
{
id: "iface:1",
name: "connection01",
type: "lan",
outMasquerade: false,
outRfcNetworksBlock: false,
createdAt: "2017-10-05T15:20:02.000Z",
updatedAt: "2017-11-05T15:20:02.000Z"
}
API para aplicar todas as configurações de conexões do firewall.
Exemplo de requisição
POST /api/firewall/connections/apply HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.firewall.apply_connections()
const response = await sdk.firewall.applyConnections();
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
Parâmetros da url
Campo | Descrição |
---|---|
id | string Identificador da Conexão Deve possuir o formato |
Requisição
Campo | Descrição |
---|---|
out_masquerade | boolrequerido Flag para habilitar/desabilitar o masquerade dos pacotes saindo para a conexão Valor padrão:
|
out_rfc_networks_block | boolrequerido Flag para habilitar/desabilitar o bloqueio de saida para redes RFC 1918 (redes privadas). O bloqueio ignora as redes da própria conexão. Valor padrão:
|
apply | bool Flag que indica se as informações serão provisionadas imediatamente após a edição Valor padrão: |
Resposta
Campo | Descrição |
---|---|
id | string Identificador da conexão |
name | string Nome da conexão |
type | string Tipo da conexão |
out_masquerade | bool Flag para habilitar/desabilitar o masquerade dos pacotes saindo para a conexão |
out_rfc_networks_block | bool Flag para habilitar/desabilitar o bloqueio de saida para redes RFC 1918 (redes privadas). |
created_at | string Data de criação
|
updated_at | string Data da última edição
|