Restoring Archived Data using API
Restoring is the process of copying backed up data from an archive and restoring it in the database to replace lost or damaged data. You can restore the archived data in the webMethods API Gateway database as required.
You can use the REST API, apitransactions/archives to restore archived data.
curl -XGET
"http://apigw_host:agigw_port/rest/apigateway/apitransactions/archives"
-H 'accept:application/json' -H "Accept: application/json" -u username:password
In this REST API, replace apigw_host and agigw_port with the hostname and port number of your webMethods API Gateway instance.
{"archiveFiles":["default-2021-10-13-1634096748481","default-2021-10-13-1634096810028",
"default-2021-10-13-1634096871380","default-2021-10-13-1634096933197",
"default-2021-10-13-1634097054614","default-2021-10-13-1634097248461"]}
curl -XPOST
"http://apigw_host:agigw_port/rest/apigateway/apitransactions/archives/filename"
-H "accept:application/json" -u username:password
Sample command curl -XPOST
"http://apigw_host:agigw_port/rest/apigateway/apitransactions/archives/default-2017-02-09-1486644396751"
-H "accept:application/json" -u Administrator:manage
Sample response {
"jobId": "6d1f65f0-3ec2-4545-bd29-971be1471099"
}
Monitor restore status
curl -X GET -H "content-type:application/json" -H "Accept:application/json"
"http://apigw_host:agigw_port/rest/apigateway/apitransactions/jobs/job_id"
In this REST API, replace apigw_host and agigw_port with the hostname and port number of your webMethods API Gateway instance.
{
"status": "Completed",
"action": "restore",
"jobId": "6d1f65f0-3ec2-4545-bd29-971be1471099",
"creationDate": "2024-06-03 19:31:55 GMT",
"Filename": "default-2024-06-03-1717440636921"
}
If the restore job fails, the status field in the above output displays
Failed
. You can look into server logs located at
/opt/softwareag/IntegrationServer/logs/server.log and analyze the
failure reasons.