Customer Portal API

In addition to any valid HTML tag, the following Packeteer-specific tags can be used on a customer portal page. Notice that all of the Packeteer tags begin and end with percent signs. If you want to use a percent sign elsewhere on the page, you must use two of them (%%), otherwise the PacketShaper will try to interpret the percent sign as a Packeteer tag.

Customer Portal Tag Description
%IF(<condition>)%
...
%ENDIF%

Checks a condition to see if it's true. If the condition is true, one or more lines of code will be executed; if the condition is false, different lines of code will be executed.

Example:

%IF (%PCLASSLIST.ERRORSTATUS% != "")%
<h3>Errors encountered while preparing this report:<br>
%PCLASSLIST.ERRORSTATUS% <br>
The rest of your report will be rendered as well as is possible, but there may be missing sections.
Please contact Technical Support with this problem.</h3>
%ENDIF%

<IMG SRC=/customer/Cgi1?OP.MEAS.GETGRAPH=

Inserts a graph generated by the PacketShaper

For details see Include Graphs on a Portal Page

%LOOP%
...
%ENDLOOP%

Repeats one or more lines of code

Example:

%LOOP(PCLASSLIST="Inbound;Inbound/HTTP;Outbound")%
%PCLASSLIST.CURRENT[NAME]%
%PCLASSLIST.CURRENT[BYTES.LAST-MINUTE]%
%ENDLOOP%

%PCLASSLIST.CURRENT[<me-var>.<date-function>]%

Retrieves data from the current entry; used in a %LOOP% statement

where

<me-var> — one of the measurement engine variables available to the customer portal

<date-function> — one of the following: LAST-MINUTE, LAST-15-MINUTES, LAST-60-MINUTES, LAST-FULL-HOUR, LAST-24-HOURS, LAST-7-DAYS, TODAY, YESTERDAY, THIS-MONTH, LAST-MONTH

Example:

%PCLASSLIST.CURRENT[BYTES.LAST-MINUTE]%

%PCLASSLIST.CURRENT[NAME]% Display current class name; used in a %LOOP% statement
%PCLASSLIST.CUSTOMER.MOTD% Inserts the message-of-the-day text
%PCLASSLIST.CUSTOMER.NAME% Inserts the name of the logged-in portal user
%PCLASSLIST.ERRORSTATUS%

Displays the measurement engine's error message when it's unable to retrieve data; can be used inside an %IF% statement to display the message only if there is an error.

Example:

<h3>Errors encountered while preparing this report:<br>
%PCLASSLIST.ERRORSTATUS%</h3>

%PCLASSLIST.NAMED[<named-class-number>.<me-var>.<date.function>]%

Retrieves data from a named class

where

<named-class-number> — the number of the class in your PCLASSLIST. Counting begins at 0; thus, the first class in your PCLASSLIST has a <named-class-number> of 0.

<me-var> — one of the measurement engine variables available to the customer portal

<date-function> — one of the following: LAST-MINUTE, LAST-15-MINUTES, LAST-60-MINUTES, LAST-FULL-HOUR, LAST-24-HOURS, LAST-7-DAYS, TODAY, YESTERDAY, THIS-MONTH, LAST-MONTH

Example:

%PCLASSLIST.NAMED[1.TCP-EFFICIENCY-PCT.LAST-MONTH]%

%PCLASSLIST.TIMESTAMP.START% Inserts the date and time of the beginning of the period for which measurement data was tracked
%PCLASSLIST.TIMESTAMP.END% Inserts the date and time of the end of the period for which measurement data was tracked
%PUSH(PCLASSLIST'"<class-names>")%

Defines the traffic classes which are to be reported on the portal page. It must appear at the beginning of the portal page. You can list up to 20 traffic classes; each class name must be separated by a semi-colon, and quote marks must surround the list of class names.

Example:

%PUSH(PCLASSLIST="/Inbound;/Outbound;/Inbound/HTTP;/Outbound/HTTP")%

%PUSH (PCLASSLIST="SEARCH:NAME=<string>")%

Dynamically builds a class list based on a <string> in a class' name

Example:

The following statement builds a class list of all the classes that have "HTTP" in the class name:

%PUSH(PCLASSLIST="SEARCH:NAME=HTTP")%

For example: /Inbound/HTTP, /Outbound/HTTP.


%PUSH (PCLASSLIST="SEARCH:NOTES=<string>")%

Dynamically builds a class list based on a <string> in a class' comment (notes) field

Example:

For each class you want to track on the customer portal page, enter the string "PortalPage" in the class' Comment field. Then use the following statement in the customer portal page:

%PUSH(PCLASSLIST="SEARCH:NOTES=PortalPage")%

If you entered "PortalPage" in the Comment field of the /Inbound, /Outbound, /Inbound/HTTP, /Outbound/HTTP, /Inbound/FTP, and /Outbound/FTP classes, the class list would consist of these six classes. If you want to include additional classes later, you don't need to modify the portal page; just add "PortalPage" to the comment field of these classes.

%PUSH (PCLASSLIST="SEARCH:OWNER=<string>")%

Dynamically builds a class list based on a <string> in a class' owner field

Example:

A single PacketShaper tracks data for multiple customers. Each customer has a unique set of classes to measure bandwidth usage. In the class' Owner field, enter the customer's login name. Then use the following statement in the customer portal page:

%PUSH(PCLASSLIST="SEARCH:OWNER=%CUSTOMER.NAME%")%

%CUSTOMER.NAME% evaluates to the name of the logged-in portal user. Thus, when CustomerA logs into the customer portal, he will see statistics for all the classes that have CustomerA in the Owner field. When CustomerB log in, she will see statistics for the classes that have CustomerB in the Owner field.

 

 

        

PacketGuide™ for PacketWise® 8.1