Cisco Cisco Process Orchestrator 3.0 Guia Do Utilizador

Página de 242
 
6-4
Cisco Process Orchestrator User Guide
OL-30196-01
Chapter 6      Authoring Target Types
  Defining Inheritance
Defining Inheritance
The idea of inheritance is that a type can contain all aspects of another type but can be extended to 
provide a more specialized type; that is, inheritance formalizes the relationship. For example, a cat is a 
specialized type of a mammal, and a mammal is a specialized type of an animal. A cat “is a” mammal, 
and hence “is an” animal. If a mammal generically can do something like wake up, the cat can also do 
it, but the cat can do additional things, such as meow and purr. If you define a property of a mammal, 
like its weight or body temperature, the cat would also have that attribute, but you could add additional 
properties like the breed, being Siamese, tabby, and so on.
This concept is very useful in real world modeling of types of IT services and can greatly simplify 
implementations. The concept can allow common aspects of a collection of types to be done once in a 
shared type, then inherited, rather than repeating the common implementation in each type in the 
collection. The mechanism avoids duplicating properties and processes, and therefore makes it easier to 
maintain the automation. 
Conversely, it is often simpler to implement something new by taking something that already exists in 
automation and extending it for the new specialization. This allows you to focus implementation on only 
what is new and unique, rather than all of the aspects that are common with the existing automation.
Note
If a type has a “has a” relationship rather than an “is a” relationship, use Target Relationships (see 
), not inheritance.
 
 
Inheritance and target relationships are mutually exclusive concepts; inheritance creates a subtype from 
a type, while relationships model the connection or association between one target and another target. 
Related Topics
  •
To define inheritance, see 
  •
To use inheritance, see 
Defining Target Properties
Target properties allow the storage of information for targets created from a target type. For example, a 
target property could store network device discovery information such as operating system, version, 
various optional cards or modules installed in a device, serial numbers, or even configuration. Network 
automation can then use this information in its workflows. Target properties can be used in target groups 
that specify collections of targets matched by some criteria.
Target Properties can include a default value. This can be important in allowing a general setting that is 
only overridden on specific targets. For example, you might define a global threshold, then allow 
customization for a specific target instance where needed.
The list of properties on a type inherits from ancestor types, but the type can insert additional properties. 
You can package target property definitions from the type as well as target instance property values in 
automation packs to transfer them between environments. The author has full control of the evolution of 
their properties within types, including support for upgrade and other lifecycle management.