VMware Cloud Community
tchristin
Enthusiast
Enthusiast

vRA 8.1 - How to use project custom properties in custom form with vRO external action ?

Hi all,

I'm new to vRA 8.1, and I'm pretty happy of lots of things improved !

But while trying to reproduce my Blueprint and its Custom Form from vRA 7.5 to vRA 8.1, I'm struggling with something that was not difficult previously.

I need to fill a dropdown list with a REST API call from an external vRO action.

The REST Host was successfully added in vRO (this is one of the inputs for this action and it's working fine).

I need two others inputs to filter the content of the list that I'll display on form:

- environment of blueprint (easy as I added it in the inputs section of the Blueprint, I just select it in Fields)

- the group that is granted to acces only some items in the original list and here is my problem...

This group should be different for each project as projects replace Business Groups.

So I set a custom property in my project with one of the possible values, but I'm struggling retrieving this property in the custom form designer or inside my vRO external action.

In vRA 7.5, I was passing the Business Group name to my vRO external action and then used the action System.getModule("com.vmware.library.vcaccafe.subtenant").getCustomPropertyNames(subtenant) to retrieve all properties of the BG and then retrieve my property value.

But now it's just becoming a nightmare on the vRO side...

  • No vRA plugin...
  • No action containing the word 'project'
  • API explorer not organized to list vRA capabilities

I found this action that I could use: com.vmware.library.customProperties.getCustomProperty but its input is object type and I don't see any trace of method somewhere to get my project in the API so how can achieve that ????!!

I was curious enough to find something in API and did a test using Server.getObjectsWithCustomPropertyKey(myCustomProperty) and it return an empty object :smileyangry:

Please help me I'm getting very confused :smileyconfused:

Cheers,

Tim

9 Replies
MichalCz
Contributor
Contributor

Hello,

I'm also looking for an answer

Reply
0 Kudos
siglert
Enthusiast
Enthusiast

All custom properties that are assigned to the project and or blueprint are passed into VRO through a value (INPUTPROPERTIES)  All you should have to do is parse inputProperties and find custom properties with your property in it.

Reply
0 Kudos
MikeNox
Enthusiast
Enthusiast

Add inputProperties (type:properties) as an input to the workflow.

If you add this line to the first step of the workflow, you get a nicely formatted view of what you have to work with.

System.log(JSON.stringify(inputProperties, null, 2))

Reply
0 Kudos
tchristin
Enthusiast
Enthusiast

Hi,

Thanks for your help.

But I'm not talking about a workflow, but an external action that is called directly inside a custom form where we need to do a mapping of all inputs fo the external action.

Apparently the development team as decided to expose project properties after submitting the request form so I may need a fix from them.

I'll keep this topic updated when I have more information.

Cheers,

Tim.

Reply
0 Kudos
daninapach
Contributor
Contributor

Any news about this issue?
Reply
0 Kudos
craigso
Enthusiast
Enthusiast

I also have a need to access these properties via an action.

Reply
0 Kudos
emacintosh
Hot Shot
Hot Shot

Certainly not ideal, but would it be possible to put those properties in a config element in vRO as well?  I think vRA could send the Project ID to vRO, so if you had a config element for each project id and attributes for each property, then the action could use those?

I understand that's probably a lot of manual and prone to plenty of errors/fat-fingering/etc, but could maybe be something to allow you to move forward while the engineers actually fix the API?

Reply
0 Kudos
craigso
Enthusiast
Enthusiast

This worked great for me! Thanks.

Reply
0 Kudos