Configurações das Conexões

Esta é uma API de gerenciamento de configurações das conexões para o módulo DBC.

Listar Configurações das Conexões

API de listagem de configurações de conexões do DBC.

GET /api/dbc/connections

Exemplo de requisição

GET /api/dbc/connections HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.dbc.get_connections()
print(response.payload)
const response = sdk.dbc.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",
      "upload": 15,
      "download": 75,
      "download_policy": {
        "id": 1,
        "name": "policy_down01"
      },
      "upload_policy": {
        "id": 2,
        "name": "policy_up02"
      },
      "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",
        upload=15,
        download=75,
        download_policy=Policy(
            id=1,
            name="policy_down01"
        ),
        upload_policy=Policy(
            id=2,
            name="policy_up02"
        ),
        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",
    upload: 15,
    download: 75,
    downloadPolicy: {
      id: 1,
      name: "policy_down01"
    },
    uploadPolicy: {
      id: 2,
      name: "policy_up02"
    },
    createdAt: "2017-10-05T15:20:02.000Z",
    updatedAt: "2017-11-05T15:20:02.000Z"
  }
];

Buscar Configuração da Conexão

API de busca de uma configuração de conexão existente.

GET /api/dbc/connections/id

Exemplo de requisição

GET /api/dbc/connections/iface:1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
response = sdk.dbc.get_connection(id="iface:1")
print(response.payload)
const response = sdk.dbc.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",
  "upload": 15,
  "download": 75,
  "download_policy": {
    "id": 1,
    "name": "policy_down01"
  },
  "upload_policy": {
    "id": 2,
    "name": "policy_up02"
  },
  "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",
    upload=15,
    download=75,
    download_policy=Policy(
        id=1,
        name="policy_down01"
    ),
    upload_policy=Policy(
        id=2,
        name="policy_up02"
    ),
    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",
  upload: 15,
  download: 75,
  downloadPolicy: {
    id: 1,
    name: "policy_down01"
  },
  uploadPolicy: {
    id: 2,
    name: "policy_up02"
  },
  createdAt: "2017-10-05T15:20:02.000Z",
  updatedAt: "2017-11-05T15:20:02.000Z"
}

Editar Configuração da Conexão

API de edição de uma configuração de conexão existente.

PUT /api/dbc/connections/id

Exemplo de requisição

PUT /api/dbc/connections/iface:1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>

{
  "upload": 20,
  "download": 70,
  "download_policy": 1,
  "upload_policy": 2,
  "apply": false,
}
from itflex_sdk.dbc.types import UpdateConnectionRequest

request = UpdateConnectionRequest(
    id="iface:1",
    upload=20,
    download=70,
    download_policy=1,
    upload_policy=2,
    apply=False,
)

response = sdk.dbc.update_connection(request)
print(response.payload)
const connection = {
  id: "iface:1",
  upload: 20,
  download: 70,
  downloadPolicy: 1,
  uploadPolicy: 2,
  apply: false,
};
const response = sdk.dbc.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",
  "upload": 20,
  "download": 70,
  "download_policy": {
    "id": 1,
    "name": "policy_down01"
  },
  "upload_policy": {
    "id": 2,
    "name": "policy_up02"
  },
  "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",
    upload=20,
    download=70,
    download_policy=Policy(
        id=1,
        name="policy_down01",
    ),
    upload_policy=Policy(
        id=2,
        name="policy_up02",
    ),
    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",
  upload: 20,
  download: 70,
  downloadPolicy: {
    id: 1,
    name: "policy_down01",
  },
  uploadPolicy: {
    id: 2,
    name: "policy_up02",
  },
  createdAt: "2017-10-05T15:20:02.000Z",
  updatedAt: "2017-11-05T15:20:02.000Z"
}

Formato dos dados

Parâmetros da url

Campo Descrição
id string

Identificador da Conexão

Deve possuir o formato type:id detalhado em Conexão

Requisição

Campo Descrição
id string

Identificador da conexão

Deve possuir o formato type:id detalhado em Conexão

upload intrequerido

Taxa de upload da conexão (em kbits)

download intrequerido

Taxa de download da conexão (em kbits)

download_policy int

Identificador da política associada a conexão aplicada a download

upload_policy int

Identificador da política associada a conexão aplicada a upload

apply bool

Flag que indica se as informações serão provisionadas imediatamente após a edição

Valor padrão: False

Resposta

Campo Descrição
id string

Identificador da conexão

name string

Nome da conexão

type string

Tipo da conexão

upload int

Taxa de upload da conexão (em kbits)

download int

Taxa de download da conexão (em kbits)

download_policy Policy

Política associada a conexão aplicada a download

Contém os campos id e name

upload_policy Policy

Política associada a conexão aplicada a upload

Contém os campos id e name

created_at string

Data de criação

Formato: ISO-8601

updated_at string

Data da última edição

Formato: ISO-8601