Property Groups
Overview¶
Property groups are defined in VCF Automation as sets of properties that always appear together and allow you to add these properties to different VCF Automation designs and save the time of adding the same multiple properties one by one. In addition, you have a single place to maintain or modify the set of properties, which ensures their consistent application.
In VCF Automation, there are two types of property groups.
- Input property groups gather and apply a consistent set of properties at user request time.
- Constant property groups silently apply known properties and in effect are invisible metadata.
Project Structure¶
Build Tools for VMware Aria stores each property group object in a single JSON file under the src/main/resources/property-groups directory in the project content on the local filesystem. The JSON file contains the full property group definition.
Following is a sample listing of the local filesystem for a property group with the name Custom VM Properties.
src/
└── main/
└── resources/
└── property-groups/
└── Custom VM Properties.json
Sample Project File Content¶
Following is a sample listing of the content of a property group definition of type Input (as defined in the project archetype) that is stored in the src/main/resources/property-groups/<property group name>.json1 file in the project content on the local filesystem.
src/main/resources/property-groups/Custom VM Properties.json
{
"name" : "custom_vm_properties",
"displayName" : "Custom VM Properties",
"description" : "Sample Property Group",
"type" : "INPUT",
"properties" : {
"cpu_count" : {
"type" : "integer",
"encrypted" : false,
"minimum" : 1,
"maximum" : 8,
"title" : "CPU Count"
},
"notification_email" : {
"type" : "string",
"encrypted" : false,
"title" : "Notification Email"
}
}
}
Export¶
To export the definition of a property group from the VCF Automation server (pull the content), you need to add the property group name as a list item of the property-group element in the content.yaml content descriptor file for the project.
Tip
Alternatively, if you want to export all property group objects from the project on the VCF Automation server, you can configure the property-group element with no value (i.e. its value is null). For details, see the Content Filtering section.
Following is a sample listing of the content.yaml file for a project that exports only the Custom VM Properties property group from the project on the VCF Automation server.
property-group:
- Custom VM Properties
# ...
Import¶
When you import a property group to a project on a VCF Automation server (push operation), Build Tools for VMware Aria matches the property group object by its name (the name of the JSON definition file under src/main/resources/property-groups in the project content on your local filesystem) and performs one of the following operations.
Warning
Note that for push operations for VCF Automation projects for All Apps organizations, Build Tools for VMware Aria uses the content filtering rules that you define in the content.yaml content descriptor file. For details, see the Content Filtering section.
- If a property group with the same name does not exist on the server, Build Tools for VMware Aria creates a new property group with the details from the local project files.
- If a property group with the same name already exists on the server, Build Tools for VMware Aria checks if there are any differences between the local copy and the server copy and performs one of the following operations.
- If there are no differences between the local copy and the server copy, BTVA skips the operation and does not update the property group on the server.
-
If there are differences between the local copy and the server copy, BTVA updates the existing property group object on the server with the definition from the local project (if possible).
Warning
Note that VCF Automation does not allow you to update the scope of a property group. As a result, if a property group already exists on the VCF Automation server and you try to import a property group definition from your local project that has the same name as the existing property group but a different scope, the import operation will fail.
-
The
<property group name>placeholder stands for the name of the property group. ↩