In the previous example, we used the default
capability tosca.capabilities.Endpoint.Database
, which has the some default properties: port
, protocol
as in
Figure 2:
Figure 1: Default properties of an endpoint capability
To add more properties to a capability, or to set a default value to a capability, we define a custom one as follows:
capability_types:
# define a custom capability
tosca.capabilities.Endpoint.Database.Mongo:
derived_from: tosca.capabilities.Endpoint.Database
properties:
port:
type: integer
default: 27017
Here, the custom capability tosca.capabilities.Endpoint.Database.Mongo
inherits all properties from the parent
type tosca.capabilities.Endpoint.Database
and set the port
property to the default value 27017.