vRealize Operations

Using the entire API for vRealize Operations via PowerCLI

Previously we showed you how to use the useful cmdlets available with the PowerCLI vRealize Operations Manager (vR Ops) module, but as we also explained there are only a few cmdlets at the moment and anyone who knows vR Ops will know that there is a lot more functionality than is provided by those cmdlets.

But don’t worry, it is possible to access the entire vR Ops REST API!  PowerCLI gives us the ability to expand the capability of the module to perform many more tasks that aren’t available via the included cmdlets.

In this blog post, which is a continuation of my previous blog posts on the PowerCLI vR Ops module, I will explain how to access the entire vR Ops public REST API via PowerCLI.  Before I begin, it will be helpful to cover some basic information about the vR Ops REST API.

The API is available via the base URI of https://{vrops-IP}/suite-api and if you browse to this link the documentation is available.  For the most part, the API is pretty well documented with examples for usage including payloads for XML and JSON.  Below is a screenshot of the XML request body example for the performAction method.


Throughout this post I will refer to the API documentation for example content such as this.  So, if you are following along take some time to browse the API documentation and leave it open as I continue.

Another important topic to cover before I start is “extensionData” in PowerCLI.  For those unfamiliar, this is a property container that is used for information returned from a client API call that doesn’t have a corresponding object property in PowerShell.  For example, as in my previous post, I invoke the cmdlet Get-OMResource to retrieve a vR Ops resource object, the object properties includes “extensionData” that has a lot of interesting content.


ExtensionData is the key concept in accessing the vR Ops API via PowerCLI. 

I will use the customer requirement for adding and updating a resource property as a walk-through. This should give you a good, basic understanding of how to leverage PowerCLI for any automation or programmatic administration of vR Ops.

To being, when I create a connection to vR Ops using Connect-OMServer a global variable is stored, $global:defaultOMServers, which has an extensionData property.


By the way, the [0] is the index of the server connection, since you can have multiple.  To simply things for my purposes, I just assign the connection properties to a local variable. 


Note that the extensionData property refers to the vR Ops API.  This is where things get interesting! We can easily use the PowerShell Get-Member cmdlet or “gm” for short to explore the properties and methods in the extensionData property.


As you can see, there are a lot of methods available.  This is where it is handy to have the API documentation open, because you can get additional information about each of these methods there by searching for the method name.  For example, above there is a method CreateReport and I can find this in the API documentation by just using Ctrl-F in my browser.


Generally speaking, the methods you find in the extensionData of the server connection are “top level” URIs.  For example /api/resource is a top level URI but there are lower level URIs like /api/resource/{id}/properties that are not contained in the server connection list of methods.

To access those, you simply need to browse the underlying object (for example, a resource object) and view the method membership within that object’s ExtensionData.  I used a shortcut here, but basically the command I used drills down to a resource object to show the members.


Notice the AddProperties method is available here.  I will look that up in the documentation.


Before I continue, I will grab a resource for which I want to create a new property, a virtual machine running Windows server OS named “bmutil”


If I simply reference the method, I can get help on the usage via the OverloadDefinitions property.


The method requires a single input of type VMware.VimAutomation.VRops.Views.PropertyContents so I will create a new variable $contentprops of this type to investigate.


So the only property is the singular Propertycontent.  Now I will create a variable contentprop of type VMware.VimAutomation.VROps.Views.PropertyContent.


Hopefully, you aren’t confused by all of this!  It can be a little frustrating.  This is where the API documentation comes in handy because the input parameter is the XML payload you would send as the REST request body via HTTP.  As I mentioned before, the API documentation provides an example.


I like to refer to the sample XML body because it helps in understanding how to create the input in PowerCLI.  Visualizing this way helps put all of this into perspective.  In addition to this, you can find in the API documentation more detail on the various data models used by the API which can be helpful in figuring out exactly what is required and descriptions of the properties.  For example, you’ll find within the method’s documentation links to the data representations as shown below.


Now, this link actually navigates to <ns3:property-contents> (with an “s” just like the PowerCLI type above) which is a collection of <ns3:property-content> and that model is actually the one that explains what each of the key:value pairs in the payload are used for, the data type and whether or not it is a required field.


