Configuração de cliente Site2Site

Esta é uma API de gerenciamento das configurações de cliente OpenVPN Site2Site.

Listar configurações de cliente OpenVPN Site2Site

API de listagem de configurações paginadas. Ver documentação de paginação.

GET /api/openvpn/clients/site2site/client_id/configs
GET /api/openvpn/clients/site2site/client_id/configs?cursor=0&size=15

Exemplo de requisição

GET /api/openvpn/clients/site2site/1/configs HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
from itflex_sdk.openvpn.types import GetClientSite2SiteConfigsPageRequest

request = GetClientSite2SiteConfigsPageRequest(client_id=1,cursor=0, size=15)
pages = sdk.openvpn.get_client_site2site_configs_pages(request)
const pages = sdk.openvpn.getClientSite2SiteConfigPages();
const response = await pages.next();
console.log(response.payload);

Exemplo de resposta

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

{
  "cursor": {"current": 0, "next": null, "previous": null},
  "configs": [
    {
      "client_id": 1,
      "instance_id": 1,
      "instance_name": "instance-01",
      "static_ip": "192.168.0.1",
      "push_routes": [
        "192.168.0.0/24",
      ],
      "iroutes": [
        "192.168.0.0/24",
      ],
      "push_reset": true,
      "extra_conf":"",
      "dns_server": "",
      "dns_domain": "",
      "max_routes": 512,
      "conn_source_ip": "203.20.5.154",
      "conn_tunnel_ip": "192.168.1.5",
      "conn_status": "connected",
      "created_at": "2017-10-05T12:20:02.932000+00:00",
      "updated_at": "2017-11-05T12:20:02.932000+00:00",
    },
  ],
}
page = pages.next()
page = pages.previous()

# retornar os itens de uma página
for config in page.configs:
    print(config)

# retornar os itens de todas as páginas
for config in pages:
    print(config)
[
  {
    clientId: 1,
    instanceId: 1,
    instanceName: "instance-01",
    staticIp: "192.168.0.1",
    pushRoutes: ["192.168.0.0/24"],
    iroutes: ["192.168.0.0/24"],
    pushReset: true,
    extraConf: "",
    dnsServer: "",
    dnsDomain: "",
    maxRoutes: 512,
    connSourceIp: "203.20.5.154",
    connTunnelIp: "192.168.1.5",
    connStatus: "connected",
    createdAt: "2017-10-05T12:20:02Z",
    updatedAt: "2017-11-05T12:20:02Z"
  }
];

Buscar configuração de cliente OpenVPN Site2Site

API de busca de configuração de cliente OpenVPN Site2Site.

GET /api/openvpn/clients/site2site/client_id/configs/instance_id

Exemplo de requisição

GET /api/openvpn/clients/site2site/1/configs/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
from itflex_sdk.openvpn.types import GetClientSite2SiteConfigRequest

request = GetClientSite2SiteConfigRequest(client_id=1, instance_id=1)
response = sdk.openvpn.get_client_site2site_config(request)
const response = await sdk.openvpn.getClientSite2SiteConfig({
  clientId: 1,
  instanceId: 1
});
console.log(response.payload);

Exemplo de resposta

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

{
  "client_id": 1,
  "instance_id": 1,
  "instance_name": "instance-01",
  "static_ip": "192.168.0.1",
  "push_routes": [
    "192.168.0.0/24",
  ],
  "iroutes": [
    "192.168.0.0/24",
  ],
  "push_reset": true,
  "extra_conf":"",
  "dns_server": "",
  "dns_domain": "",
  "max_routes": 512,
  "conn_source_ip": "203.20.5.154",
  "conn_tunnel_ip": "192.168.1.5",
  "conn_status": "connected",
  "created_at": "2017-10-05T12:20:02.932000+00:00",
  "updated_at": "2017-11-05T12:20:02.932000+00:00",
}
if response.success:
    return response.config
{
  clientId: 1,
  instanceId: 1,
  instanceName: "instance-01",
  staticIp: "192.168.0.1",
  pushRoutes: [
    "192.168.0.0/24",
  ],
  iroutes: [
    "192.168.0.0/24",
  ],
  pushReset: true,
  extraConf:"",
  dnsServer: "",
  dnsDomain: "",
  maxRoutes: 512,
  connSourceIp: "203.20.5.154",
  connTunnelIp: "192.168.1.5",
  connStatus: "connected",
  createdAt: "2017-10-05T12:20:02Z",
  updatedAt: "2017-11-05T12:20:02Z",
}

