XML Schema Mismatch- TimeOffsetUtc

RESTful knowledge exchange

XML Schema Mismatch- TimeOffsetUtc

Veeam Logoby twesterd » Sun May 21, 2017 6:16 pm

When I look at the example documentation: https://helpcenter.veeam.com/docs/backup/rest/jobs_id.html?ver=95

There is a mismatch between the example and the actual XML I get via the API. The example uses a <Time> element within the actual XML returned is a <TimeOffsetUtc> element (see below).

Within the example documentation... this is what I expect returned:

Code: Select all
   <OptionsDaily Enabled="true">
     <Kind>Everyday</Kind>
     <Days>Sunday</Days>
     <Days>Monday</Days>
     <Days>Tuesday</Days>
     <Days>Wednesday</Days>
     <Days>Thursday</Days>
     <Days>Friday</Days>
     <Days>Saturday</Days>
     <Time>22:00:00.0000000-07:00</Time>
   </OptionsDaily>


In the actual XML returned via my API, this is what I receive:

Code: Select all
      <OptionsDaily Enabled="true">
      <Kind>Everyday</Kind>
      <Days>Sunday</Days>
      <Days>Monday</Days>
      <Days>Tuesday</Days>
      <Days>Wednesday</Days>
      <Days>Thursday</Days>
      <Days>Friday</Days>
      <Days>Saturday</Days>
      <TimeOffsetUtc>65700</TimeOffsetUtc>
    </OptionsDaily>


Why am I getting the element "TimeOffsetUtc" rather than "Time"? One is easy to change and populate (Time) and the other (TimeOffsetUtc) requires conversion from some unknown base point in time and knowledge of what each integer value represents (ticks, seconds, minutes, etc.).

I need to change the time jobs start via the API and this is really confusing. I want the Time element as the documentation shows, not the TimeOffsetUtc (royal pain). Is there a way to get the correct element (Time) returned in the XML and/or how to I convert values (need to know base point in time and what each integer value represents)?
twesterd
Influencer
 
Posts: 17
Liked: never
Joined: Wed May 17, 2017 7:38 pm
Full Name: Trevor W

Re: XML Schema Mismatch- TimeOffsetUtc

Veeam Logoby twesterd » Sun May 21, 2017 6:54 pm

Okay I debugged the actual .NET object (JobEntityType) autogenerated via the supplied XSD and discovered both elements are there with flags for whether they are used or not. Apparently, TimeOffsetUtc is enabled/used by default. Time is disabled by default; thus, its not returned in the XML.

TimeOffsetUTc's base point in time is 12:00:00 AM and the integer values are seconds. So if someone wants the job to start at 6:00 PM, that would be 18 hours after 12:00:00 AM, or 18 * 60 * 60 = 64,800 seconds.

To use Time vs TimeOffsetUtc turn the Time flag on (job.JobScheduleOptions.OptionsDaily.TimeSpecified = true), turn TimeOffsetUtc off (job.JobScheduleOptions.OptionsDaily.TimeOffsetUtcSpecified = false) and set its value accordingly.

To use TimeOffsetUtc just know its time is based in seconds after 12:00:00 AM (not nearly as bad as I originally thought).
twesterd
Influencer
 
Posts: 17
Liked: never
Joined: Wed May 17, 2017 7:38 pm
Full Name: Trevor W

Re: XML Schema Mismatch- TimeOffsetUtc

Veeam Logoby twesterd » Mon May 22, 2017 4:34 am

Okay, this is the behavior I notice:

1) I always get the time in UTC format and its always marked true.
2) If I try to post in UTC format, nothing happens, its ignored
3) If I change to the Time format, and set UTC to false, I can post the new time and it works... BUT back to point #1, the next time I get the time, its back in UTC

Just the way it goes I guess... a bit weird
twesterd
Influencer
 
Posts: 17
Liked: never
Joined: Wed May 17, 2017 7:38 pm
Full Name: Trevor W


Return to RESTful API



Who is online

Users browsing this forum: No registered users and 1 guest