Grupos de Regras de Roteamento

Grupos de regras servem para organizar e facilitar a ordenação das regras.

As regras associadas com o grupo dão prefêrencia a ordem do grupo, e depois da regra.

Esta é uma API de gerenciamento dos grupos de regras de roteamento do sdwan

Listar grupos de regras de roteamento

API de listagem de grupos de regras de roteamento

GET /api/sdwan/routing/rules/groups

Exemplo de requisição

GET /api/sdwan/routing/rules/groups HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.sdwan.get_routing_rules_groups()
print(response.payload)
const response = sdk.sdwan.getRoutingRulesGroups();
console.log(response.payload);

Exemplo de resposta

HTTP/1.1 200 OK
Content-Type: application/json

{
  "routing_rules_groups": [
    {
      "id": 1,
      "name": "Group",
      "order": 5,
      "created_at": "2018-08-02T08:28:30.932000+00:00",
      "updated_at": "2018-08-02T08:28:30.932000+00:00"
    },
    {
      "id": 2,
      "name": "Another group",
      "order": 10,
      "created_at": "2018-08-02T09:30:30.932000+00:00",
      "updated_at": "2018-08-02T09:30:30.932000+00:00"
    },
  ]
}
[
    RoutingRulesGroup(
        id=1,
        name="Group",
        order=5,
        created_at=DateTime(2018, 8, 2, 8, 28, 30, tzinfo=Timezone('+00:00')),
        updated_at=DateTime(2018, 8, 2, 8, 28, 30, tzinfo=Timezone('+00:00'))
    ),
    RoutingRulesGroup(
        id=2,
        name="Another group",
        order=10,
        created_at=DateTime(2018, 8, 2, 9, 30, 30, tzinfo=Timezone('+00:00')),
        updated_at=DateTime(2018, 8, 2, 9, 30, 30, tzinfo=Timezone('+00:00'))
    ),
]
[
  {
    id: 1,
    name: "Group",
    order: ,
    createdAt: "2018-08-02T08:28:30.932000+00:00",
    updatedAt: "2018-08-02T08:28:30.932000+00:00"
  },
  {
    id: 2,
    name: "Another group",
    order: 10,
    createdAt: "2018-08-02T09:30:30.000Z",
    updatedAt: "2018-08-02T09:30:30.000Z"
  },
];

Listar grupos de regras de roteamento com as regras agregadas

API de listagem de grupos de regras de roteamento com suas respectivas regras

GET /api/sdwan/routing/rules/groups/full

Exemplo de requisição

GET /api/sdwan/routing/rules/groups/full HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.sdwan.get_routing_full_rules_groups()
print(response.payload)
const response = sdk.sdwan.getFullRoutingRulesGroups();
console.log(response.payload);

Exemplo de resposta

HTTP/1.1 200 OK
Content-Type: application/json

