Creating Automation Script Libraries

To create an automation script library, follow these steps:

  1. At the top-right corner of the Server Automation Script Libraries List. page, click the Insert icon. The Add Server Automation Script Library page appears.
  2. In the Name field, enter the name of the library.
  3. In the Code field, enter the script code (write code using Server SDK functions).
  4. NOTE  Make sure to include a function within the code, you will call it from the server script in order to use the automation script library.

     

    Copy
    var FTOSExample = FTOSExample || (function () {
            var count = 100;

            this.getCount = function () {
                    return count;
            }

            return {
                getCount: this.getCount
            }
    });

    To avoid calling the wrong methods and attributes, you can use the ‘$m’ mechanism when writing the code. For more information on how to the mechanism, see $m Mechanism.
  5. At the top-right corner of the page, click one of the save icons. The server automation script library is saved into the system and will be displayed in the Server Automation Script Libraries List.