Change Publication Subscription Mode REST API
Use the Data Integration Hub Change Publication Subscription Mode REST API to change the mode of a publication or a subscription, that is, to enable a disabled publication or subscription or to disable an enabled publication or subscription.
To change the mode of a publication, use the following REST URL:
http://<DIH_console_host_port>/dih-console/api/v1/publication/changemode
For example:
http://localhost:18080/dih-console/api/v1/publication/changemode
To change the mode of a subscription, use the following REST URL:
http://<DIH_console_host_port>/dih-console/api/v1/subscription/changemode
For example:
http://localhost:18080/dih-console/api/v1/subscription/changemode
- Request syntax for changing the mode of a publication
- To change the mode of a publication, use the following request syntax:
{
"publicationName": "<publicationName>",
"mode": "<enable/disable>"
}
For example:
{
"publicationName": "daily_sales",
"mode": "enable"
}
- Request syntax for changing the mode of a subscription
- To change the mode of a subscription, use the following request syntax:
{
"subscriptionName": "<subscriptionName>",
"mode": "<enable/paused/disable>"
}
For example:
{
"subscriptionName": "daily_reports",
"mode": "disable"
}
Sample File
The <DIH_InstallationDir>\samples\rest_api_samples folder contains a sample client application and a readme file that describes the application.
Change Publication Subscription Mode REST API Action Response
When you use the Data Integration Hub REST API to change the mode of a publication or of a subscription, Data Integration Hub returns the response code of the action that you perform in the REST API response.
Changing the mode of a publication or a subscription from the REST API returns one of the following response codes:
- •When Data Integration Hub changes the mode of the publication or the subscription successfully, the API returns a SUCCESS response.
- •When Data Integration Hub fails to change the mode of the publication or the subscription, the response provides the reason for the failure. For example, when you do not have sufficient privileges to perform the operation.