VMware Cloud Community
Jonath38
Contributor
Contributor
Jump to solution

vRA 7.3 - Cannot retriere minimum CPU and maximum CPU from Blueprint in a workflow

Hello guys,

I'm a beginner in vRO and i came on this forum for having some helps :

I'm working on vRA/vRO 7.3 and i cannot retriieve the minimum and maximum CPU in Machine Resources of Blueprints on my vRO workflow.

pastedImage_1.png

I already tried to check all properties for all blueprint class and all catalogItem class but when i retrieve their attributes / properties, i cannot find these informations.

My question : Is it possible to retrieve minimum and maximum CPU in Machine Resources of Blueprints on a workflow ? If yes, do you have any clue to do that ?

Thanks a lot,

jonathan

0 Kudos
1 Solution

Accepted Solutions
eoinbyrne
Expert
Expert
Jump to solution

Had to try it out just to confirm I was correct

pastedImage_0.png

You can see the unique IDs in the highlights here

pastedImage_1.png

Once you have the ID you just do client.get("/blueprints/" + id) and then handle the JSON processing to get the values you want

View solution in original post

0 Kudos
4 Replies
KocPawel
Hot Shot
Hot Shot
Jump to solution

I am not sure, but can see only one option.

You can get information about blueprint is you are creating VM from payload. And then you can ask vRA API for that blueprint and there you should be able to find min and max.

I hope someone confirm or deny my idea because as I said, I am not 100% sure Smiley Happy

What is payload:

https://vmguru.com/2016/03/how-to-transfer-vrealize-automation-payload-to-orchestrator/

0 Kudos
eoinbyrne
Expert
Expert
Jump to solution

Since CompositeBlueprints were introduced you need to access those Min/Max/Default values on the Component within the blueprint. Sadly while the top-level CompositeBlueprint has a handling class the internal component objects do not.

However, you CAN use the vRA REST API to get the details of a Blueprint in a single request by using this API

pastedImage_0.png

This will return JSON which contains the details you want

pastedImage_1.png

You can access a REST client in two ways in vRO

1. Add the vRA node as a HTTP REST Host and go through the Auth process to get a Bearer token (plenty of blogs for this some using PowerShell or curl but the principles are the same)

OR

2. Use the vCACCAFEHost to get a CompositionClient and use that to request the Blueprint by ID

e.g.,

var compClient = cafeHost.getCompositionClient();

var blueprintResponse = compClient.get("/blueprint/" + blueprintId); // returns vCACCAFEServiceResponse

var bpJson = blueprintResponse.getBodyAsJson();

HTH

eoinbyrne
Expert
Expert
Jump to solution

Had to try it out just to confirm I was correct

pastedImage_0.png

You can see the unique IDs in the highlights here

pastedImage_1.png

Once you have the ID you just do client.get("/blueprints/" + id) and then handle the JSON processing to get the values you want

0 Kudos
Jonath38
Contributor
Contributor
Jump to solution

Hello eoinbyrne,

Thanks for these informations, it's works fine.

Here a part of my code to retrieve minimum CPU and maximum CPU of blueprint with JSON parsing (i'll just need to change 'Machine' by a blueprint component name)  :

pastedImage_4.png

I'll take a look on Rest API in the future Smiley Wink

Jonathan

0 Kudos