Enthusiast
Enthusiast

Content Library Automation Push and Pull

I currently have a packer process that builds a Windows template in vCenter and converts it to a template. Is there a way to copy that template to content library using powercli or API calls?

0 Kudos
5 Replies
Leadership
Leadership

You could try to upload the files via the REST API (see POST /com/vmware/content/library/item/updatesession/file/id:{update_session_id}?~action=add)

But I'm not sure if that would work for a Template.

Worst case, you can try to convert the template to an OVA, and then upload the file

You might also want to have a look at the New-VMTX function in William's ContentLibrary module (but be aware, it's for VMC only).

And there is also an idea "Ability to upload files into Library items​" that is planned, but no target date is mentioned (yet).


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Enthusiast
Enthusiast

Yeah, I read William's blog about the New-VMTX function but it is only for VMC. Ill keep an eye on the potential PowerCLI feature and look into the API functions. Thanks!

0 Kudos
VMware Employee
VMware Employee

Hi ,

I have developed sample powercli script using REST API's which could upload templates/files in to content library from URL location (PULL)

It can be downloaded from vmware code samples ,below is the link

Powercli script to upload Library Item - Samples - VMware {code}

Hope you find it useful.

Regards

Lokesh

0 Kudos
Leadership
Leadership

Why don't you integrate that function into William's ContentLibrary module?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
VMware Employee
VMware Employee

Yes, I am considering it and will complete it ASAP.

Regards

Lokesh

0 Kudos