Forum Discussion
c# get_ramcache_entry()
Anyone have any luck getting this to work?
7 Replies
- Michael_Yates
Nimbostratus
Have you looked at the SDK Example?
http://devcentral.f5.com/wiki/iControl.LocalLB__RAMCacheInformation__get_ramcache_entry.ashx
If so, can you post the code sample? - Hugh123
Nimbostratus
Hello sir, I have looked at this example, but am still unsure how to call the method with the keys. Here's what I have so far:iControl.LocalLBRAMCacheInformationRAMCacheKey key2 = new iControl.LocalLBRAMCacheInformationRAMCacheKey(); LocalLBRAMCacheInformationRAMCacheEntry[] RamE; Interfaces m_interfaces = new Interfaces(); m_interfaces.initialize(ipAddress, user, pass); key2.maximum_responses = 500; key2.profile_name = ""; RamE = m_interfaces.LocalLBRAMCacheInformation.evict_all_ramcache_entries(); <-- Not sure what to put here
I've tried entering the key2.maximum_responses and key2.profile_name, but get either invalid arguments, or method doesn't take x arguments. - Michael_Yates
Nimbostratus
An "evict_all_ramcache_entries" takes no parameters.
It should work as long as your HTTP Profile Name and Partition match.
http://devcentral.f5.com/wiki/iControl.LocalLB__RAMCacheInformation__evict_all_ramcache_entries.ashx - Hugh123
Nimbostratus
Hi sir,
Thanks for the response. However, I don't think that's going to work. What we're trying to do is be able to query the ramcache entries for a specific profile, and only evict on the specified one, instead of clearing the cache for all profiles. Unless I'm misinterpreting your post? - Michael_Yates
Nimbostratus
OK. I think I see the disconnect. I apologize.There are three methods for doing this:
evict_all_ramcache_entries Resets/evicts all cache entries. BIG-IP_v9.0.5evict_ramcache_entry Note: This function has been deprecated. Please use evict_ramcache_entry_v2. Resets/evicts the cache entries associated with the specified keys. Note: The "max_responses" field in each RAMCacheKey key is ignored in this method. BIG-IP_v9.0.5evict_ramcache_entry_v2 Resets/evicts the cache entries associated with the specified keys. Note: The "max_responses" field in each RAMCacheKey key is ignored in this method.The first takes no input and flushes the entire RAMCache.The second was deprecated.I think that you will need to use the third (evict_ramcache_entry_v2). It takes the following Parameters:http://devcentral.f5.com/wiki/iCont...ry_v2.ashxParameter Type Descriptionkeys RAMCacheKey[] The keys used to evict the RAM cache entries.exact_match boolean Whether to look for an exact match for host and uri. If exact, you must specify host and uri in the key. If non-exact, host and uri can be a subset of the text in a matched entry during the search.I haven't used this method yet but I am currently working on a thick client application for this and will post the method when I have it completed. - Hugh123
Nimbostratus
Hi sir,
We figured this out, with the great wonder that is dubdub. I was instantiating the keys incorrectly, which was causing the error. While we did have to use the evict_ramcache_entry_v2 method due to the original one being deprecated, we were able to get this to work to specify which http_profile we wanted to clear the cache for.LocalLBRAMCacheInformationRAMCacheKey prof_key = new LocalLBRAMCacheInformationRAMCacheKey(); LocalLBRAMCacheInformationRAMCacheKey[] keys = new LocalLBRAMCacheInformationRAMCacheKey[] { prof_key }; Interfaces m_interfaces = new Interfaces(); m_interfaces.initialize(ipAddress, user, pass); prof_key.host_name = ""; prof_key.maximum_responses = 500; prof_key.profile_name = ""; prof_key.uri = ""; m_interfaces.LocalLBRAMCacheInformation.evict_ramcache_entry_v2(keys, false);
Thanks for your help!
Matt - Hugh123
Nimbostratus
I should add, in addition, we were able to get the get_ramcache_entries working as well. This will allow us to query how many objects the profile currently has to evict, prior to removing, them, then validate that the eviction was successfully completed.
Matt
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
