VMware Cloud Community
mastefani
Enthusiast
Enthusiast
Jump to solution

REST Deployments and filtering by expiration

Has anyone found a way to get the Deployments REST call to correctly filter by expiration?  The Swagger page mentions an expiresAt query of type string to filter by expiration, but the only info is "Comma-separated start and end dates for the interval".  I've tried a lot of different date formats but can't seem to get that to work.  Has anyone successfully done that or found an example of the format?  Thanks,

 

/deployment/api/deployments

Reply
0 Kudos
1 Solution

Accepted Solutions
emacintosh
Hot Shot
Hot Shot
Jump to solution

I think we went down this path at some point and found that we needed to literally use %5B and %5D around the dates.  I think we came across that when filtering "manually" in vRA because it was in the URL, if I remember correctly.  Maybe something like this?

/deployment/api/deployments?expiresAt=%5B2021-07-22T00:00:00.000Z,2021-11-22T00:00:00.000Z%5D

 

View solution in original post

3 Replies
mastefani
Enthusiast
Enthusiast
Jump to solution

BTW - VRA 8.4

Tags (1)
Reply
0 Kudos
emacintosh
Hot Shot
Hot Shot
Jump to solution

I think we went down this path at some point and found that we needed to literally use %5B and %5D around the dates.  I think we came across that when filtering "manually" in vRA because it was in the URL, if I remember correctly.  Maybe something like this?

/deployment/api/deployments?expiresAt=%5B2021-07-22T00:00:00.000Z,2021-11-22T00:00:00.000Z%5D

 

mastefani
Enthusiast
Enthusiast
Jump to solution

Thanks!  That's what I was missing.