Jump to content
Welcome to our new Citrix community!

NITRO POSTMAN - Responder Policy


Recommended Posts

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

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.

post-12676430-0-21303800-1495565583_thumb.jpg

post-12676430-0-75126300-1495565589_thumb.jpg

post-12676430-0-97603100-1495565599_thumb.jpg

post-12676430-0-98691400-1495565607_thumb.jpg

post-12676430-0-87192700-1495565613_thumb.jpg

post-12676430-0-50153700-1495565619_thumb.jpg

Link to comment
Share on other sites

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

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

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

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:

 

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

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

 

 
Error:
 
{
  "errorcode": 1094,
  "message": "Too few arguments",
  "severity": "ERROR"
}

 

 

OR

 
 
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

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 = DELETE

This 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

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...