Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2017-06-16 01:47 PM
[5.5 SP2 HF1]
In the Get All Security Parameters REST call, and presumably the Get Security Parameter by Id REST call, one of the returned properties is DisallowedSessionDays with a value I've seen between 1 and 95 (maybe higher). Within the front-end the dates are human readable, and I'd like to translate the 1 - 95 value returned back to something human readable. I've tried various combinations, but can't seem to get the logic behind how it comes up with the numeric value returned in the JSON. Can someone assist?
2017-06-16 03:20 PM
Sam,
From the RSA Archer 6.2 Platform Patch 1 REST API Reference:
Each day has a value assigned to it, starting with 1 for Sunday, that is then doubled for each following day. The number being returned is the SUM of the selected days. In your case, you must have Su/M/T/W/R/Sa selected, which adds up to 95.
You can work out which days are selected, by working backwards with subtraction, as the selection of all days prior will never add up to more than or equal to any given day's value. Let's work the 95 example you have.
95 is >= 64 for Saturday, so I know Saturday is selected and I subtract 64 leaving me with 31.
31 is not >= 32 for Friday, so I know Friday is not selected and do no subtraction.
31 is >= 16 for Thursday, so I know Thursday is selected and subtract 16 leaving me with 15.
15 is >= 8 for Wednesday, so I know Wednesday is selected and subtract 8 leaving me with 7.
7 is >= 4 for Tuesday, so I know Tuesday is selected and subtract 4 leaving me with 3.
3 is >= 2 for Monday, so I know Monday is selected and subtract 2 leaving me with 1.
1 is >= 1 for Sunday, so I know Sunday is selected.
My final list is then Su/M/T/W/R/Sa as the field identifies.
2017-06-16 03:20 PM
Sam,
From the RSA Archer 6.2 Platform Patch 1 REST API Reference:
Each day has a value assigned to it, starting with 1 for Sunday, that is then doubled for each following day. The number being returned is the SUM of the selected days. In your case, you must have Su/M/T/W/R/Sa selected, which adds up to 95.
You can work out which days are selected, by working backwards with subtraction, as the selection of all days prior will never add up to more than or equal to any given day's value. Let's work the 95 example you have.
95 is >= 64 for Saturday, so I know Saturday is selected and I subtract 64 leaving me with 31.
31 is not >= 32 for Friday, so I know Friday is not selected and do no subtraction.
31 is >= 16 for Thursday, so I know Thursday is selected and subtract 16 leaving me with 15.
15 is >= 8 for Wednesday, so I know Wednesday is selected and subtract 8 leaving me with 7.
7 is >= 4 for Tuesday, so I know Tuesday is selected and subtract 4 leaving me with 3.
3 is >= 2 for Monday, so I know Monday is selected and subtract 2 leaving me with 1.
1 is >= 1 for Sunday, so I know Sunday is selected.
My final list is then Su/M/T/W/R/Sa as the field identifies.
2017-06-16 03:35 PM
You're welcome. Happy Archering!