Comments (12)
curl -X GET "http://localhost:9000/workers/" -H "accept: application/json"
{
"detail": "Could not validate credentials"
}
any idea ?
from netpalm.
@iDustbin check out this postman collection for a list of examples
from netpalm.
curl --location --request POST '127.0.0.1:9000/getconfig'
--header 'x-api-key: 2a84465a-cf38-46b2-9d86-b84Q7d57f288'
--header 'Content-Type: application/json'
--data-raw '{
"library": "netmiko",
"connection_args": {
"device_type": "cisco_s300",
"host": "192.168.1.101",
"username": "admin",
"password": "correct_password_included"
},
"command": "show vlan",
"args": {
"use_ttp": true,
"ttp_template": "example"
},
"queue_strategy": "pinned"
}'
response:
{"status":"success","data":{"task_id":"ecd5c12c-3d66-4102-9463-910cab76ab0c","created_on":"2021-09-15 21:33:20.789796","task_queue":"192.168.1.101","task_meta":{"enqueued_at":"2021-09-15 21:33:20.789887","started_at":null,"ended_at":null,"enqueued_elapsed_seconds":"0","total_elapsed_seconds":"0"},"task_status":"queued","task_result":null,"task_errors":[]}}%
curl --location --request GET '127.0.0.1:9000/task/ecd5c12c-3d66-4102-9463-910cab76ab0c'
--header 'x-api-key: 2a84465a-cf38-46b2-9d86-b84Q7d57f288'
--header 'Content-Type: application/json'
--data-raw ''
{"status":"success","data":{"task_id":"ecd5c12c-3d66-4102-9463-910cab76ab0c","created_on":"2021-09-15 21:33:20.789796","task_queue":"192.168.1.101","task_meta":{"enqueued_at":"2021-09-15 21:33:20.789887","started_at":"2021-09-15 21:33:20.808284","ended_at":"2021-09-15 21:33:30.590936","enqueued_elapsed_seconds":"0","total_elapsed_seconds":"9"},"task_status":"finished","task_result":{"show vlan":[[{}]]},"task_errors":[]}}%
another task... can u give me a hint ?
{"status":"success","data":{"task_id":"434e2b64-d37c-4eab-87e5-8dac0fd46a75","created_on":"2021-09-15 21:36:59.847978","task_queue":"192.168.1.101","task_meta":{"enqueued_at":"2021-09-15 21:36:59.848166","started_at":"2021-09-15 21:36:59.866960","ended_at":"2021-09-15 21:37:10.119550","enqueued_elapsed_seconds":"0","total_elapsed_seconds":"10"},"task_status":"finished","task_result":{"show version":[[{}]]},"task_errors":[]}}%
from netpalm.
@iDustbin it appears the TTP parser and or device is not returning anything, based on the above.
from netpalm.
my netmiko output from my own script
Created by: D-Default, S-Static, G-GVRP, R-Radius Assigned VLAN, V-Voice VLAN
Vlan Name Tagged Ports UnTagged Ports Created by
1 1 gi1-10,Po1-8 D
10 10 S
20 20 S
30 30 S
40 40 S
50 50 S
60 60 S
from netpalm.
sure but that is not using TTP?
from netpalm.
curl --location --request POST '127.0.0.1:9000/getconfig'
--header 'x-api-key: 2a84465a-cf38-46b2-9d86-b84Q7d57f288'
--header 'Content-Type: application/json'
--data-raw '{
"library": "netmiko",
"connection_args": {
"device_type": "cisco_s300",
"host": "192.168.1.101",
"username": "admin",
"password": "correct_password_included"
},
"command": "show vlan",
"queue_strategy": "pinned"
}'
from netpalm.
^ try that
from netpalm.
show version output own script:
Active-image: flash://system/images/image_tesla_hybrid_2.5.8.12_release_cisco_signed.bin
Version: 2.5.8.12
MD5 Digest: a71c6b02ba0bf33f4a828ea5527b7aad
Date: 16-Aug-2021
Time: 23:34:46
Inactive-image: flash://system/images/image1.bin
Version: 2.5.0.83
MD5 Digest: 07968d912499cff5e8b07fdc24779854
Date: 18-Jun-2019
Time: 16:49:35
NAME: "1" DESCR: "SG350-10P 10-Port Gigabit PoE Managed Switch"
PID: SG350-10P-K9 VID: V07 SN: PSZ24451C5R
from netpalm.
ok working. thank you :)
-raw ''
{"status":"success","data":{"task_id":"d6796ba4-5d54-4554-a916-224f7f7e8d41","created_on":"2021-09-15 21:44:09.326703","task_queue":"192.168.1.101","task_meta":{"enqueued_at":"2021-09-15 21:44:09.326778","started_at":"2021-09-15 21:44:09.346586","ended_at":"2021-09-15 21:44:19.136246","enqueued_elapsed_seconds":"0","total_elapsed_seconds":"9"},"task_status":"finished","task_result":{"show vlan":["Created by: D-Default, S-Static, G-GVRP, R-Radius Assigned VLAN, V-Voice VLAN","","Vlan Name Tagged Ports UnTagged Ports Created by ","---- ----------------- ------------------ ------------------ ---------------- "," 1 1 gi1-10,Po1-8 D "," 10 10 S "," 20 20 S "," 30 30 S "," 40 40 S "," 50 50 S "," 60 60 S ",""]},"task_errors":[]}}%
from netpalm.
thank you :*
from netpalm.
no worries @iDustbin, I'd recommend looking into textfsm / ttp parsing some more if you are interested in transforming that response to structured data
i've also built this site http://textfsm.nornir.tech/ if you want to develop your own parsing templates
from netpalm.
Related Issues (20)
- Out of process by orphan processes HOT 5
- Custom scripts fail at failing HOT 3
- FR - caching on scripts
- Bug for newly updated extensibles - not available in swagger and 404 when called
- Scripts to support model definition in same file
- Allow for customization of Response objects HOT 1
- Ability to set TTL on a per-task basis
- FR: static work queues
- FR: method to scrub logs HOT 1
- FR: new extensibles endpoints
- Can't use https://textfsm.nornir.tech to import textfsm templates HOT 2
- Genie not available as parser HOT 4
- Use multiple ttp templates with multiple commands HOT 4
- read_timeout not working in setconfig HOT 1
- Can't retrieve response HOT 2
- Published Containers have expired certs
- Adding new driver SOAP HOT 4
- Error installing netpalm HOT 2
- Docker containers keep restarting HOT 7
- Swagger documentation now rendered anymore."Please indicate a valid Swagger or OpenAPI version field" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netpalm.