Forum Discussion
Is "Last Sync Time" exposed to the API?
I'm building a .Net website that allows users to make updates to data on the F5. When I get the data initially, I would like to store the last sync time locally, then check that against the server's last sync time right before making an update to make sure nobody else updated the data at the same time.
I've figured out how to use the API to get the failover state, but I can't find Last Sync Time. I was able to log into the F5 UI and I can see a column called "Last Sync Type" so I know the data exists.
5 Replies
- rob_carr
Cirrocumulus
You haven't said which API you are using, but I can verify that the REST API has a call which returns a time in seconds that you could use to check if changes have been made.
- KimL_175448
Nimbostratus
Thanks! I am using iControl but can use rest too.
- rob_carr
Cirrocumulus
I should note that my testing was done on 11.6.0, so your REST API mileage may vary.
- KimL_175448
Nimbostratus
I'm on 11.5 I believe. I just found a post from another girl named Kim asking the same question which helped me get this working with the iControl API: https://devcentral.f5.com/questions/getting-the-last-ltm-configuration-change-time.
I'm not sure how to convert the time format so I can't verify that it matches the Last Sync Time date when I log into the F5 directly. However, the result is the same one that I get when using the Rest call. Does the return value of 1415782964 correspond to the Last Sync Time of 11/10/2014 15:22:53?
Here is the code I have now:
m_interfaces.initialize(deviceName, 443, userName, password); dg.LastSyncTime = m_interfaces.ManagementDBVariable.query(new string[] { "Configsync.LocalConfigTime" })[0].value;- rob_carr
Cirrocumulus
The local config time is given in seconds since 1/1/1970. A random conversion site on the web indicates that 1415782964 corresponds to 'Wed, 12 Nov 2014 09:02:44 GMT', so there is some difference there.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com