Using this information, I can now update the payload for the method.  I am going to
create a new property called “custom|testproperty” with a value of “Created by PowerCLI” and manually put in a timestamp value.  By the way, the timestamp value is a Unix epoch timestamp (i.e. number of seconds since January 1, 1970).

Now I will update the $contentprop variable with the required values.


Next I will update the $contentprops variable with $contentprop.


And I am ready to invoke the method to add this new property to my resource.  But before that, I want to show that the property is not there by invoking the resource method GetResourceProperties.


OK, here we go… invoke $resource.ExtensionData.AddProperties($contentprops)…


Success!  If I want to change the value of this property, I simply provide the same statkey property name with the new timestamp and value.  Here I will just reuse the $contentprop and $contentprops variables.


The PowerCLI module for vR Ops is fully capable of leveraging the entire vR Ops public API and I hope this blog post provided you with a solid understanding of usage and concepts to explore and implement your own use cases.  With this information you can easily create functions and community modules to open up more of the vR Ops functionality via PowerCLI and automate more of your infrastructure.

Dias_John_thumb1_thumbJohn Dias is a Staff Systems Engineer on VMware’s Solution Engineering and Technology team specializing in Cloud Management solutions.

John is a veteran IT professional with over 22 years of experience, most of that having been on the customer side running data center operations, data storage, virtual infrastructure and Unix environments for a major financial institution.

He normally blogs at storagegumbo.com and in his spare time he enjoys astronomy and astrophotography.


