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.
Thanks
15 Replies
- Joe_Hsy_45207
Nimbostratus
The one thing that I've noticed is that there is one active partition per user when accessing via iControl. I have multiple modules making iControl API calls (with the same user/password) whichever module sets the active partition last impacts all other modules.
This makes it difficult for a given module to assume that the active partition it just set is still the active partition in the next call and creates a racing condition. This doesn't seem to be true in the GUI where different GUIs logged in as the same user could still have different active partitions.
I think the partition support in iControl needs to be enhanced to either include a optional parition parameter in most calls (which is a pain) or have some concept of a "session" similar to the GUI and the active partition would be tied to a session. Or is there some other way to work around this issue?
Thanks!
//Joe - 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 - Joe_Hsy_45207
Nimbostratus
Hi Joe,
Thanks for the tip on using locks - it should help with the racing condition between our modules. However, I guess if some other icontrol-based application is also making calls, the problem still exists. If sessions support is too difficult, any thoughts of adding a partition field to the set of APIs that are affected by the partition?
Thanks!
//Joe - We cannot modify the method signatures without breaking backward compatibility. That would mean that we would have to issue a whole new set of APIs that took partitions as parameters. I don't have an exact number, but that would likely be 1000+ new methods we would have to introduce. What is more likely is to have a HTTP header based solution that allows a context of sorts to be passed along with the request. The issue here is that it would require some special work on the part of the client developer to hook into the HTTP headers within their respected SOAP toolkits.
If you see this as a show stopping issue for you, I'd suggest you post this to our support organization so that we can get it into the development queue.
-Joe - Joe_Hsy_45207
Nimbostratus
Thanks, Joe.
I will file a formal request to support. It isn't a show-stopper right now, but I do think it is a ongoing risk as iControl becomes more popular as a platform and more ISVs (which is the case with us at Symphoniq) start creating more iControl-based add-ons. The risk of interference will become greater the more successful iControl becomes as a platform (assuming of course that partiion usage also increases).
//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
