Creating an attribute

The attributes of an object, also known as its properties, enable you to track a variety of information. You can create attributes and set properties for the attributes, such as typeand value.

About this task

attr|attribute -c|-create attr_name -p|-project [-f|-force]
               -t|-type attr_type [-v|-value attr_value] project_spec...
attr|attribute -c|-create attr_name -t|-type attr_type
               [-v|-value attr_value] [-f|-force] object_spec...
-c|-create attr_name
Creates an attribute.
-f|-force
Checks whether the attribute to be created exists and has the same type, and then causes one of these to occur:
  • If the attribute to be created exists and has the same type, the attribute value is changed (if you use the -value option).
  • If the attribute does not exist, the new attribute is created.
  • If an attribute with the same name exists, but has a different type, the operation fails.

    The difference between ccm attr -c attr_name -t type and ccm attr -c attr_name -f -t type is that the command without the -force option fails if the attribute already exists.

-p|-project
Specifies the project whose attribute will be created.
-t|-type attr_type
Specifies the type of the attribute. Use this option only when you create attributes. Valid built-in values include:
  • string (used for single-line ascii attributes)
  • boolean
  • text (used for multi-line ascii attributes)
-v|-value attr_value
Specifies the value of the attribute.

Example


Feedback