Esta é uma API para cadastro de Encaminhamento de Zonas.
API de listagem de encaminhamento de zonas paginadas. Ver documentação de paginação.
Exemplo de requisição
GET /api/dns/resolver/forwards HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
from itflex_sdk.dns_resolver.types import GetForwardZonesPageRequest
request = GetForwardZonesPageRequest(cursor=0, size=15)
pages = sdk.dns_resolver.get_forward_zones_pages(request)
response = pages.next()
print(response.payload)
const pages = sdk.dns.getFowardZonesPages();
const response = 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},
"forward_zones": [
{
"id": 1,
"domain": "testing.lan",
"addresses": [
{
"address": "192.168.10.10",
"port": 53
}
],
}
],
}
[
ForwardZone(
id=1,
domain="testing.lan",
addresses=[
Address(
address="192.168.10.10",
port=53
),
],
created_at=DateTime(2018, 11, 26, 10, 16, 39, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2018, 11, 26, 10, 16, 39, tzinfo=Timezone('+00:00'))
),
]
[
{
id: 1,
domain: "testing.lan",
addresses: [
{
address: "192.168.10.10",
port: 53
}
],
createdAt: "2017-10-05T12:20:02.932000+00:00",
updatedAt: "2017-11-05T12:20:02.932000+00:00"
}
];
API de busca de um encaminhamento de zona.
id
Exemplo de requisição
GET /api/dns/resovler/forwards/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
from itflex_sdk.dns_resolver.types import GetForwardZoneRequest
request = GetForwardRequest(id=1)
response = sdk.dns_resolver.get_forward_zone(request)
print(response.payload)
const pages = await sdk.dns.getForwardZone({ id: 1 });
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"domain": "testing.lan",
"addresses": [
{
"address": "192.168.10.10",
"port": 53
}
],
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00",
}
ForwardZone(
id=1,
domain="testing.lan",
addresses=[
Address(
address="192.168.10.10",
port=53
),
]
created_at=DateTime(2018, 11, 26, 10, 16, 39, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2018, 11, 26, 10, 16, 39, tzinfo=Timezone('+00:00'))
)
{
id: 1,
domain: "testing.lan",
addresses: [
{
address: "192.168.10.10",
port: 53
}
],
createdAt: "2017-10-05T12:20:02.932000+00:00",
updatedAt: "2017-11-05T12:20:02.932000+00:00"
}
API para criação de um encaminhamento de zona
Exemplo de requisição
POST /api/dns/resolver/forwards/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
{
"apply": true,
"domain": "testing.lan",
"addresses": [
{
"address": "192.168.10.10",
"port": 53
},
]
}
from itflex_sdk.dns_resolver.types import CreateForwardZoneRequest
request = CreateForwardZoneRequest(
apply=True,
domain="testing.lan",
addresses=[
Address(
address="192.168.10.10",
port=53
),
]
)
response = sdk.dns_resolver.create_forward_zone(request)
print(response.payload)
const response = await sdk.dns.createForwardZone({
apply: true,
domain: "testing.lan",
addresses: [
{
address: "192.168.10.10",
port: 53
}
]
});
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"domain": "testing.lan",
"addresses": [
{
"address": "192.168.10.10",
"port": 53
}
],
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00",
}
ForwardZone(
id=1,
domain="testing.lan",
addresses=[
Address(
address="192.168.10.10",
port=53
),
]
created_at=DateTime(2018, 11, 26, 10, 16, 39, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2018, 11, 26, 10, 16, 39, tzinfo=Timezone('+00:00'))
)
{
id: 1,
domain: "testing.lan",
addresses: [
{
address: "192.168.10.10",
port: 53
}
],
createdAt: "2017-10-05T12:20:02.932000+00:00",
updatedAt: "2017-11-05T12:20:02.932000+00:00"
}
API de edição da encaminhamento de zona.
id
Exemplo de requisição
PUT /api/dns/resolver/forwards/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
{
"apply": true,
"domain": "updatedomain.lan",
"addresses": [
{
"address": "192.168.10.10",
"port": 53
},
{
"address": "192.168.10.12",
"port": 53
},
]
}
from itflex_sdk.dns_resolver.types import UpdateForwardZoneRequest
request = UpdateForwardZoneRequest(
apply=True,
domain="updatedomain.lan",
addresses=[
Address(
address="192.168.10.10",
port=53
),
Address(
address="192.168.10.12",
port=53
),
]
)
response = sdk.dns_resolver.update_forward_zone(request)
print(response.payload)
const response = await sdk.dns.updateForwardZone({
id: 1,
apply: true,
domain: "updatedomain.lan",
addresses: [
{
address: "192.168.10.10",
port: 53
},
{
address: "192.168.10.12",
port: 53
}
]
});
console.log(response.payload);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"domain": "updatedomain.lan",
"addresses": [
{
"address": "192.168.10.10",
"port": 53
},
{
"address": "192.168.10.12",
"port": 53
}
],
"created_at": "2017-10-05T12:20:02.932000+00:00",
"updated_at": "2017-11-05T12:20:02.932000+00:00",
}
ForwardZone(
id=1,
domain="updatedomain.lan",
addresses=[
Address(
address="192.168.10.10",
port=53
),
Address(
address="192.168.10.12",
port=53
),
],
created_at=DateTime(2018, 11, 26, 10, 16, 39, tzinfo=Timezone('+00:00')),
updated_at=DateTime(2018, 11, 28, 10, 16, 39, tzinfo=Timezone('+00:00'))
)
{
id: 1,
domain: "updatedomain.lan",
addresses: [
{
address: "192.168.10.10",
port: 53
},
{
address: "192.168.10.12",
port: 53
}
],
createdAt: "2017-10-05T12:20:02.932000+00:00",
updatedAt: "2017-11-05T12:20:02.932000+00:00"
}
API de deleção de um encaminhamento de zona.
id
Exemplo de requisição
DELETE /api/dns/resolver/forwards/1 HTTP/1.1
Host: api.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
from itflex_sdk.dns_resolver.types import DeleteForwardZoneRequest
request = DeleteForwardZoneRequest(id=1)
response = sdk.dns_resolver.delete_forward_zone(request)
print(response.success)
const response = await sdk.dns.deleteForwardZone({ id: 1 });
console.log(response.success);
Exemplo de resposta
HTTP/1.1 200 OK
Content-Type: application/json
True
true
Parâmetros da url
Campo | Descrição |
---|---|
id | int Idendificador do encaminhamento de zonas |
Requisição
Campo | Descrição |
---|---|
apply | bool Flag para aplicar o provisionamento do encaminhamento de zonas do serviço de DNS Padrão: |
domain | stringrequired único Nome do domínio |
addresses | arrayrequired Lista de endereços de encaminhamento |
Resposta
Campo | Descrição |
---|---|
domain | string Nome do domínio |
addresses | array Lista de endereços de encaminhamento |
created_at | string Data de criação
|
updated_at | string Data da última edição
|