VMware Cloud Community
evilending
Contributor
Contributor

Create Rule with valueType "Substring" via API

Hi everyone

I'm trying to create a Rule via the API. According to the documentation, the body needs to be provided as follows:

<rule xmlns="http://www.vmware.com/UM">

<vcServerId>1</vcServerId>

<customerName>CustomerTest</customerName>

<objectType>VM</objectType>

<valueType>Unique ID</valueType>

<value>vm-21</value>

</rule>

This works fine for rules with valuetype "Unique ID". But i need to create a rule with the valuetype Substring and I cannot figure out, how I need to provide the body. If I send it according to the documentation i get the response that rules with valueType Substring mustn't provide a vCenter ID. If I send the body without the vcServerID Element i get the response that this is a mandatory element. If I leave it blank I get a parsing error back. Can anyone point me in the right direction? We use version 3.6.1.

Thanks!

Reply
0 Kudos
1 Reply
vinayag
VMware Employee
VMware Employee

Hi,

As per the API Documentation, Customer name & vCenter Server ID are required for Creating Rules through API.

“Sub-String” option is mapped with the objectType “Folder” and not with vcServerID.

Hence “Sub-String” option may not be supported through API.

Thanks, Vinayaga.
Reply
0 Kudos