VMware Cloud Community
pankajchhabra
Enthusiast
Enthusiast

Is it possible to create Network Profiles in VRA 7 using VRO workflows?

Hello,

Is it possible to create Network Profiles in vRA 7 using VRO Workflow?

If not, is there any other mechanism like REST API?

Thanks,
Pankaj

Tags (1)
Reply
0 Kudos
8 Replies
pslavova
VMware Employee
VMware Employee

Hi Pankaj,

Yes it is possible - via the IaaS plugin. I have a package that implements network profile import from resource elements(json content).

If you give me an email I can send you the package - it contains import and export logic.

You can use the export to create the json files and see the expected format.

Regards,

Petya

Reply
0 Kudos
pankajchhabra
Enthusiast
Enthusiast

Hello  Petya,

Great. Appreciate a lot.

Please send the files to chhabra.pankaj@gmail.com.

Thanks,

Regards,

Pankaj

Reply
0 Kudos
Valgi
Contributor
Contributor

i'm trying to accomplish this in a educational environment for my last year internship,

would i be possible to share this great piece of worklfow with me?

regards Thomas

thomas.valgaeren@gmail.com

Reply
0 Kudos
mdegrasse
Contributor
Contributor

Hello Petya,

I would be interested to get the vro package also

mdegrasse@pcdsolutions.com

TIA

Reply
0 Kudos
VMwareHKBillHo
Contributor
Contributor

Can i have the the package too? Thanks. hojohn269@msn.com.

Reply
0 Kudos
rmav01
Enthusiast
Enthusiast

Hey Pankaj,

If you decide to go the REST API trek (which I've done in the past and is straightforward), this may be useful to you:

Working with Network Profile API Use Cases

Credit goes to VMware on the documentation. Just need to create the bearer token up front with the necessary creds and hopefully you'll be good to go.

Reply
0 Kudos
dankrawiec
Contributor
Contributor

Hello All,

Is it possible to get Workflow code or package ?

I see that Petya shared package with all of you.

So if you can please send the package to daniel.krawiec@indevops.com

Thank You in advance.

Kind Regards

Daniel

Reply
0 Kudos
Seekso
Contributor
Contributor

In vRA 7.x you can easily do that using the REST plugin of the CAFE endpoint)

Here is the code I created.

var restClient = vcacCafeTenantAdmin.createRestClient("com.vmware.csp.core.cafe.catalog.api");
var restContent = {"@type":"ExternalNetworkProfile","name":"" + profileName + "","description":"Imported from Infoblox by vRO","isHidden":false,"definedRanges":[{"name":"" + profileName + "-Range01","description":"","beginIPv4Address":"" + beginIPv4Address + "","endIPv4Address":endIPv4Address,"state":"UNALLOCATED"}],"profileType":"EXTERNAL","IPAMEndpointId":null,"subnetMask":netmask,"gatewayAddress":gateway,"primaryDnsAddress":primaryDnsAddress,"secondaryDnsAddress":secondaryDnsAddress,"dnsSuffix":dnsSuffix,"dnsSearchSuffix":dnsSuffix,"primaryWinsAddress":null,"secondaryWinsAddress":null};
var requestResult = restClient.post("../../iaas-proxy-provider/api/network/profiles/", restContent);
var requestStatus = requestResult.getStatus();

if (requestStatus  == "201") {
System.log("  - vRA Network Profile created successfully");
}
else {
System.error("  - Current status is : " + requestStatus );
throw "  - An error occured during network profile creation";
}

Inputs details :

- vcacCafeTenantAdmin (vCACCAFE:VCACHost)

- profileName (string)

- beginIPv4Address (string)

- endIPv4Address (string)

- netmask (string)

- gateway (string)

- primaryDnsAddress (string)

- secondaryDnsAddress (string)

- dnsSuffix (string)

Reply
0 Kudos