Modifying and deleting existing configurations by using REST
The steps that are involved in modifying or deleting an existing configuration on the IBM® MQ Appliance depend on the level of the change that you want to make.
Modify the property-level configuration
To modify an existing property value, you overwrite the existing value with a payload that contains an updated value. To overwrite the value, first retrieve the current property value, see Retrieve an individual object property.
In this example, you want to change the IP address that is assigned to Ethernet interface 4 on
the appliance. First, you retrieve the current value of the IPAddress
property of
the eth4
object that belongs to the EthernetInterface
object
class:
GET https://mqhost.com:5554/mgmt/config/default/EthernetInterface/eth4/IPAddress
{
"_links" : {
"self" : {
"href" : "/mgmt/config/default/EthernetInterface/Eth4/IPAddress"
},
"doc" : {
"href" : "/mgmt/docs/config/EthernetInterface/IPAddress"
}
},
"IPAddress" : "198.51.100.1/24"
}
_links{}
stanza and
change the property value to the new required value. Any properties that reference other
configuration objects on the appliance must also remove the embedded href
link. In
the case of the IPAddress property example, the following listing shows the modified
payload:{"IPAddress" : "203.0.113.10/24"}
PUT https://mqhost.com:5554/mgmt/config/default/EthernetInterface/eth4
{
"_links": {
"self": {
"href": "/mgmt/config/default/EthernetInterface/
eth4/IPAddress"
},
"doc": {
"href": "/mgmt/docs/config/EthernetInterface"
}
},
"IPAddress": "property has been updated."
}
Modify the object-level configuration
To update multiple property values with a single request, an update on the object level is required.
To modify an existing object configuration, overwrite the existing configuration with an updated
payload. To overwrite the configuration, retrieve the current configuration of the object to be
modified. In the following example, the configuration for the host alias object that is named
Thur_server
is retrieved.
GET https://mqhost.com:5554/mgmt/config/default/HostAlias/Thur_server
{
"_links" : {
"self" : {
"href" : "/mgmt/config/default/HostAlias/Thur_server"
},
"doc" : {
"href" : "/mgmt/docs/config/HostAlias"
}
},
"mAdminState" : "enabled",
"UserSummary" : "The thursday server",
"IPAddress" : "198.51.100.30"
}
}
_links{}
stanza and amend property values
as
required:{
"mAdminState" : "enabled",
"UserSummary" : "The Thurleigh server",
"IPAddress" : "198.51.100.99"
}
PUT https://mqhost.com:5554/mgmt/config/default/HostAlias
{
"_links": {
"self": {
"href": "/mgmt/config/default/HostAlias/Thur_server"
},
"doc": {
"href": "/mgmt/docs/config/HostAlias"
},
"Thur_server": "Configuration has been updated."
}
Delete the object-level configuration
DELETE https://mqhost.com:5554/mgmt/config/default/HostAlias/Green_server
{
"_links": {
"self": {
"href": "/mgmt/config/default/HostAlias/Green_server
},
"doc": {
"href": "/mgmt/docs/config/HostAlias"
}
},
"HostAlias": {
"value": "Configuration has been deleted."
}
}