Douglas Padilha Posted May 23, 2017 Share Posted May 23, 2017 Hi all, I am trying to perform a responder policy bind to a VIP via POSMAN however is not working. Please help. Please see attach the VIP, responder policy, Postman and error. Link to comment Share on other sites More sharing options...
Esther Barthel1709153226 Posted May 23, 2017 Share Posted May 23, 2017 Hi Douglas, If you check out the NITRO API reference guide (http://docs.citrix.com/en-us/netscaler/11-1/nitro-api/nitro-rest/api-reference/configuration/load-balancing/lbvserver_rewritepolicy_binding.html), you'll notice that there is no need to mention the lbvserver name in the URL, just use: http://<netscaler-ip-address/nitro/v1/config/lbvserver_rewritepolicy_binding And secondly, try a JSON payload that does not have the unused parameters in it: { "lbvserver_rewritepolicy_binding":{ "name":SSL_web_Vip, "policyname":pol_redirect, "priority":100, "gotopriorityexpression":"END", "bindpoint":"REQUEST", "invoke":false }} Let me know if that solved the error. Cheers, Esther Link to comment Share on other sites More sharing options...
Douglas Padilha Posted May 23, 2017 Author Share Posted May 23, 2017 Hi Esther, thank you for taking the time to help. I tried the solution you provided but did not work, also tried with the following: http://192.168.1.150/nitro/v1/config/lbvserver_responderpolicy_binding { "lbvserver_responderpolicy_binding":{ "name":SSL_Web_Vip, "policyname":pol_redirect, "priority":100, "gotopriorityexpression":END, "bindpoint":REQUEST, "invoke":false, }} Included more screenshots to help fix the error. Please see attached. Thank you once again. Link to comment Share on other sites More sharing options...
Esther Barthel1709153226 Posted May 24, 2017 Share Posted May 24, 2017 Hi Douglas, No problem, I like to share my experience with NITRO, so happy to help you out. So I have tested it in my own (demo) environment, using postman (and my powershell scripts). I'm using the following settings in POSTMAN: URL: http://192.168.0.2/nitro/v1/config/lbvserver_rewritepolicy_binding JSON payload: { "lbvserver_rewritepolicy_binding": { "priority": 100, "policyname": "rwp_store_redirect", "name": "vsvr_SFStore", "bindpoint": "REQUEST", "gotopriorityexpression": "END" } } and HTTP method PUT You might want to check your authorization settings as I configured it for basic auth and entered the username and password to logon to the NetScaler. I checked the settings for the binding with the GET method, and got the following result: { "errorcode": 0, "message": "Done", "severity": "NONE", "lbvserver_rewritepolicy_binding": [ { "name": "vsvr_SFStore", "policyname": "rwp_store_redirect", "stateflag": "536936449", "priority": "100", "gotopriorityexpression": "END", "bindpoint": "REQUEST", "invoke": false, "labeltype": "", "labelname": "" } ] } So can you check your authorization settings? Cheers, Esther P.S. Hang on, I'm just noticing that I'm binding the rewrite policy, will check for the responder policy sample I have right now! Link to comment Share on other sites More sharing options...
Esther Barthel1709153226 Posted May 24, 2017 Share Posted May 24, 2017 I do not get errors either if using the following command in my demo environment: Method = PUT URL = http://192.168.0.2/nitro/v1/config/lbvserver_responderpolicy_binding/vsvr_SFStore_http_redirect payload = { "lbvserver_responderpolicy_binding": { "priority": 100, "policyname": "rspp_http_https_redirect", "name": "vsvr_SFStore_http_redirect", "gotopriorityexpression": "END" } } And the check with the GET method: { "errorcode": 0, "message": "Done", "severity": "NONE", "lbvserver_responderpolicy_binding": [ { "name": "vsvr_SFStore_http_redirect", "policyname": "rspp_http_https_redirect", "stateflag": "536936450", "priority": "100", "gotopriorityexpression": "END", "invoke": false, "labeltype": "", "labelname": "" } ] } So looks like I can get the same results for the responder policy as well. Cheers, Esther Link to comment Share on other sites More sharing options...
Douglas Padilha Posted May 25, 2017 Author Share Posted May 25, 2017 Hi Esther, tested this last night, works perfectly. Thank you so much! Today was able configure things like server,vserver, bind service and group service via Postman, however not unbind them. Can you share the script to unbind the responder policy please. I believe this post will be great assistance for other people as well. Thank you again. Link to comment Share on other sites More sharing options...
Esther Barthel1709153226 Posted May 26, 2017 Share Posted May 26, 2017 Hi Douglas, I'm happy I could help you get the configuration going for you with POSTMAN. You can check out the different options for NITRO in the API reference as well (http://docs.citrix.com/en-us/netscaler/11-1/nitro-api/nitro-rest/api-reference/configuration/load-balancing/lbvserver_rewritepolicy_binding.html). If you look at the operations, you'll notice that there are different operations mentioned, with different parameters to enter. To remove a binding, use the following information: delete: URL: http://<netscaler-ip-address>/nitro/v1/config/lbvserver_responderpolicy_binding/name_value<String> HTTP Method: DELETE Make sure you are using DELETE as your method in postman to remove the binding (and use the right name) in the url. No JSON payload has to be provided if I'm not mistaken. Let me know if that works for you, or if you need more details on the usage of the information in POSTMAN. Cheers, Esther Link to comment Share on other sites More sharing options...
Douglas Padilha Posted May 29, 2017 Author Share Posted May 29, 2017 Hi Esther, attempted to make it work during the weekend but still getting an error. This is the following configuration used: VIP: DIGITAL_PROD_SSL Policy: DIG_to_KENT_pol Method: DELETE Authorization: BASIC http://192.168.1.150/nitro/v1/config/lbvserver_responderpolicy_binding/DIGITAL_PROD_SSL Error: { "errorcode": 1094, "message": "Too few arguments", "severity": "ERROR" } OR http://192.168.1.150/nitro/v1/config/lbvserver_responderpolicy_binding/DIGITAL_PROD_SSL/DIG_to_KENT_pol Method: DELETE Authorization: BASIC Error: Status: 200 OK { "errorcode": -1, "message": "Invaild query parameters [encode the special characters if any]", "severity": "ERROR" } Thanks. Link to comment Share on other sites More sharing options...
Esther Barthel1709153226 Posted June 1, 2017 Share Posted June 1, 2017 Douglas, My bad! The online NITRO API reference does not mention the extra arguments you can provide for the URL, so I checked the function I added (and tested) to my PowerShell Module and have a 'small' addition to the URL you can use in POSTMAN: I'm using the following URL: http://192.168.0.2/nitro/v1/config/lbvserver_responderpolicy_binding/vsvr_SFStore_http_redirect?args=policyname:rspp_http_https_redirect Method = DELETEThis returns the following code in POSTMAN: { "errorcode": 0, "message": "Done", "severity": "NONE" } So try to add the policy name as an extra argument to the URL in POSTMAN to succesfully unbind the policy http://[NSIP]/nitro/v1/config/lbvserver_responderpolicy_binding/[vserverName]?args=policyname:[policyName] In your case, it would read: http://192.168.1.150/nitro/v1/config/lbvserver_responderpolicy_binding/DIGITAL_PROD_SSL?args=policyname:DIG_to_KENT_pol Can you try this for me and let me know if that does the trick? Cheers, Esther 1 Link to comment Share on other sites More sharing options...
Douglas Padilha Posted June 5, 2017 Author Share Posted June 5, 2017 Hi Esther, IBM Softlayer had a Powershell script ready and provided but I prefer POSTMAN interface. Just tested on my demo lab and it worked. Thank you so much! Link to comment Share on other sites More sharing options...
Esther Barthel1709153226 Posted June 6, 2017 Share Posted June 6, 2017 You're welcome Douglas! I'm happy I could help and get you the right syntax for the REST API call. And I love POSTMAN as well for testing the REST API calls in my lab, before turning them into PowerShell Functions for my -PS-NITRO Module :-) Cheers, Esther Link to comment Share on other sites More sharing options...
Sabari Shanmugam Posted June 4, 2020 Share Posted June 4, 2020 Hi All, I'm trying to bind my service group to VIP via API call however its throwing error as json format is wrong. I have used the same format mentioned in the Nitro API guide. Could you please help me on this PUT : https://X.X.X.X/nitro/v1/config/lbvserver_servicegroup_binding content type :application/json Auth : Basic Auth { "lbvserver_servicegroup_binding":{ "name": "Satheesh1", "servicename": "sabari_SG", "weight": "1", "servicegroupname": "sabari_SG" }} Error: { "errorcode": -1, "message": "Invalid payload format. Default format is json", "severity": "ERROR" } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now