Top
ServerView Resource Orchestrator Cloud Edition V3.1.0 Design Guide
ServerView

F.4 Basic Structure of a Script

This section explains the basic operation and structure of a script used for automatic configuration and operation of network devices.

The basic flow of configuration and operation of network devices using scripts is as follows:

  1. Confirm the syntax of script list file.

  2. The following process is done orderly form the head in script list file.

    1. Specify the target network device.

    2. Complete script file to convert variable information in script file corresponding to "Script Name" with the information of parameter file and so on.

    3. When "cmd operand" is specified in script list, complete specified command file. In this process, variable information in the command file is converted using the information of parameter file and so on.

    4. Script file is executed sequentially from top to bottom.
      At this time, read commands in command file if necessary.

About the function of each files, refer to "F.4.1 Function and Attributes of Each File".

As the example of basic script structure, the following basic structure is shown.

Basic Structure Example when Using Scripts for L-Platform Templates (Automatic Configuration)

Figure F.1 Basic Structure Example when Using Scripts for L-Platform Templates (Automatic Configuration)

Note that selected network device (firewall or server load balancer) is registered at network pool which tenant administrators or tenant users can use.

Script A

Infrastructure administrator prepares this.
The example of basic process in script is the following.

  1. Define variable

  2. Establish telnet/ssh connection with variable (IP address in admin LAN)

  3. Send variable (login account 1)

  4. Send variable (login password 1)

  5. Process command file

    • If command files exist.

      Read command file and send the content of command file by a line. [command transmission]

    • If command files don't exist.

      Execute process of sending and receiving commands. [Command transmission]

  6. Command process ends.

    • If command process ends normally

      Set return value normal.

    • If command process ends abnormally

      Set return value abnormal.

  7. Send variable (logout character string). [Command transmission]

  8. Disconnect telnet/ssh connection.

Script B

Infrastructure administrator prepares this.
The example of basic process in script is the same as script A.

Sclipt List(xxx.lst)

Infrastructure administrator prepares this.
Script list of ruleset selected at creating L-Platform.
Scripts specified in script list are executed sequentially.

Parameter ile(default_param.prm)

Infrastructure administrator prepares this.
Information for setting or changing specified parameter value when tenant administrators or users create or modify L-Platform.

Command File(Any_Name.cli)

Infrastructure administrator prepares this.
Write process after log in to devices with log in accounts excluding command process included in script.

Interface Configuration File(Unm_network_setting.xml)

Infrastructure administrator prepares this.
There is one file per system.

Basic structure for network resource

Figure F.2 Basic Structure Example when Using Scripts for Network Resources

Note that it is possible to specify parameters in script without parameter file.

Script A

This script is prepared by Infrastructure administrator and registered under particular network device ruleset folder.
The example of basic process in script is as follows:

  1. Define variable

  2. Establish telnet/ssh connection with variable (IP address in admin LAN)

  3. Send variable (login account 1)

  4. Send variable (login password 1)

  5. Process command file

    • If command files exist.

      Read command file and send the content of command file by one line. [command transmission]

    • If command files don't exist.

      Execute process of sending and receiving commands. [Command transmission]

  6. Command process ends.

    • If command process ends normally

      Set return value normal.

    • If command process ends abnormally

      Set return value abnormal.

  7. Send variable (logout character string). [Command transmission]

  8. Disconnect telnet/ssh connection.

Script B

This script is prepared by Infrastructure administrator and registered under particular network device ruleset.
The example of basic process in script is the same as script A.

Script List(xxx.lst)

This script is prepared by Infrastructure administrator and registered under particular network device ruleset folder.
For network device related to operated L-Platform.
Scripts specified in script list are executed orderly.

Parameter File(Any_Name.prm)

Infrastructure administrator prepares this if necessary.

Command File(Any_Name.cli)

Infrastructure administrator prepares this.
Write process after log in to devices with log in accounts excluding command process included in script.

Basic structure of L-Platform template (operation)

Figure F.3 Basic Structure Example when Using Scripts for L-Platform Templates (Operations)

Note that network device (server load balancer) registered at network pool which tenant administrators or tenant users creating L-Platform can use is selected.

Script A

Infrastructure administrator prepares this.
The basic flow of configuring or operating network devices used by scripts is as follows.

  1. Define variable

  2. Establish telnet/ssh connection with variable (IP address in admin LAN)

  3. Send variable (login account 1)

  4. Send variable (login password 1)

  5. Process command file

    • If command files exist.

      Read command file and send the content of command file by one line. [command transmission]
      Get command execution results and write it to the standard output.

    • If command files don't exist.

      Execute process of sending and receiving commands. [Command transmission]
      Get command execution results and write it to the standard output.

  6. Command process ends.

    • If command process ends normally

      Set return value normal.

    • If command process ends abnormally

      Set return value abnormal.

  7. Send variable (logout character string). [Command transmission]

  8. Disconnect telnet/ssh connection.

Script B

Infrastructure administrator prepares this.
The example of basic process in script is the same as script A.

Script List(xxx.lst)

Infrastructure administrator prepares this.
Script list of ruleset selected at creating L-Platform.
Scripts specified in script list are executed orderly.

Parameter File(default_param.prm)

Infrastructure administrator prepares this.
Information for setting specified parameter value when tenant administrators or users operate L-Platform.

Command File(Any_Name.cli)

Infrastructure administrator prepares this.
Write process after log in to devices with log in accounts excluding command process included in script.


Note that each file is created according to used script.
The example of basic structure is the explanation of the structure corresponding to sample script offered by this product.