Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
VMware vRealize Orchestrator Cookbook. - Second Edition

You're reading from  VMware vRealize Orchestrator Cookbook. - Second Edition

Product type Book
Published in Nov 2016
Publisher Packt
ISBN-13 9781786462787
Pages 556 pages
Edition 2nd Edition
Languages
Author (1):
Daniel Langenhan Daniel Langenhan
Profile icon Daniel Langenhan

Table of Contents (19) Chapters

VMware vRealize Orchestrator Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Installing and Configuring Orchestrator 2. Optimizing Orchestrator Configuration 3. Distributed Design 4. Programming Skills 5. Visual Programming 6. Advanced Programming 7. Interacting with Orchestrator 8. Better Workflows and Optimized Working 9. Essential Plugins 10. Built-in Plugins 11. Additional Plugins 12. Working with vSphere 13. Working with vRealize Automation

Working with JSON


Some REST clients use XML and some use JSON to exchange data. In this recipe, we will look at how to parse and construct JSON objects in Orchestrator.

Getting ready

You should be comfortable with the recipe JavaScript complex variables in this chapter before starting this recipe.

How to do it...

We will divide this recipe into multiple sections, each of which will deal with the different aspects of JSON.

Parsing JSON REST returns

The (undocumented) JSON.parse function makes an object out of a JSON string. This is typically used with JSON REST returns.

In this example, we look at the REST return from the Control Center GET call: api/server/status.

The method response.contentAsString returns the following string:

{"id":null,"error":null,"warning":null,"requestedStatus":null,"initialStatu
s":"RUNNING","currentStatus":"RUNNING","progress":"Status-ing
tcServer\nInstance name: app-server\nRuntime version:
8.0.30.C.RELEASE\ntc Runtime Base: /var/lib/vco/app-server\nStatus:
RUNNING as...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}