{
  "routing_rules_groups": [
    {
      "id": 1,
      "name": "Group",
      "order": 5,
      "routing_rules": [
        {
          "id": 1,
          "enabled": true,
          "description": "Rule01",
          "action": "accept",
          "protocol": "tcp/udp",
          "log_enabled": false,
          "log_info": null,
          "src_addr_type": "zone",
          "src_addr": "wan",
          "dst_addr_type": "zone",
          "dst_addr": "wan",
          "dst_port_type": "range",
          "dst_port": "8000:8080",
          "policy_routing_id": 1,
        },
        {
          "id": 2,
          "enabled": true,
          "order": 8,
          "description": "Rule02",
          "action": "accept",
          "protocol": "ip",
          "log_enabled": false,
          "log_info": null,
          "src_addr_type": "zone",
          "src_addr": "wan",
          "dst_addr_type": "network",
          "dst_addr": "192.168.0.0/24",
          "dst_port_type": "any",
          "dst_port": null,
          "policy_routing_id": 2,
        }
      ],
      "created_at": "2018-08-02T08:28:30.932000+00:00",
      "updated_at": "2018-08-02T08:28:30.932000+00:00"
    }
  ]
}
[
    RoutingRulesGroup(
        id=1,
        name="Group",
        order=5,
        routing_rules=[
            RoutingRule(
              id=1,
              enabled=True,
              order=3,
              description="Rule01",
              action="accept",
              protocol="tcp/udp",
              log_enabled=False,
              log_info=None,
              src_addr_type="zone",
              src_addr="wan",
              dst_addr_type="zone",
              dst_addr="wan",
              dst_port_type="range",
              dst_port="8000:8080",
              policy_routing_id=1,
          ),
          RoutingRule(
              id=2,
              enabled=True,
              order=8,
              description="Rule02",
              action="accept",
              protocol="ip",
              log_enabled=False,
              log_info=None,
              src_addr_type="zone",
              src_addr="wan",
              dst_addr_type="network",
              dst_addr="192.168.0.0/24",
              dst_port_type="any",
              dst_port=None,
              policy_routing_id=2,
          )
        ],
        created_at=DateTime(2018, 8, 2, 8, 28, 30, tzinfo=Timezone('+00:00')),
        updated_at=DateTime(2018, 8, 2, 8, 28, 30, tzinfo=Timezone('+00:00'))
    )
]
[
  {
    id: 1,
    name: "Group",
    order: 5,
    routingRules: [
      {
        id: 1,
        enabled: true,
        order: 3,
        description: "Rule01",
        action: "accept",
        protocol: "tcp/udp",
        logEnabled: false,
        logInfo: null,
        srcAddrType: "zone",
        srcAddr: "wan",
        dstAddrType: "zone",
        dstAddr: "wan",
        dstPortType: "range",
        dstPort: "8000:8080",
        policyRoutingId=1,
      },
      {
        id: 2,
        enabled: true,
        order: 8,
        description: "Rule02",
        action: "accept",
        protocol: "ip",
        logEnabled: false,
        logInfo: null,
        srcAddrType: "zone",
        srcAddr: "wan",
        dstAddrType: "network",
        dstAddr: "192.168.0.0/24",
        dstPortType: "any",
        dstPort: null,
        policyRoutingId=2,
      }
    ],
    createdAt: "2018-08-02T08:28:30.932000+00:00",
    updatedAt: "2018-08-02T08:28:30.932000+00:00"
  }
];

Buscar grupos de regras de roteamento

API de busca de grupos de regras de roteamento

GET /api/sdwan/routing/rules/groups/id

Exemplo de requisição

GET /api/sdwan/groups/rules/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.sdwan.get_routing_rules_group(id=1)
print(response.payload)
const response = sdk.sdwan.getRoutingRulesGroup({ id: 1 });
console.log(response.payload);

Exemplo de resposta

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 1,
  "name": "Group",
  "order": 5,
  "created_at": "2018-08-02T08:28:30.932000+00:00",
  "updated_at": "2018-08-02T08:28:30.932000+00:00"
}
RoutingRulesGroup(
    id=1,
    name="Group",
    order=5,
    created_at=DateTime(2018, 8, 2, 8, 28, 30, tzinfo=Timezone('+00:00')),
    updated_at=DateTime(2018, 8, 2, 8, 28, 30, tzinfo=Timezone('+00:00'))
)
{
  id: 1,
  name: "Group",
  order: 5,
  createdAt: "2018-08-02T08:28:30.932000+00:00",
  updatedAt: "2018-08-02T08:28:30.932000+00:00"
}

Criar grupos de regras de roteamento

API de criação de grupos de regras de roteamento

POST /api/sdwan/routing/rules/groups

Exemplo de requisição

POST /api/sdwan/routing/rules/groups HTTP/1.1
Host: api.exemplo.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer <Access-Token>

{
  "name": "New group",
  "order": 20
}
from itflex_sdk.sdwan.types import CreateRoutingRulesGroupRequest

