HP XP Command View Advanced Edition Software User Manual

Page 251

Advertising
background image

PARSE UPPER ARG @options

PARSE UPPER VALUE @options 'POLICY()' with 'POLICY('opt_policyid')';

PARSE UPPER VALUE @options 'PREFIX()' with 'PREFIX('opt_prefix')';

/*

* Check option values in the argument.

*/

IF opt_policyid = '' THEN DO

SAY "Please specify POLICY() value in the argument.";

EXIT 8;

END;

IF opt_prefix = '' THEN DO

SAY "Please specify PREFIX() value in the argument.";

EXIT 8;

END;

/*

* Parse tiering policy information CSV file

* and create TPG configuration file(s).

*/

CALL KTIMPORT "MSG(DEMO_MSG.)",

" PREFIX("opt_prefix") POLICY("opt_policyid")";

/*

* Check the return code to see if it is 0 or not.

*/

IF RESULT /= 0 THEN DO

CALL printErrorMessage "KTIMPORT" RESULT;

EXIT 8;

END;

SAY "#-- END KTDEMO02."; /* The sample script completed. */

EXIT 0;

/*

* printErrorMessage: This procedure prints all of the error messages

* in the Message structure when a CLI command failed.

*/

printErrorMessage: procedure expose DEMO_MSG.

ARG cli_name cli_result;

SAY "Command name=" || cli_name || ",result=" || cli_result;

IF DATATYPE(DEMO_MSG.0) = 'NUM' THEN

DO x = 1 to DEMO_MSG.0;

SAY "Severity = " || DEMO_MSG.x.Severity;

SAY "Text = " || DEMO_MSG.x.Text;

SAY "Value = " || DEMO_MSG.x.Value;

END;

RETURN 0;

KTDEMO03 (Display the contents of the tiering policy group definition file)

/* REXX */

/**********************************************************************/

/* */

/* All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd. */

/* */

/**********************************************************************/

/* */

/* KTDEMO03 - A sample demonstration script that */

User Guide

251

Advertising