543 comments have been added so far

  1. What is the command syntax to execute the PushEvent RestAPI via PowerCli for a VM?


      1. Arihant one noida extension is a luxurious residential housing project which is located at Sector-1, Greater noida west. It offers 3 BHK and 4 BHK spacious apartments. Get information about it’s location, price and reviews.

    1. Arihant one noida extension is a luxurious residential housing project which is located at Sector-1, Greater noida west. It offers 3 BHK and 4 BHK spacious apartments. Get information about it’s location, price and reviews.

  2. Great post. One thing I woud like to do is to create custom groups via PowerCLI or the API. Unfortunately it seems that’s not currently possible 🙁

    I want to create vSphere Virtual Machine Tags that contain application IDs and then create a dynamic group for each App ID so that it will automatically group VMs into the same application. I have tested it on a small scale by manually creating a few custom Groups in vROPS and it works but I need to create hundreds 🙁

    Any idea how his may be achieved?

    1. correction, I did not realise this was possible via the internal APIs as I didn’t initially notice. Now got it working but not using powercli. I will certainly be having a plat with this after reading your post again. Thanks for sharing.

  3. Great Article, you show how to access the entire vR Ops public rest API via PowerCLI .PowerCLI gives us the ability to expand the capability of the module to perform many more tasks that aren’t available via the included cmdlets The PowerCLI module for vR Ops is fully capable of leveraging the entire vR Ops public API . Now I completely understood the usage and concepts .With the help of this article I can easily create functions and community modules to open up more of the vR Ops functionality via PowerCLI and automate more of our infrastructure. Thanks for sharing . The way you explained each and everything is really great. Thanks once again .

    1. I could find useful information from your article, reading this is enlightening. I appreciate you spending your time and effort to put the wordings together. I find myself personally enjoying a significant amount of my time both to read and post this comment. But you know, it’s worth! Slot Pulsa

  4. I would like to get the summary information (or recommended actions) for an alert using PowerCli. I have some specific requirements around generating a CSV file containing actions that need to be taken for VMs and I have not been able to find any sound way of doing it other than copy and paste from each different summary page. This is time consuming and I need to make this happen quickly for an upcoming maintenance window. How can I do this with the REST API?

  5. Youre so cool! I dont suppose Ive learn anything like this before.
    So good to find someone with some unique thoughts on this subject.
    realy thank you for beginning this up.
    this website is one thing that’s wanted on the web, someone with a bit originality.
    helpful job for bringing one thing new to the web!

  6. Telah banyak kasus perjudian online melakukan kecurangan terhadap para member setia mereka, dengan cara tidak membayarkan atau dapat juga berupa menggunakan bot untuk meraup keuntungan lebih. Maka dari itu pastikan Anda bermain di situs judi online terbaik dan terpercaya denpasarbet

  7. Pada saat sekarang ini bermain judi online merupakan salah satu alternatif dalam mencari pendapatan tambahan yang dimana sudah sangat sulit sekali Anda mengontrol pengeluaran yang tidak sesuai dengan pemasukan. Maka dari itu hadirnya situs sebagai salah satu jawaban terhadap solusi permasalahan keuangan Anda.

  8. This article is really contains lot more information about This Topic.
    We have read your all the information some points are good.
    Great post I would like to thank you for the efforts
    You have made in writing this interesting and knowledgeable article.

  9. Every time is critical in business
    Downtime for our customers is extremely costly
    Don’t take risk with long delivery time Take our same day delivery service We keep our valve in stock and we can deliver at any time

  10. Patient satisfaction is a level of patient feeling that arises as a result of the performance of the health service that it obtains after the patient compares with what he expects.

    Hafizurrachman, 2004
    Patient satisfaction is to provide information on the success of quality service providers with the values and expectations of patients who have their own authority to set the quality standards of the desired service.

  11. The content and design of this website is very good and interesting.
    The content of the website is also very interesting and
    can add new knowledge, Thanks you!
    Visit to my website :

  12. Currently the development of the digital world is increasingly advanced, we can find what we want easily and easily through websites on the internet.
    Youtube is one of the sophistications in the field of information with videos that make it even more attractive, there are also many websites that suit your needs.

  13. Cheap Windows VPS Remote desktop – Browse through various Windows RDP VPS hosting packages starting from $7.5/month with no bandwidth limits, VPS panel with intriguing features.

  14. If you’re looking to get into an anime series and you’re too lazy to go through the countless hours of research, we’ve got it all for you. GogoAnime Apk gives you access to all your favorite, latest, or even nostalgic series in easy-to-find categories that are up-to-date with current air dates. Don’t let yourself be restricted to one genre either; find something new every time without having to leave your couch! And if watching isn’t your thing, no problem. We have downloads available as well so that movie night can happen any time of day!

  15. rdp | hosting | mail sender

    buy full admin rdp at noderemote.com. web hosting, reseller hosting, VPS hosting, cheap rdp, Domain, G suite, buy rdp. Our Powerful Control panels to ensure optimal performance. Cheap RDP, Admin Access, Super fast Windows RDP, SSD drives for all plans, 99.99% Uptime Guarantee, Instant Setup, Dedicated Resources, Full Admin Access with NVME/SSD Disks.
    ICQ: UIN 749237189
    SKYPE: live:rdpground
    Telegram: rdpground
    WeChat: rdpground

  16. thanks and best of luck.Pretty! This was a really wonderful post. Thank you for your provided information. This is a really amazing blog that provides quality information

  17. Bonanza138 Situs Hiburan Taruhan Terfavorit Saat Ini. Sebagai situs slot online casino terpercaya kami selalu memberikan inovasi dan inovatif terbaru untuk para pemain . Dengan adanya inovasi terbaru saat ini kami yakin pemain akan dengan senang dan juga nyaman bermain pada situs Bonanza138.

  18. Situs Hiburan Taruhan Terfavorit Saat Ini. Sebagai situs slot online casino terpercaya kami selalu memberikan inovasi dan inovatif terbaru untuk para pemain . Dengan adanya inovasi terbaru saat ini kami yakin pemain akan dengan senang dan juga nyaman bermain pada situs slot Bonanza138.

  19. Bonanza138 Jika pada umumnya player deposit dengan pulsa akan dikenakan potongan jika deposit dengna pulsa. Bonanza 138 memang berbeda dan memberikan pelayanan yang lebih untuk player yakni tanpa potongan sama sekali dan juga tidak ada pengecualian pada provider tertentu, semua tanpa potongan. Dengan kemudahan dan pelayanan lebih ini kami juga memberikan tambahan promosi khusus untuk player dengan memberikan promo event yang diberikan diawal. Jumlah koin yang diterima oleh player lebih besar dari nominal deposit sebesar 10%.

  20. Star88 merupakan situs hiburan favorit saat ini, Sebagai situs mesin slot online terpercaya, kami selalu memberikan inovasi terbaru kepada para pemainnya. Dengan inovasi terbaru saat ini, kami yakin pemain akan bersenang-senang dan nyaman di situs web Star88.

  21. Very good article, the explanation is complete and the tutorial is very easy to understand. I was greatly helped by the articles written, and I came to know a lot about PowerCLI. Thank you for sharing.

  22. Bonanza138 – Daftar Situs Slot Online No. 1 di Indonesia

    Hi semuanya, selamat datang di thread Bonanza138!Di era digital saat ini banyak sekali pilihan untuk permainan online yang dapat Anda mainkan dimanapun dan kapanpun, baik lewat mobile ataupun desktop.Bonanza138 hadir sebagai salah satu penyedia permainan online yang menawarkan berbagai jenis permainan dengan ratusan pilihan permainan kepada Anda.Rasakan keseruan bermain Di Bonanza138 dengan beragam promosi menarik hanya untuk Anda. Tim bantuan Bonanza138 yang ramah serta responsif, siap memberikan pelayanan terbaik.Gabung komunitas Slot Bonanza138.

  23. Ibadah Haji Furoda 2022 AmmarTour
    Menunaikan ibadah haji furoda 2022 memang selalu menjadi salah satu impian yang paling ingin diwujudkan oleh umat muslim di dunia ini. Selain memang menjadi suatu ibadah wajib bagi yang mampu, ibadah haji juga menjanjikan pahala yang besar bagi yang menjalankannya dengan ikhlas karena Allah dan sesuai dengan tuntunan Islam.

  24. Good day! This post couldn’t be composed any better! Perusing this post helps me to remember my old fashioned flat mate! He generally continued discussing this. I will advance this review to him. Almost certain he will have a decent perused. Much obliged for sharing
    Cafe Racer Jacket Leather

  25. Mesinhoki adalah sebuah situs slot gacor online yang sudah sangat dipercaya oleh masyarakat dan para pemain judi online lainnya, tidak hanya itu saja keuntungan yang paling utama ketika memilih situs Mesinhoki para pemain akan dilayani dengan baik.

  26. If you are from indonesia, then you have probably heard about anime, especially the hentai anime that are always in demand. Nowdays, its become too difficult for people to access those animes in your phone, and for the solution, Nekopoi APK is here that will help you to watch your favourite anime without any interruption.

  27. Rame4d ialah situs bandar togel dan situs slot online terpercaya di Indonesia yang memberikan kenyamanan serta sensasi terbaik ketika bermain game togel ataupun slot gacor, kami akan terus berinovasi agar bisa menciptakan pengalaman yang sangat menyenangkan ketika anda hadir di situs RAME4D.

  28. Membangun kepercayaan serta menghadirkan kemudahan dalam bermain slot gacor adalah visi misi utama dari SLOT118 yang dimana ini akan menjadi pengalaman paling menyenangkan ketika anda bermain bersama kami.

  29. webarehosting.com provides Cheap VPS Server and Full admin rdp with Top Speed and High Storage Server. We have many RDP and VPS hosting plans but our most popular plan is our Standard package. We offer great value and features that make it the perfect choice for small and large businesses looking to take their first steps online.

  30. Bonanza138 merupakan salah satu situs agen slot online terpercaya yang telah terbukti akan membayar berapapun jumlah kemenangan anda dan proses deposit dibawah satu menit saja.

  31. Keep up the fantastic work, I read few articles on this site and I conceive that your blog is rattling interesting and contains bands of wonderful information. visit my site: Bonanza138

  32. Fashion should be accessible to everyone, regardless of income. For the same reason, we have kept minimum prices for each piece of clothing. Top Gun might be a good fit for you if you’re looking for something amazing or attractive within the nominal price range this winter.
    Kelly McGillis Top Gun Jacket

  33. Selamat Tiba kembali disitus taruhan permainan slot online paling gampang gacornya, dapat dimainkan kapanpun baik menggunakan mobile phone atau versi dekstop sangat flexible mudah dimainkan. Bonanza138 atau B138 mendatangkan permainan permainan yang sangat gampang gacornya mudah menang player pasti akan sangat senang bermainan disini.

  34. This is really amazing, this your blog loved by a lot of people and I’m also like this post. Keep it up.
    If you’re as active as I am, then you know how we always have to worry about dropping and breaking our phones. What if we could be just as careless with our cameras without worrying? Well, here are the best action camera protector that will keep your device in top condition!

  35. Thank you for the sensible critique. Me & my neighbour were preparing to do some research about that. We got a good book on that matter from our local library and most books where not as influensive as your information

  36. Though you make some VERY fascinating points, you’re going to have to do more than bring up a few things that may be different than what we’ve already heard. What are trying to say here

  37. Really impressed! Everything is very open and very clear clarification of issues. It contains truly facts. Your website is very valuable. Thanks for sharing. It’s late finding this act. At least, it’s a thing to be familiar with that there are such events exist. I agree with your Blog and I will be back to inspect it more in the future so please keep up your act.

  38. Link alternatif terbaru ,dijamin memberikan pengalam luar biasa yang tidak adan dapatkan ditempat lain tentunya.You can click here for more details : gan88

  39. We keep up with the latest techniques of building and have qualified tradesmen to ensure that your job/project is carried out safely. We also make sure that we keep to the highest standards on projects and everyone who works for us is health & safety trained.

  40. Pandemi Covid-19 menyebabkan berbagai negara menutup border mereka dari berbagai dunia, tak terkecuali Jepang. Namun, bagi yang tidak sabar untuk pergi ke Jepang, kini Jepang telah membuka kembali bordernya. Meskipun demikian, Jepang memberikan berbagai syarat yang perlu diikuti untuk bisa masuk ke Jepang. Yuk, simak berbagai syarat umum dan syarat tambahan berikut ini. Asuransi Perjalanan Internasional

  41. checking through the net, Appreciation for being really thoughtful. The post contains really beneficial information. Periodico en Albacete.

  42. Staff 4 Success is an executive search firm that works with small and medium size staffing, search and consulting firms across the country. We provide executive search and consulting services to the industry across the country. We work closely with our customers to identify the ideal talent through a customized search process and work with our candidates in the highest of confidence as nearly everyone is actively employed in the industry.
    Jobs In Staffing Industry

  43. This popular shooting game can be played online and offline. With difficulty levels, players can practice and play as police officers or kidnappers in the game! As a cop, players will be able to hunt down the kidnapper, while protecting themselves from bullets. But as a kidnapper, you’ll have to decide whether to search for the key and escape, or shoot the cop before he catches you!

  44. This popular shooting game can be played online and offline. With difficulty levels, players can practice and play as police officers or kidnappers in the game!

  45. The call girls of Manali are known for their elegance, beauty, and sophistication. They are well-groomed, well-mannered and carry themselves with utmost grace and dignity. They are highly skilled and know how to handle their clients with utmost care and respect. From the moment one steps into their company, they make sure that their clients get the best possible experience.

  46. Your style is really unique compared to other people I’ve
    read stuff from. I appreciate you for posting when you have the
    opportunity, Guess I’ll just book mark this web site.

  47. I had just recently started hunting for Business Development After six hours of nonstop Google searching, I eventually found it on your website. I’m curious as to why Google doesn’t place this kind of educational websites at the top of the list. Typically, the most popular websites are crammed with junk.

  48. I just love this blog and this piece of art. It’s just so romantic and life affirming. When all we’re ever fed in the media is 99% bad news isn’t it great to see a city and it’s people portrayed as wonderful beings. I just really hope they get together!

  49. I am typically to blogging and i genuinely appreciate your posts. Your content has truly peaks my interest. I will bookmark your site and keep checking for brand spanking new info.

  50. Good post and a nice summation of the problem. My only problem with the analysis is given that much of the population joined the chorus of deregulatory mythology, given vested interest is inclined toward perpetuation of the current system and given a lack of a popular cheerleader for your arguments, I’m not seeing much in the way of change. I would really love to guest post on your blog . Some really nice stuff on this web site , I love it. Im no expert, but I consider you just made the best point. You naturally know what youre speaking about, and I can really get behind that. Thanks for being so upfront and so sincere.

  51. Though It is not relevant to me but it is quite informative and many of my connections relate to it. I know how it works. You’re doing a good job, keep up the good work. Thanks for sharing this best stuff with us! Keep sharing! I am new in the blog writing.All types blogs and posts are not helpful for the readers.Here the author is giving good thoughts and suggestions to each and every readers through this article . Very valuable information, it is not at all blogs that we find this, congratulations I was looking for something like that and found it here.


Leave a Reply

Your email address will not be published. Required fields are marked *