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 in the code, you will call it from the server script in order to use the automation script library.

    For example:

    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 use the $m mechanism, see Code Snippets Support for JavaScript.
  5. At the top-right corner of the page, click one of the save icons. The server automation script library is saved and will be displayed in the Server Automation Script Libraries List.