Making a catalog editable
To make any catalog editable, first you need to enable the “Edit” functionality for the specific provider.
This example assumes that the below configuration saved as the
d2op_agent_api.json
file.
{
"configurationkey":"d2ops_agent_api",
"configurationvalue": {
"cmdb": {
"enabled": "true"
},
"importSOI": {
"overwrite": "false"
},
"notification": {
"duration": "20000"
},
"catalog": {
"refresh_interval": "120"
},
"softlayer" :{
"ACCESS_COMPONENT": "",
"SERVICE_COMPONENTS" : "/adapter/sl/v2.0/serviceOfferingComponents",
"OPERATION": "/softlayeradapter/v1/day2ops",
"ACTION_STATUS": "",
"RESOURCE_STATUS": "/softlayeradapter/v1/day2ops/status/{id}",
"TRACKINGINFO_ID": "trackingId, otherKey",
"DELETE_SERVICE":"/v2/api/services/deleteservices",
"ADDITIONALINFO_ID": "",
"EDIT_ENABLED":"true"
}
}
}
Execute the API to enable edit for IBM Cloud provider:
API: https://<gateway_host_and_port>/core/configuration/v1/configvalues
Request Body: logo.jpeg
Method: POST
Headers:
username: <Consume login user>
Apikey: <Apikey generated from Consume>
Content-Type:application/json
curl -v -k -H "Content-Type:application/json" -H "username:
[email protected]" -H "apikey:my_apikey" -X POST -F "@d2op_agent_api.json" https://mytestenv.gravitant.net:8443/core/configuration/v1/configvalues
After the above process is successful, edit your catalogs to include fields that can be modified. Each catalog config definition has an “editable” attribute, which when set to true allows you to edit the resource provisioned in inventory (provided that the backend Terraform provider supports it).
"iops": {
"configName": "Storage Package",
"inputType": "selectOne",
"type": "numeric",
"editable":true,
"hidden": false,
"sequence": 5,
"required": true,
"binding": "iops",
"group": "Volume Specification",
"groupsequence": "2",
"allowedValues": {
"type": "on-view",
"resource-path": "storage/storage-services.getIopsDetails"
},
"description": "Provides the list of Storage Packages available IOPS per GB."
},
If none of the configurations of the catalog have “editable” attribute set to true, the stacks in inventory would have “Edit Service” option disabled for it.