- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- Session Management with the API
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Session Management with the API
This may have been asked before, but I can't seem to find a good example for this, my pre-apologies if I missed it.
Is there a guide anywhere for session management with the Management API? I keep running into the issue where the object I'm working on is locked.
My script basically:
* Login, get SID
* Do stuff (add rules / network objects)
* Publish
* Logout
However, without fail, I seem to either crash the smart console because I've left a session hanging around, or I lock an object for the next run of my script.
Do you guys have an overall suggested strategy for handling session management?
Thanks!!!
Joey
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Even in current versions, it's generally better to utilize a separate user for API calls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Once you publish your session, that should release the lock on any changed object/rule/etc.
Logging out should invalidate your SID.
If you can reproduce this consistently, the file generated by api status -s might provide some clues.
That said, I recommend a TAC case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The other thing that I haven't tried yet (I just thought about it), but might be the issue. Should I be using a different user when I'm using the API?
I'm using the same credentials for the API and the Smart Console. Is that a problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Even in current versions, it's generally better to utilize a separate user for API calls.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried it with a new user last night and that seemed to alleviate the problem.
Thanks for the help, much appreciated!!!
