Forum Discussion

Aditya_01_13899's avatar
Aditya_01_13899
Icon for Nimbostratus rankNimbostratus
Dec 18, 2013

Can anyone give me the sample java code for adding the hosts to HTTPCLASS

Hi , I see that there is an API to create the http class. Which I have used successfully(getLocalLBProfileHttpClass().create(httpclass)).

 

What I am stuck @ is how would I add  hosts to them. I see that the API doc says there is a API
    add_host_match_pattern(String[],MatchPatternString[][])

Also what is the API for adding Actions TO THE HTTPClass.

 

If a sample code is not available can someone tell me how would I create the 2 dimensional "MatchPatternString" array.

 

After reading my questions you must have realize that I am a newbie in this world so any help is appreciated 🙂

 

Thanks

 

1 Reply

  • Found it one can use it this way. Please modify according to your preference. LocalLBMatchPatternString hostMatchPattern = new LocalLBMatchPatternString(); hostMatchPattern.setIs_glob(true); hostMatchPattern.setPattern(""); _interfaces.getLocalLBProfileHttpClass().add_host_match_pattern(_name, new LocalLBMatchPatternString[][] {new LocalLBMatchPatternString[] {hostMatchPattern}}); Hope this helps anyone who was is trying to find it like me