netpalm¶
QuickStart¶
Request job
$ curl -s -X POST "https://netpalm.tech/getconfig?x-api-key=2a84465a-cf38-46b2-9d86-b84Q7d57f288" -H "accept: application/json" -H "Content-Type: application/json" -d "{\"library\":\"netmiko\",\"connection_args\":{\"device_type\":\"juniper_junos_telnet\",\"host\":\"12.0.1.28\",\"username\":\"rviews\",\"password\":\"rviews\"},\"command\":\"show route summary\",\"args\":{\"use_textfsm\":true},\"queue_strategy\":\"pinned\",\"cache\":{\"enabled\":true,\"ttl\":300,\"poison\":false}}" | jq
{
"status": "success",
"data": {
"task_id": "030655c0-e920-4327-be4b-bd1c98528954",
"created_on": "2020-08-19 14:08:13.280456",
"task_queue": "12.0.1.28",
"task_meta": {
"enqueued_at": "2020-08-19 14:08:13.280510",
"started_at": null,
"ended_at": null,
"enqueued_elapsed_seconds": "0",
"total_elapsed_seconds": "0"
},
"task_status": "queued",
"task_result": null,
"task_errors": []
}
}
Get job status
$ curl -s -X GET "https://netpalm.tech/task/030655c0-e920-4327-be4b-bd1c985289ept: application/json" | jq
{
"status": "success",
"data": {
"task_id": "030655c0-e920-4327-be4b-bd1c98528954",
"created_on": "2020-08-19 14:08:13.280456",
"task_queue": "12.0.1.28",
"task_meta": {
"enqueued_at": "2020-08-19 14:08:13.280510",
"started_at": "2020-08-19 14:08:13.444702",
"ended_at": "2020-08-19 14:08:42.717882",
"enqueued_elapsed_seconds": "0",
"total_elapsed_seconds": "29"
},
"task_status": "finished",
"task_result": {
"show route summary": "Autonomous system number: 65000\nRouter ID: 12.0.1.28\n\ninetholddown, 0 hidden)\n Direct: 1 routes, 1 active\n Lo858119 routes, 803635 active\n Static: 107 routes, 107 active\n\ninet6.down, 0 hidden)\n Direct: 1 routes, 1 active\n Local:1 routes, 87663 active\n Static: 2 routes, 2 active\n
},
"task_errors": []
}
}
$ curl -s -X GET "https://netpalm.tech/task/030655c0-e920-4327-be4b-bd1c985289ept: application/json" | jq -r '.data.task_result["show route summary"]'
Autonomous system number: 65000
Router ID: 12.0.1.28
inet.0: 803744 destinations, 12858228 routes (803744 active, 0 holddown, 0 hidden)
Direct: 1 routes, 1 active
Local: 1 routes, 1 active
BGP: 12858119 routes, 803635 active
Static: 107 routes, 107 active
inet6.0: 87669 destinations, 1402587 routes (87669 active, 0 holddown, 0 hidden)
Direct: 1 routes, 1 active
Local: 2 routes, 2 active
BGP: 1402581 routes, 87663 active
Static: 2 routes, 2 active
INET6: 1 routes, 1 active
最終更新日: 2021-06-06 09:29:57