Exporting and importing views
With this feature, you can complete the following use cases:
- Create a copy of a view: Export an out-of-the-box view, import it with a new name, modify its configuration, and save it as a new view.
- Migrate a view: Create a custom view in the development or test environment and after confirming that the results are accurate, import it in the production environment.
- Share a view: Import a custom view that is created in one environment into a different destination environment.
You can export and import views by using the BMC Helix Continuous Optimization console or the APIs. For details, see the following sections:
To export and import views by using the BMC Helix Continuous Optimization console
Perform the following steps to export or import a view by using the BMC Helix Continuous Optimization console.
To export a view
- In the navigation pane of Views tab, select Manage Views. By default, the Views tab is displayed.
- From the action menu
The view is exported and you can select the location to save the exported view. The view is exported as the <View_Name>_<timestamp>.viewpkg file. that is located next to the view you want to export, click Export view.
To import a view
- If you are importing an out-of-the-box view, first install the view.
- In the navigation pane of Views tab, select Manage Views.
- Click Import view. The Import view dialog box is displayed.
- Click Browse to select the view package file (.viewpkg) that you want to import.
- Click Apply.
A message indicating the data mart creation or update is displayed. You can choose to Proceed or Cancel the import. If the destination environment already contains the view with the same name, a backup of the existing view is created.
The view is imported and listed in the Views table.
To export and import views by using the APIs
You can call the following endpoints of the Data Provider API to export and import views. For more information about accessing the API endpoints, see Continuous-Optimization-REST-API-endpoints.
API | Use to |
---|---|
GET/opt/api/v1/viewdefinition/view | Retrieve a list of all capacity views in BMC Helix Continuous Optimization. |
GET/opt/api/v1/viewdefinition/view/{viewid}/export | Export the configuration of the selected view to a package file (.viewpkg). |
POST/opt/api/v1/viewdefinition/view/import | Import a capacity view from another environment. The request includes the name of the export file in the format: <view name_date of export>.viewpkg. |
Data mart considerations
When you export and import the custom view, if the view is using a data mart, that data mart is also exported and then imported. If this data mart is using any data marts or being used in other data marts, all these data marts, that is, the entire hierarchy tree gets exported and and then imported in the destination environment.
If your destination environment does not contain data marts that are being exported as part of the view package, they will be created. If the destination environment already contains the same data marts, they will be updated. If your destination environment includes any data marts with the same identifier as one of the data marts being imported, the existing data marts are updated by the imported data marts.