request = CreateRoutingRulesGroupRequest(
    name="New group",
    order=20
)
response = sdk.sdwan.create_routing_rules_group(request)
print(response.payload)
const routingRulesGroup = sdk.sdwan.types.RoutingRulesGroup();
routingRulesGroup.name = "New group";
routingRulesGroup.order = 20;

const response = sdk.sdwan.createRoutingRulesGroup(routingRulesGroup);
console.log(response.payload);

Exemplo de resposta

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 3,
  "name": "New group",
  "order": 20,
  "created_at": "2018-12-13T10:32:30.932000+00:00",
  "updated_at": "2018-12-13T10:32:30.932000+00:00"
}
RoutingRulesGroup(
    id=3,
    name="New group",
    order=20,
    created_at=DateTime(2018, 12, 13, 10, 32, 30, tzinfo=Timezone('+00:00')),
    updated_at=DateTime(2018, 12, 13, 10, 32, 30, tzinfo=Timezone('+00:00'))
)
{
  id: 3,
  name: "New group",
  order: 20,
  createdAt: "2018-12-13T10:32:30.932000+00:00",
  updatedAt: "2018-12-13T10:32:30.932000+00:00"
}

Editar grupos de regras de roteamento

API de edição de grupos de regras de roteamento

PUT /api/sdwan/routing/rules/groups/id

Exemplo de requisição

PUT /api/sdwan/routing/rules/groups/3 HTTP/1.1
Host: api.exemplo.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer <Access-Token>

{
  "name": "Edited group",
  "order": 25
}
from itflex_sdk.sdwan.types import UpdateRoutingRulesGroupRequest

request = UpdateRoutingRulesGroupRequest(
    id=3,
    name="Edited group",
    order=25
)
response = sdk.sdwan.update_routing_rules_group(request)
print(response.payload)
const routingRulesGroup = {
  id: 3,
  name: "Edited group",
  order: 25
};
const response = sdk.sdwan.updateRoutingRulesGroup(routingRulesGroup);
console.log(response.payload);

Exemplo de resposta

HTTP/1.1 200 OK
Content-Type: application/json

{
  "id": 3,
  "name": "Edited group",
  "order": 25,
  "created_at": "2018-12-13T10:32:30.932000+00:00",
  "updated_at": "2018-12-13T10:37:15.932000+00:00"
}
RoutingRulesGroup(
    id=3,
    name="Edited group",
    order=25,
    created_at=DateTime(2018, 12, 13, 10, 32, 30, tzinfo=Timezone('+00:00')),
    updated_at=DateTime(2018, 12, 13, 10, 37, 15, tzinfo=Timezone('+00:00'))
)
{
  id: 3,
  name: "Edited group",
  order: 25,
  createdAt: "2018-12-13T10:32:30.932000+00:00",
  updatedAt: "2018-12-13T10:37:15.932000+00:00"
}

Excluir grupos de regras de roteamento

API de exclusão de grupos de regras de roteamento

DELETE /api/sdwan/routing/rules/groups/id

Exemplo de requisição

DELETE /api/sdwan/routing/rules/groups/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.sdwan.delete_routing_rules_group(id=1)
const response = sdk.sdwan.deleteRoutingRulesGroup({ id: 1 });

Exemplo de resposta

HTTP/1.1 200 OK
Content-Type: application/json

Formato dos dados

Parâmetros da url

Campo Descrição
id int

Identificador do grupo de regras

Requisição

Campo Descrição
name stringrequerido único

Nome do grupo de regras.

order intrequerido

Campo de ordenação dos grupos de regras.

Deve ser sempre um número positivo.

Resposta

Campo Descrição
id int

Identificador do grupo de regras

name string

Nome do grupo de regras.

order int

Campo de ordenação dos grupos de regras.

routing_rules array<RoutingRules>

Lista de regras de roteamento associadas.

created_at string

Data de criação

Formato: ISO-8601

updated_at string

Data da última edição

Formato: ISO-8601