Forum Discussion
myLogin_24886
Nimbostratus
Oct 16, 2007How to set partion after creating a user thru iControl API
Hi,
I have created user using m_userManagement.create_user(users), which didn't have way to define partion. Is their any other API call which I can use to set up the partion.
Thank...
Nov 14, 2007
That is true. In iControl, we have no concept of a "session". Each command is a stateless request/response pair. I won't go into the history on this, but that's currently how the system works.
For commands like the active partition, where a "state" needs to be set, it is implemented as a global lookup value in the iControl portal. We've thought about implementing a user/based configuration for this but it sound like that wouldn't help you anyway since each of your modules are going over the same user.
What we have implemented to help with this is a honor-driven locking mechanism. In the System.SystemInfo interface the following methods are available:
boolean System.SystemInfo.acquire_lock(
in String lock_name,
in long duration_sec,
in String comment
);
String [] System.SystemInfo.get_lock_list();
LockStatus [] System.SystemInfo.get_lock_status(
in String [] lock_names
);
System.SystemInfo.release_lock(
in String lock_name
);The idea is that if you want to build locking into your client application, you would define the lock name you want to use. Then you can call acquire_lock() with that lock name, time to hold lock, and a description to request ownership of that lock. If false is returned for acquire_lock, you can use the get_lock_status() method to query how long that lock is taken and then retry again after the lock is released.
As I said, it's an honor based system, so there is nothing stopping other calls from being made while locks are held, but it does allow you, from within your application, to know when another component is doing something.
Hope this helps...
-Joe
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
