Update Coverage Set
Last updated
Last updated
Before you update a coverage set, you need to lock it. This can be done via the Lock Coverage Set API.
This API is sent as a ‘PATCH’ to update an existing coverage set.
In the body of the call, you need to include the ID of the coverage set (instead of name/version). This can be obtained from the return message on the ‘create’ or ‘get all’ APIs. You can use this to add or delete determining attributes. To add determining attributes, include all of the existing attributes plus the ones you want to add. To delete determining attributes, only include the ones you want to keep and exclude the ones you want to delete.
Adding one or more determining attributes
{
"context": {
"user": "mbj_test",
"password": "xxxx",
"project": {
"name": "imp_payments_demo",
"version": "1.0"
}
},
"entity": {
"id": "6744c4ee59c7b96171b5a827",
"determiningAttributes": [
{"name": "acct_type", "version": "1.0"},
{"name": "has_app", "version": "1.0"},
{"name": "has_online", "version": "1.0"},
{"name": "balance", "version": "1.0"},
{"name": "currency_a", "version": "1.0"},
{"name": "customer_type", "version": "1.0"}
]
}
}
When this is run, the successful return message will show all attributes in the coverage set.
This shows the updated coverage set in TDO. Note that the updated set is now version 1.1 (the original version still exists with 4 attributes) and contains all six attributes sent in the API. TDO increments the version upwards automatically, so the user should not manually update or increment versions.
Deleting One or More Attributes
The delete call remains the same as the add call. Note that you could combine both actions in a single call, by excluding the attributes you want to delete and including the ones you want to add. In this message, we have removed the ‘balance’ attribute from the set. Also note that the coverage set ID has changed. The value used in the update/add call (6744c4ee59c7b96171b5a827) is still the ID for version 1.0 of this coverage set. The value used below is the value for version 1.1, which is the version we are updating.
{
"context": {
"user": "mbj_test",
"password": "xxxx",
"project": {
"name": "imp_payments_demo",
"version": "1.0"
}
},
"entity": {
"id": "6745f4c559c7b96171b5a82a",
"determiningAttributes": [
{"name": "acct_type", "version": "1.0"},
{"name": "has_app", "version": "1.0"},
{"name": "has_online", "version": "1.0"},
{"name": "currency_a", "version": "1.0"},
{"name": "customer_type", "version": "1.0"}
]
}
}
The return message will show the updated contents, as well as the new ID for the new version of the coverage set (1.2).
When viewing version 1.2 in the TDO UI, the ‘balance’ determining attribute is now removed.
All three versions of the coverage set remain in TDO and can be selected and used.