The Show Segmentation Rules command allows you to return a list of all Segmentation Rules in your realm including name and description.
Arguments
Show Segmentation Rules requires the following arguments: Command, Realm, and Password.
api_web?r=myrealm&p=mypass&c=show_seg
The command is ‘show_seg’, the realm is ‘myrealm’ and the password is ‘mypass’. The results include the Segmentation Rule ID and Name sorted alphabetically by rule name.
The Show Segmentation Rules command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd=show_seg c=show_seg |
Realm |
Yes |
Name of the realm to run the command. This is required, and the command will fail if the realm and password do not match. |
realm=[realm_name] r=[realm_name] |
Password |
Yes |
Authentication code for API access. This is required, and the command will fail if the realm and password do not match. |
pwd=[password] p=[password] |
Output Format |
|
To specify the format of the list output, use one of two arguments. If no argument is included, the default output is space-delimited plain text string, which may not include all data columns.
|
csv=1 or output_format=[csv,csv_tab, csv_pipe,xml] |
Header |
|
To define the data with a label, use the Header argument. This can only be used in conjunction with the output format, and does not affect XML. |
headers=[0,1] DEFAULT==0 |
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=show_seg&output_format=csv&headers=1
Successful results return:
"Segmentation ID","Segmentation Name","Description" "1","myseg","" "2","my advanced rule","My Advanced Seg Rule"
If a Description is not defined for a rule, it will appear blank or empty in the results.
Results
The Show Segmentation Rules command outputs either the results of the search or a FAILURE message.
SUCCESS
The Show Segmentation Rules command does not explicitly return a Success code. Instead, it outputs the segmentation rule id and name in plain text format. Use the Output Format argument to return the results in an alternate format.
FAILURE
A Show Segmentation Rules command will fail for several reasons. The result format is:
FAILURE: [Reason]