Ktdemo10 (apply the tiering policy) – HP XP Command View Advanced Edition Software User Manual
Page 257
/* 1) Device number of target (want to reset tiering policy to */
/* default) volume is specified in the DEVN() option value */
/* in the script's argument. */
/* */
/**********************************************************************/
/* Sample script begins. */
SAY "#-- BEGIN KTDEMO05.";
/*
* Parse argument specified in the EXEC command.
*/
PARSE UPPER ARG @options
PARSE UPPER VALUE @options 'DEVN()' with 'DEVN('opt_devn')';
/*
* Check option values in the argument.
*/
IF opt_devn = '' THEN DO
SAY "Please specify DEVN() value in the argument.";
EXIT 8;
END;
/*
* Reset tiering policy of the target volume.
*/
CALL KTDCTDEV "MSG(DEMO_MSG.) DEVN("opt_devn")";
/*
* Check the return code to see if it is 0 or not.
*/
IF RESULT /= 0 THEN DO
CALL printErrorMessage "KTDCTDEV" RESULT;
EXIT 8;
END;
SAY "#-- END KTDEMO05."; /* 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;
KTDEMO10 (Apply the tiering policy)
/* REXX */
/**********************************************************************/
/* */
/* All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd. */
User Guide
257