Editar configuração de cliente OpenVPN Site2Site

API de edição de configuração de cliente OpenVPN Site2Site.

PUT /api/openvpn/clients/site2site/client_id/configs/instance_id

Exemplo de requisição

PUT /api/openvpn/clients/site2site/1/configs/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>

{
  "static_ip": "192.168.0.1",
  "push_routes": [
    "192.168.0.0/24",
  ],
  "iroutes": [
    "192.168.0.0/24",
  ],
  "push_reset": true,
  "extra_conf":"",
  "dns_server": "",
  "dns_domain": "",
  "max_routes": 512,
}
from itflex_sdk.openvpn.types import UpdateClientSite2SiteConfigRequest

request = UpdateClientSite2SiteConfigRequest(
    client_id=1,
    instance_id=1,
    static_ip="192.168.0.1",
    push_routes=["192.168.0.0/24"],
    iroutes=["192.168.0.0/24"],
    push_reset=True,
    extra_conf="",
    dns_server="",
    dns_domain="",
    max_routes=512,
)
response = sdk.openvpn.update_client_site2site_config(request)
const config = sdk.openvpn.ClientSite2SiteConfig();
config.clientId = 1;
config.instanceId = 1;
config.staticIp = "192.168.0.1";
config.pushRoutes = ["192.168.0.0/24"];
config.iroutes = ["192.168.0.0/24"];
config.pushReset = true;
config.extraConf = "";
config.dnsServer = "";
config.dnsDomain = "";
config.maxRutes = 512;

const response = await updateClientSite2SiteConfig(config);
console.log(response.payload);

Exemplo de resposta

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

{
  "client_id": 1,
  "instance_id": 1,
  "instance_name": "instance-01",
  "static_ip": "192.168.0.1",
  "push_routes": [
    "192.168.0.0/24",
  ],
  "iroutes": [
    "192.168.0.0/24",
  ],
  "push_reset": true,
  "extra_conf":"",
  "dns_server": "",
  "dns_domain": "",
  "max_routes": 512,
  "conn_source_ip": null,
  "conn_tunnel_ip": null,
  "conn_status": null,
  "created_at": "2017-10-05T12:20:02.932000+00:00",
  "updated_at": "2017-11-05T12:20:02.932000+00:00",
}
if response.success:
    return response.config
{
  clientId: 1,
  instanceId: 1,
  instanceName: "instance-01",
  staticIp: "192.168.0.1",
  pushRoutes: [
    "192.168.0.0/24",
  ],
  iroutes: [
    "192.168.0.0/24",
  ],
  pushReset: true,
  extraConf:"",
  dnsServer: "",
  dnsDomain: "",
  maxRoutes: 512,
  connSourceIp: null,
  connTunnelIp: null,
  connStatus: null,
  createdAt: "2017-10-05T12:20:02Z",
  updatedAt: "2017-11-05T12:20:02Z",
}

Download certificado com configuração de cliente OpenVPN Site2Site

API de download do certificado com configuração de cliente OpenVPN Site2Site.

GET /api/openvpn/downloads/client_id:instance_id

Exemplo de requisição

GET /api/openvpn/downloads/1:1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>

HTTP/1.1 200 OK
content-type: application/zip

Formato dos dados

Parâmetros da url

Parâmetro Tipo
client_id integer
instance_id integer

Requisição

Parâmetro Tipo Valor Default Descrição
static_ip string IP estático
push_routes list Lista de redes
iroutes list Lista de redes
push_reset boolean Habilita push reset
extra_conf string Configurações extras
dns_server string DNS do server
dns_domain string DNS do domínio
max_routes int Número máxima de rotas

Resposta

Parâmetro Tipo Descrição
client_id integer Identificador do cliente
instance_id integer Identificador da instância
instance_name string Nome da instância
static_ip string IP statico
push_routes list Lista de redes
iroutes list Lista de redes
push_reset boolean Habilita push reset
extra_conf string Configurações extras
dns_server string DNS do server
dns_domain string DNS do domínio
max_routes int Número máxima de rotas
conn_source_ip string IP de origem da conexão do cliente openvpn
conn_tunnel_ip string IP do cliente openvpn na rede VPN do certificado
conn_status string Status da conexão openvpn
Valores possíveis: connected, disconnected
created_at datetime Data de criação
updated_at datetime Data de edição