Command Central 10.5 | Using the Command Line Interface | Options for the Commands | input
 
input
Identifies a file that contains the input data for a create, add, update, or exec command.
For example, when using the sagcc create landscape nodes command to add a new installation that you want Command Central to manage, you are required to provide an alias name for the installation and the URL for the installation. You can provide this information on the command line using command line arguments, or you can use the {--input | -i} option to specify this data in an input file. For some commands, the item you are creating, adding, or updating requires more data than is practical to supply on the command line, and as a result, the {--input | -i} option might be required to supply the data for the command.
Syntax
{--input | -i} filename{.xml | .json | .properties}
Arguments
Argument
Description


filename{.xml | .json
| .properties}
Specifies the file that contains the input data. The input file can be:
*An .xml file containing input data in XML format
*A .json file containing input data in JavaScript Object Notation format
*A .properties file containing input data in key/value pairs format.
When identifying the input file, you can specify:
*Absolute directory path and filename.
*Relative directory path and filename. The path is relative from where you initiated the command.
*Filename of a file in the same directory where you initiated the command.
Usage Notes
*The use of an input file for data is helpful when:
*You are scripting commands, for example, using an Ant script.
*You are executing a command with complicated input parameters where it is easier to specify them in a file in XML or json format rather than specifying them on the command line.
*You want to create templates for adding items such as installations, configurations, etc.
*A command always sets the request content type based on the file extension of the input file if the {--input | -i} option is specified. This is true even if you specify another option that affects the request content type, that is, the {--accept | -a} or {--format | -f} option.
The following table lists the request content type that a command uses based on the file extension of the input file:
File extension
Request content type
.xml
application/xml
.json
application/json
.properties
application/x-www-form-urlencoded
*The {--input | -i} option is supported for POST and PUT requests, that is for create, add, exec and update commands. It is not supported for GET and DELETE requests, that is get, list, delete, or remove commands.
*The input file contains data that a command requires for creating an item, for updating an item, or for the execution of an operation. You must supply a file in the format that the command expects, using specific element names and/or tags. For example, when using the sagcc create configuration data command to create an instance of a COMMON-PORTS configuration type, to supply the port number in an XML file, you might include the element <Number>5555</Number> as part of the XML file.
To determine the format to use for an input file, execute a get or list command to retrieve a similar item. On the get or list command, if you use the {--output | -o} option to write the output to a file, you can then update the returned output file and specify it with the {--input | -i} option as an input data file.
For example, if you want to use the sagcc create configuration data command to create a COMMON-PORTS configuration instance, first use the sagcc get configuration data command to retrieve an existing COMMON-PORTS instance to learn the format to use for the input data file.
*If you specify input data both on the command line and use the {--input | -i} option to specify data in an input file, the command uses the data that you specify in the input file and ignores the data you specify on the command line.
Examples
*To use the input file input.xml in the directory c:\templates:
--input c:\templates\input.xml
*To use the input file input.xml in the \templates directory relative to where you initiate the command:
--input templates\input.xml
*To use the input file input.xml that resides in the same directory from where you initiate the command:
--input input.xml