Forum Discussion
set Session Status using LocalLB::SessionStatus
I'm trying to set a node's session status using the iControl API on a BIGIP v11.1.0 server.
Looking through the API documentation, I found LocalLB::Pool::set_member_session_enabled_state. This function takes the following inputs:
1. pool_names(String []) = The pool names to which the specified members belong.
2. members (AddressPort [] []) = The pool members to modify.
3. session_states (EnabledState [] [])
The third parameter, session_states, is of type Common::EnabledState, which has the following possible values:
A) 0 = STATE_DISABLED
B) 1 = STATE_ENABLED
However, (and this is where I get lost) this differs from the response returned by LocalLB::Pool::get_member_session_status. This get function returns a LocalLB::SessionStatus, which has the following possible values:
A) 0 = SESSION_STATUS_ENABLED
B) 1 = SESSION_STATUS_DISABLED
C) 2 = SESSION_STATUS_FORCED_DISABLED
D) 3 = SESSION_STATUS_ADDRESS_DISABLED
The AskF5 Knowledge Base article on Best Practice for "Disabling nodes or pool members for maintenance", describes the difference between
* a "disabled" pool member/node and
* a "forced offline" pool member/node
It looks to me that these are SESSION_STATUS_DISABLED and SESSION_STATUS_FORCED_DISABLED, respectfully.
Is there a way to set the Session Status of a node such that you can explicitly specify whether the node should become "disabled" or "forced offline"?
Or can someone otherwise explain the discrepancy between the returned value from get_member_session_status() and the input value to set_member_session_enabled_state()?
TIA
- Check out this article I wrote on how you programmatically configure the three-way-toggle setting for the state of a pool member ("enabled", "disabled", or "forced offline").
- Michael_57183NimbostratusHi Joe,
- Bencheng31_1149NimbostratusI am a beginner on doing perl scirpt using iControl, I am trying to modify a perl script poolToggle.pl download from F5 DevCentral samples with replacing the methods deprecated in v11.0, "set_member_session_enabled_state" is one of the methods I used to replace the "set_session_enabled_state". As there is one more parameter "members" required, I have used "get_member_v2" method to return the member list from the pool. And I am encountering error "Cannot convert a struct to a string" when the scripting running at below sub routine.
- Bencheng31_1149NimbostratusI am a beginner on doing perl scirpt using iControl, I am trying to modify a perl script poolToggle.pl download from F5 DevCentral samples with replacing the methods deprecated in v11.0, "set_member_session_enabled_state" is one of the methods I used to replace the "set_session_enabled_state". As there is one more parameter "members" required, I have used "get_member_v2" method to return the member list from the pool. And I am encountering error "Cannot convert a struct to a string" when the scripting running at below sub routine.
I believe the error is coming from the 3rd "session_states" parameter. The API calls for a 2-d array of Common.EnabledState enums.
https://devcentral.f5.com/wiki/iControl.LocalLB__Pool__set_member_session_enabled_state.ashx
set_member_session_enabled_state( in String [] pool_names, in Common__AddressPort [] [] members, in EnabledState [] [] session_states );
EnabledState is an enum with a value of "STATE_ENABLED" or "STATE_DISABLED". You are passing in what looks like a 2-d array of structures containing a member and state.
The server is most likely trying to parse the value of the enum and is coming across a structure instead.
-Joe
- Bencheng31_1149NimbostratusHi Joe
Recent Discussions
Related Content
* 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