sagcc create inventory components attributes
Adds a new search attribute for a specified run-time component. The command supports only single-valued search attributes. A run-time component can have several search attributes, but each attribute takes a single value, for example:
attribute1=value1
attribute2=value2
attribute3=value3
...
Syntax
Command Central syntax:
sagcc create inventory components attributes node_alias componentid
[attribute=value] [{--input | -i} filename{.xml|.json}]
[options]
Not supported on
Platform Manager.
Arguments and Options
Argument or Option | Description |
node_alias | Required. Specifies the alias name of the installation for which you want to add component information. |
componentid | Required. Specifies the ID of the run-time component for which you want to create a search attribute. |
[attribute=value] | Optional. The name of the new search attribute and its matching value. If the search attribute already exists, the command returns an error. |
[{--input | -i} filename{.xml|.json}] | Optional. Identifies an input file that contains the data for the new search attribute. You retrieve attribute data for the .xml | json file using the sagcc get inventory components attributes command: For more information, see
input. |
[options] | Optional. The command supports all options supported by Command Central. For a description of the options, see
Common Options. |
Usage Notes
After creating a new search attribute for a run-time component, you can include the new attribute as search criteria in a lifecycle or search command to execute an operation against all run-time components that match the new search attribute. For example, the sagcc execute lifecycle start group=AB command starts all run-time components included in the “AB” group.
For information about including search criteria in lifecycle commands, see
Specifying Search Criteria for Lifecycle
Commands. For information about including search criteria in search inventory commands, see
Specifying Search Criteria for Inventory
Commands.
Examples When Executing on Command Central
To create two search attributes, one with name “group” that matches the value “Test” and another with name “tenant” that matches the value “abc.com”, for the run-time component that has the component ID “OSGI-SPM” and is installed on the installation with the alias name “sag01”:
sagcc create inventory components attributes
sag01 OSGI-SPM group=Test tenantId=abc.com --password secret
To create a new search attribute, using the attribute data from the attributes.xml file, for the run-time component that has the component ID “OSGI-CCE” and is installed on the installation with the alias name “sag01”:
sagcc create inventory components attributes
sag01 OSGI-CCE -i c:\inputs\attributes.xml --password secret
To retrieve attribute data for the attribute.xml file use the following command:
sagcc get inventory components attributes sag01 OSGI-CCE -f xml
Because the
{--username | -u} option is not specified, the command uses the default user name. For more information, see
username. The command specifies “secret” for the user’s password.