- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
API Call to do save new dbsnapshot?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2021 09:00 AM
Is there an example API call to kick off a dbsnapshot? I want to schedule hourly DB snapshots, if possible. The entire gridmaster backup hourly was causing issues with API calls. Im hoping the dbsnapshot will be a bit lighter and faster and will not cause interruption.
Solved! Go to Solution.
Re: API Call to do save new dbsnapshot?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2021 04:05 AM
Hi,
You can a snapshot using the following WAPI:
curl -k -u username:password --location --request POST 'https://grid-masterwapi/v2.10/dbsnapshot?_function=save_db_snapshot' --header 'Content-Type: application/json' \ --data-raw '{ "comment" : "Testing WAPI" }'
Hope you find this helpful,
Krishna Vasudevan
Re: API Call to do save new dbsnapshot?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2021 07:05 AM
Thanks for the example but its returning a 404.
</head>
<body>
<div id="errorpage">
<div id="errorheader"><img src="./errorPage/ib_logo.png" alt="infoblox" /></div>
<div id="errortype">
<div id="errortitle"><h2><label>Page Not Found</label></h2></div>
</div>
<div class="ib-error-message">
<h3><br><br><label>Please enter a valid URL and try again. Contact Infoblox Technical Support if the problem persists.</label></h3>
</div>
</div>
</body>
</html>
Re: API Call to do save new dbsnapshot?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2021 07:36 AM
Hi,
Could you please share the WAPI you are issuing?
Regards,
Krishna
Re: API Call to do save new dbsnapshot?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2021 08:08 AM
Using Postman:
Re: API Call to do save new dbsnapshot?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2021 08:09 AM
I am unable to see the image. Could you please try adding it as an attachment?
Re: API Call to do save new dbsnapshot?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2021 08:10 AM
It does not appear my screen shot is loading..... =/
using Postman:
POST https://<labgridmaster>/v2.7.3/dbsnapshot?_function=save_db_snapshot
settings Headers in the Header section.
getting the 'Page Not Found' 404 status error page from the Gridmaster.
Re: API Call to do save new dbsnapshot?
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2021 08:12 AM - edited 04-09-2021 08:13 AM
Hi,
Could you please change the URL to
https://<labgridmaster>/wapi/v2.7.3/dbsnapshot?_function=save_db_snapshot
Re: API Call to do save new dbsnapshot?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2021 08:21 AM
That worked, but needed to make slight change to the params...
POST https://<labgirdmaster>/wapi/v2.7.3/dbsnapshot?_function=save_db_snapshot&comment="test wapi"
it returns a "_ref" as expected.
Re: API Call to do save new dbsnapshot?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2021 10:58 AM
Here is what it looks like in Python. Pretty simple.
#!/usr/bin/env python3
import http.client
import time
dt = time.strftime("%Y-%m-%d_%H.%M.%S")
fn = 'HourlySnapshot-{}'.format(dt)
conn = http.client.HTTPSConnection("<FQDN>")
payload = ''
headers = {
'Authorization': 'Basic <TOKEN>',
}
baseurl="/wapi/v2.7.3/dbsnapshot?_function=save_db_snapshot&comment="+fn
conn.request("POST", baseurl, payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))