Esta é uma API de cadastro de arquivos de configuração. Estes arquivos são vinculados aos modelos de configuração de roteadores.
Esta API é autenticada usando OAuth2, ver documentação de autenticação
model_id
/files
API de listagem de arquivos de configuração
GET /api/v1/cdm/routers/models/Az2v9wN7wpZcCSDubwReG/files HTTP/1.1
Host: cdm.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
HTTP/1.1 200 OK
Content-Type: application/json
{
"total": 2,
"files": [
{
"id": "AIOu5fCL63DkVPaTAjxNG",
"name": "hello.sh",
"file_path": "/etc/teste/",
"default": false,
"reboot": false,
"executable": true,
"prov_file": "echo 'Hello World!'",
"reload_cmd": ""
},
{
"id": "Az2vFaTMM2SDJftZscqN8",
"name": "logpath.conf",
"file_path": "/etc/",
"default": false,
"reboot": true,
"executable": false,
"prov_file": "LOG_LEVEL=high;LOGS_DIR=/var/log/product-logs/",
"reload_cmd": "systemctl restart fluentd"
}
]
}
model_id
/files/id
API de busca de um arquivo de configuração
GET /api/v1/cdm/routers/models/Az2v9wN7wpZcCSDubwReG/files/AIOu5fCL63DkVPaTAjxNG HTTP/1.1
Host: cdm.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "AIOu5fCL63DkVPaTAjxNG",
"name": "hello.sh",
"file_path": "/etc/teste/",
"default": false,
"reboot": false,
"executable": true,
"prov_file": "echo 'Hello World!'",
"reload_cmd": ""
}
model_id
/files
API de criação de um arquivo de configuração
POST /api/v1/cdm/routers/models/Az2v9wN7wpZcCSDubwReG/files HTTP/1.1
Host: cdm.exemplo.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer <Access-Token>
{
"name": "new-file",
"file_path": "/etc/",
"reboot": true,
"executable": false,
"prov_file": "LOG_LEVEL=high;LOGS_DIR=/var/log/product-logs/",
"reload_cmd": ""
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "Az2vFaTMM2SDJftZscqN8",
"name": "new-file",
"file_path": "/etc/",
"default": false,
"reboot": true,
"executable": false,
"prov_file": "LOG_LEVEL=high;LOGS_DIR=/var/log/product-logs/",
"reload_cmd": ""
}
model_id
/files/id
API de atualização de um arquivo de configuração
PUT /api/v1/cdm/routers/models/Az2v9wN7wpZcCSDubwReG/files/Az2vFaTMM2SDJftZscqN8 HTTP/1.1
Host: cdm.exemplo.com
Content-Type: application/json
Accept: application/json
Authorization: Bearer <Access-Token>
{
"name": "logpath.conf",
"reload_cmd": "systemctl restart fluentd"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "Az2vFaTMM2SDJftZscqN8",
"name": "logpath.conf",
"file_path": "/etc/",
"default": false,
"reboot": true,
"executable": false,
"prov_file": "LOG_LEVEL=high;LOGS_DIR=/var/log/product-logs/",
"reload_cmd": "systemctl restart fluentd"
}
model_id
/files/id
API de remoção de um arquivo de configuração
DELETE /api/v1/cdm/routers/models/Az2v9wN7wpZcCSDub2wReG/files/Az2vFaTMM2SDJftZscqN8 HTTP/1.1
Host: cdm.exemplo.com
Accept: application/json
Authorization: Bearer <Access-Token>
HTTP/1.1 200 OK
Content-Type: application/json