Bulk migrate to Artifact Property Registry
The MyST REST APIs can be used to bulk load artifact property values for multiple environments based on existing property data. This can be useful for a case where properties and their values are pre-existing in other files or for a customer on an earlier version of MyST wanting to move properties outside of Application Models and into the Artifact Property Registry and Platform Instances.
The property keys will be registered by the MyST plugin at the final stage of automated build. MyST will automatically introspect the properties before pushing them to MyST Studio. This is necessary so that MyST can establish the relationship between the artifacts and the properties they require.
There is a way to map existing data to platform instances in MyST. In order to support this, we will need a mapping between our platform instance and our configuration file(s) which contain the property values for that given instance.
The typical flow is as follows:
Invoke the REST API for querying a list of platform models
Assuming one file per model, iterate over all the existing configuration files (containing property keys and values)
Find out the platform model record from the list fetched based on the name of the model (or whatever other convention has been used)
Determine the ID of the platform instance corresponding to the model
Invoke the REST API for registering the artifact property values against the platform instance. The properties and values should be available as part of the data in the configuration file
Optionally, invoke the REST API to commit the property values. This will trigger the execution of those active release pipelines whose artifacts get impacted by these property values
If the commit API is not invoked, the properties would be saved in draft state only and not trigger any release pipeline executions. This gives the user a verification window where he / she can login to MyST and verify the saved artifact property values before committing them
One can verify if the values got saved correctly by querying the artifact property values for the instance using the REST API for the same
In case we want to set the default values or descriptions for properties registered in the Artifact Property Registry, the REST API for the same can be used as documented below.
Migrating from Application Models
The erstwhile approach of defining individual application models has now been removed and the new Stream Model approach (which just feeds off the artifact property values stored against platform instances) has taken its place.
If you have defined properties and values inside application models, a REST API has been provided to get a CSV dump of the existing models along with their property keys and values so that they can be migrated to the new Stream Model approach.
This dump can then be used as a similar starting point as documented above to load the properties and values in bulk against the platform instance.
REST APIs
Querying the list of platform models
GET /api/v1/platform/models?dataFilters=instance
Response Payload
This gives the list of models along with corresponding platform instances. The important parts of this data are the 'name' and 'currentInstance.id'.
Saving the artifact property values for a platform instance
PATCH /api/v1/platform/instances/{instance-id}/data-bag
Request Payload
Committing the artifact property values for a platform instance
POST /api/v1/platform/instances/{instance-id}/data-bag/commit
Request Payload should be empty, i.e, {}
Retrieving the current saved artifact property values for a platform instance (may or may not be committed)
GET /api/v1/platform/instances/{instance-id}/data-bag?filterBy=DRAFT
Response Payload
Retrieving the latest committed artifact property values for a platform instance
GET /api/v1/platform/instances/{instance-id}/data-bag?filterBy=LAST_COMMITTED
Response Payload
Updating default values and descriptions for properties in the property registry
PATCH /api/v1/metadata/property-registries/f87554da-cb8b-4b2d-b32a-0c12c84b2c81
Request Payload
Retrieving a CSV dump of Application Models
GET /api/v1/release-management/release-pipelines/app-model-csv
Response Payload
Last updated