ADC NITRO APIs

policyhttpcallout

Configuration for HTTP callout resource.

Properties

(click to see Operations )

Name Data Type Permissions Description
name <String> Read-write Name for the HTTP callout. Not case sensitive. Must begin with an ASCII letter or underscore (_) character, and must consist only of ASCII alphanumeric or underscore characters. Must not begin with 're' or 'xp' or be a word reserved for use as an expression qualifier prefix (such as HTTP) or enumeration value (such as ASCII). Must not be the name of an existing named expression, pattern set, dataset, stringmap, or HTTP callout.

Minimum length = 1
ipaddress <String> Read-write IP Address of the server (callout agent) to which the callout is sent. Can be an IPv4 or IPv6 address.

Mutually exclusive with the Virtual Server parameter. Therefore, you cannot set the <IP Address, Port> and the Virtual Server in the same HTTP callout.
port <Integer> Read-write Server port to which the HTTP callout agent is mapped. Mutually exclusive with the Virtual Server parameter. Therefore, you cannot set the <IP Address, Port> and the Virtual Server in the same HTTP callout.

Minimum value = 1
vserver <String> Read-write Name of the load balancing, content switching, or cache redirection virtual server (the callout agent) to which the HTTP callout is sent. The service type of the virtual server must be HTTP. Mutually exclusive with the IP address and port parameters. Therefore, you cannot set the <IP Address, Port> and the Virtual Server in the same HTTP callout.

Minimum length = 1
returntype <String> Read-write Type of data that the target callout agent returns in response to the callout.

Available settings function as follows:

* TEXT - Treat the returned value as a text string.

* NUM - Treat the returned value as a number.

* BOOL - Treat the returned value as a Boolean value.

Note: You cannot change the return type after it is set.

Possible values = BOOL, NUM, TEXT
httpmethod <String> Read-write Method used in the HTTP request that this callout sends. Mutually exclusive with the full HTTP request expression.

Possible values = GET, POST
hostexpr <String> Read-write String expression to configure the Host header. Can contain a literal value (for example, 10.101.10.11) or a derived value (for example, http.req.header("Host")). The literal value can be an IP address or a fully qualified domain name. Mutually exclusive with the full HTTP request expression.

Minimum length = 1
urlstemexpr <String> Read-write String expression for generating the URL stem. Can contain a literal string (for example, "/mysite/index.html") or an expression that derives the value (for example, http.req.url). Mutually exclusive with the full HTTP request expression.

Minimum length = 1
headers <String[]> Read-write One or more headers to insert into the HTTP request. Each header is specified as "name(expr)", where expr is an expression that is evaluated at runtime to provide the value for the named header. You can configure a maximum of eight headers for an HTTP callout. Mutually exclusive with the full HTTP request expression.
parameters <String[]> Read-write One or more query parameters to insert into the HTTP request URL (for a GET request) or into the request body (for a POST request). Each parameter is specified as "name(expr)", where expr is an expression that is evaluated at run time to provide the value for the named parameter (name=value). The parameter values are URL encoded. Mutually exclusive with the full HTTP request expression.
bodyexpr <String> Read-write An advanced string expression for generating the body of the request. The expression can contain a literal string or an expression that derives the value (for example, client.ip.src). Mutually exclusive with -fullReqExpr.

Minimum length = 1
fullreqexpr <String> Read-write Exact HTTP request, in the form of an expression, which the Citrix ADC sends to the callout agent. If you set this parameter, you must not include HTTP method, host expression, URL stem expression, headers, or parameters.

The request expression is constrained by the feature for which the callout is used. For example, an HTTP.RES expression cannot be used in a request-time policy bank or in a TCP content switching policy bank.

The Citrix ADC does not check the validity of this request. You must manually validate the request.

Minimum length = 1
scheme <String> Read-write Type of scheme for the callout server.

Possible values = http, https
resultexpr <String> Read-write Expression that extracts the callout results from the response sent by the HTTP callout agent. Must be a response based expression, that is, it must begin with HTTP.RES. The operations in this expression must match the return type. For example, if you configure a return type of TEXT, the result expression must be a text based expression. If the return type is NUM, the result expression (resultExpr) must return a numeric value, as in the following example: http.res.body(10000).length.

Minimum length = 1
cacheforsecs <Double> Read-write Duration, in seconds, for which the callout response is cached. The cached responses are stored in an integrated caching content group named "calloutContentGroup". If no duration is configured, the callout responses will not be cached unless normal caching configuration is used to cache them. This parameter takes precedence over any normal caching configuration that would otherwise apply to these responses.

