bdamian
Expert
Expert

Create Property Dictionary using REST Api

Hi all,

Is there any way to create a Property Dictionary (with its Property Attributes) using the REST API? In vRA 6.x or 7.x.

Thanks a lot,

D.

Damián Bacalov vExpert 2017-2018-2019-2020 https://www.linkedin.com/in/damianbacalov/ twitter @bdamian
Tags (2)
0 Kudos
4 Replies
TrotmanRalphCBS
Enthusiast
Enthusiast

bump  ==============

also been trying to find this.  

0 Kudos
sbeaver
Leadership
Leadership

If I am not mistaken there is a workflow that comes with the plugin for creating values in the property dictionary.  I do not have a computer in front of me to tell you the exact name but look in the vcac workflows and I believe you should find it.  Now if this is any help, what I would do is say get all values for what you need and store it in a configuration item and then pull from there to populate the dictionary.

Steve

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
GrantOrchardVMw
Commander
Commander

In 7 you can do it with the API, as Property Groups have now moved to the vRA Appliance. In 6.x it was handled by IaaS, so may be achievable with vRO, but not through direct interaction with the public API.

Grant

Grant http://grantorchard.com
0 Kudos
befreeman
Enthusiast
Enthusiast

I was able to do REST with the new vRA 7 Property Group / Property Definitions.

I started with this: Postman Collection for the vRA7 API -

In vRO, this was pretty easy:

// cafeHost is a vCACCAFE:VCACHost

var restClient = cafeHost.createRestClient("com.vmware.csp.core.properties.service.api");

// get a property group

var propertyGroupId = "myPropertyGroupsId";

var resp = restClient.get("propertygroups/" + propertyGroupId);

var propertyGroupFound = resp.getBodyAsJson();

// create a property group

var propertyGroup = {

  id: "myUniqueId",

  tenantId: cafeHost.tenant,

  label: "my Property Group label,

  description: "my description",

  properties:{}

};

var data = JSON.stringify(propertyGroup);

restClient.post("propertygroups", data);

Hopefully in the next release the vRA plugin will support this a little better though by adding PropertyGroup and PropertyDefinition objects and a wrapper to the properties service.

0 Kudos