ririmia
Enthusiast
Enthusiast

VAMI API - appliance monitoring - HTTP-REST

Hello,

I'm trying to invoke a rest operation towards VAMI API to retrieve some stats.

The URL used is https://{{vc}}:5480/rest/appliance/monitoring/query?item.end_time={item.end_time}&item.start_time={item.start_time}&item.interval={item.interval}&item.function={item.function}&item.names.0={item.names.0}

Attributes variables (string):

item.end_time=2020-01-07T10:09:29.400Z

item.start_time=2020-01-07T09:09:29.400Z

item.interval=MINUTES5

item.function=MAX

item.names.0=storage.util.directory.vcdb_alarms

defaultContentType=application/json

I'm trigger the default "Invoke a REST operation" workflow inside a custom workflow.

Unfortunately, on workflow execution, the Request URL is build in wrong format by encoding the  :  character from "item.end_time" and "item.start_time" variables.

[2020-01-07 15:01:58.273] [I]  acceptHeaders null

[2020-01-07 15:01:58.275] [I] Request: DynamicWrapper (Instance) : [RESTRequest]-[class com.vmware.o11n.plugin.rest.Request] -- VALUE : com.vmware.o11n.plugin.rest.Request@16b83f4c

[2020-01-07 15:01:58.279] [I] Request URL: https://{{vc}}:5480/rest/appliance/monitoring/query?item.end_time=2020-01-07T10%3A09%3A29.400Z&item.start_time=2020-01-07T09%3A09%3A29.400Z&item.interval=MINUTES5&item.function=MAX&item.names.0=storage.util.directory.vcdb_alarms

[2020-01-07 15:01:58.368] [I] Response: DynamicWrapper (Instance) : [RESTResponse]-[class com.vmware.o11n.plugin.rest.Response] -- VALUE : com.vmware.o11n.plugin.rest.Response@b192c19

[2020-01-07 15:01:58.371] [I] Status code: 400

[2020-01-07 15:01:58.377] [I] Content as string: {"messages":[{"id":"vapi.bindings.typeconverter.datetime.deserialize.invalid.format","args":["2020-01-07T09%3A09%3A29.400Z","^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).(\\d{3})Z$"],"default_message":"Datetime string \"2020-01-07T09%3A09%3A29.400Z\" does not match expected pattern \"^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}).(\\d{3})Z$\""}]}

[2020-01-07 15:01:58.379] [I] ****Headers****

[2020-01-07 15:01:58.383] [I] Tue, 07 Jan 2020 13:01:53 GMT

[2020-01-07 15:01:58.423] [I] IE=edge

[2020-01-07 15:01:58.426] [I] Deny

[2020-01-07 15:01:58.429] [I] TwistedWeb/17.1.0

[2020-01-07 15:01:58.433] [I] application/json

[2020-01-07 15:01:58.437] [I] 366

How this can be avoided?

Thank you.

Postman is working as expected with the above URL.

vRO: 7.5.0.10044239

vCenter 6.7.0.40000

0 Kudos
0 Replies