Note that the calloutContentGroup definition may not be modified or removed nor may it be used with other cache policies.

Minimum value = 1

Maximum value = 31536000
comment <String> Read-write Any comments to preserve information about this HTTP callout.
hits <Double> Read-only Total hits.
undefhits <Double> Read-only Total undefs.
svrstate <String> Read-only The state of the service.

Possible values = UP, DOWN, UNKNOWN, BUSY, OUT OF SERVICE, GOING OUT OF SERVICE, DOWN WHEN GOING OUT OF SERVICE, NS_EMPTY_STR, Unknown, DISABLED
effectivestate <String> Read-only The effective state of the service.

Possible values = UP, DOWN, UNKNOWN, BUSY, OUT OF SERVICE, GOING OUT OF SERVICE, DOWN WHEN GOING OUT OF SERVICE, NS_EMPTY_STR, Unknown, DISABLED
undefreason <String> Read-only Reason for last undef.

Possible values = Failed to add service, Vserver not found, Not a HTTP or SSL vserver, Generated callout request is invalid, Content-Length header not found in callout request, Not enough space to put Content-Length value, Config incomplete, Server is DOWN, Creating callout connection failed, No memory to generate callout request packets, No memory to create callout task, No memory to create callout async, Callout request expression undef, No callout response expression, Skipped callout response eval, Callout response pixl init undef, Callout response expression undef
recursivecallout <Double> Read-only Number of recursive callouts.
__count <Double> Read-only count parameter

Operations

(click to see Properties )

  • ADD
  • DELETE
  • UPDATE
  • UNSET
  • GET (ALL)
  • GET
  • COUNT

Some options that you can use for each operations:

  • Getting warnings in response: NITRO allows you to get warnings in an operation by specifying the 'warning' query parameter as 'yes'. For example, to get warnings while connecting to the NetScaler appliance, the URL is as follows:

    http:// <netscaler-ip-address> /nitro/v1/config/login?warning=yes

    If any, the warnings are displayed in the response payload with the HTTP code '209 X-NITRO-WARNING'.

  • Authenticated access for individual NITRO operations: NITRO allows you to logon to the NetScaler appliance to perform individual operations. You can use this option instead of creating a NITRO session (using the login object) and then using that session to perform all operations,

    To do this, you must specify the username and password in the request header of the NITRO request as follows:

    X-NITRO-USER: <username>

    X-NITRO-PASS: <password>

    Note: In such cases, make sure that the request header DOES not include the following:

    Cookie:NITRO_AUTH_TOKEN= <tokenvalue>

*Note: * Mandatory parameters are marked in red and placeholder content is marked in green

add

URL: http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout HTTP Method: POST

Request Headers:

Cookie:NITRO_AUTH_TOKEN= <tokenvalue>

Content-Type:application/json

Request Payload:

{"policyhttpcallout":{
<b>"name":<String_value>,
</b>"ipaddress":<String_value>,
"port":<Integer_value>,
"vserver":<String_value>,
"returntype":<String_value>,
"httpmethod":<String_value>,
"hostexpr":<String_value>,
"urlstemexpr":<String_value>,
"headers":<String[]_value>,
"parameters":<String[]_value>,
"bodyexpr":<String_value>,
"fullreqexpr":<String_value>,
"scheme":<String_value>,
"resultexpr":<String_value>,
"cacheforsecs":<Double_value>,
"comment":<String_value>
}}

<!--NeedCopy-->

Response: HTTP Status Code on Success: 201 Created

HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error

delete

URL: http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout/ name_value<String> HTTP Method: DELETE

Request Headers:

Cookie:NITRO_AUTH_TOKEN= <tokenvalue>

Response: HTTP Status Code on Success: 200 OK

HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error

update

URL: http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout HTTP Method: PUT

Request Headers:

Cookie:NITRO_AUTH_TOKEN= <tokenvalue>

Content-Type:application/json

Request Payload:

{"policyhttpcallout":{
<b>"name":<String_value>,
</b>"ipaddress":<String_value>,
"port":<Integer_value>,
"vserver":<String_value>,
"returntype":<String_value>,
"httpmethod":<String_value>,
"hostexpr":<String_value>,
"urlstemexpr":<String_value>,
"headers":<String[]_value>,
"parameters":<String[]_value>,
"bodyexpr":<String_value>,
"fullreqexpr":<String_value>,
"scheme":<String_value>,
"resultexpr":<String_value>,
"cacheforsecs":<Double_value>,
"comment":<String_value>
}}

<!--NeedCopy-->

Response: HTTP Status Code on Success: 200 OK

HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error

unset

URL: http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout? action=unset HTTP Method: POST

Request Headers:

Cookie:NITRO_AUTH_TOKEN= <tokenvalue>

Content-Type:application/json

Request Payload:

{"policyhttpcallout":{
<b>"name":<String_value>,
</b>"ipaddress":true,
"port":true,
"vserver":true,
"httpmethod":true,
"hostexpr":true,
"urlstemexpr":true,
"headers":true,
"parameters":true,
"bodyexpr":true,
"fullreqexpr":true,
"resultexpr":true,
"cacheforsecs":true,
"comment":true
}}

<!--NeedCopy-->

Response: HTTP Status Code on Success: 200 OK

HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error

get (all)

URL: http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout Query-parameters: attrs http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout? attrs=property-name1,property-name2

Use this query parameter to specify the resource details that you want to retrieve.

filter http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout? filter=property-name1:property-val1,property-name2:property-val2

Use this query-parameter to get the filtered set of policyhttpcallout resources configured on NetScaler.Filtering can be done on any of the properties of the resource.

view http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout? view=summary

Use this query-parameter to get the summary output of policyhttpcallout resources configured on NetScaler.

Note: By default, the retrieved results are displayed in detail view (?view=detail).

pagination http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout? pagesize=#no;pageno=#no

Use this query-parameter to get the policyhttpcallout resources in chunks.

HTTP Method: GET

Request Headers:

Cookie:NITRO_AUTH_TOKEN= <tokenvalue>

Accept:application/json

Response: HTTP Status Code on Success: 200 OK

HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error

Response Header:

Content-Type:application/json

Response Payload:

{ "policyhttpcallout": [ {
"name":<String_value>,
"ipaddress":<String_value>,
"port":<Integer_value>,
"vserver":<String_value>,
"returntype":<String_value>,
"scheme":<String_value>,
"httpmethod":<String_value>,
"hostexpr":<String_value>,
"urlstemexpr":<String_value>,
"headers":<String[]_value>,
"parameters":<String[]_value>,
"fullreqexpr":<String_value>,
"resultexpr":<String_value>,
"hits":<Double_value>,
"undefhits":<Double_value>,
"svrstate":<String_value>,
"effectivestate":<String_value>,
"undefreason":<String_value>,
"recursivecallout":<Double_value>,
"bodyexpr":<String_value>,
"cacheforsecs":<Double_value>,
"comment":<String_value>
}]}

<!--NeedCopy-->

get

URL: http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout/ name_value<String> Query-parameters: attrs http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout/ name_value<String> ? attrs=property-name1,property-name2

Use this query parameter to specify the resource details that you want to retrieve.

view http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout/ name_value<String> ? view=summary

Use this query-parameter to get the summary output of policyhttpcallout resources configured on NetScaler.

Note: By default, the retrieved results are displayed in detail view (?view=detail).

HTTP Method: GET

Request Headers:

Cookie:NITRO_AUTH_TOKEN= <tokenvalue>

Accept:application/json

Response: HTTP Status Code on Success: 200 OK

HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error

Response Header:

Content-Type:application/json

Response Payload:

{  "policyhttpcallout": [ {
"name":<String_value>,
"ipaddress":<String_value>,
"port":<Integer_value>,
"vserver":<String_value>,
"returntype":<String_value>,
"scheme":<String_value>,
"httpmethod":<String_value>,
"hostexpr":<String_value>,
"urlstemexpr":<String_value>,
"headers":<String[]_value>,
"parameters":<String[]_value>,
"fullreqexpr":<String_value>,
"resultexpr":<String_value>,
"hits":<Double_value>,
"undefhits":<Double_value>,
"svrstate":<String_value>,
"effectivestate":<String_value>,
"undefreason":<String_value>,
"recursivecallout":<Double_value>,
"bodyexpr":<String_value>,
"cacheforsecs":<Double_value>,
"comment":<String_value>
}]}

<!--NeedCopy-->

count

URL: http:// <netscaler-ip-address> /nitro/v1/config/policyhttpcallout? count=yes HTTP Method: GET

Request Headers:

Cookie:NITRO_AUTH_TOKEN= <tokenvalue>

Accept:application/json

Response: HTTP Status Code on Success: 200 OK

HTTP Status Code on Failure: 4xx <string> (for general HTTP errors) or 5xx <string> (for NetScaler-specific errors). The response payload provides details of the error

Response Header:

Content-Type:application/json

Response Payload:

{ "policyhttpcallout": [ { "__count": "#no"} ] }

<!--NeedCopy-->
policyhttpcallout