Book Image

Practical OneOps

By : Nilesh Nimkar
Book Image

Practical OneOps

By: Nilesh Nimkar

Overview of this book

Walmart’s OneOps is an open source DevOps platform that is used for cloud and application lifecycle management. It can manage critical and complex application workload on any multi cloud-based infrastructure and revolutionizes the way administrators, developers, and engineers develop and launch new products. This practical book focuses on real-life cases and hands-on scenarios to develop, launch, and test your applications faster, so you can implement the DevOps process using OneOps. You will be exposed to the fundamental aspects of OneOps starting with installing, deploying, and configuring OneOps in a test environment, which will also come in handy later for development and debugging. You will also learn about design and architecture, and work through steps to perform enterprise level deployment. You will understand the initial setup of OneOps such as creating organization, teams, and access management. Finally, you will be taught how to configure, repair, scale, and extend applications across various cloud platforms.
Table of Contents (18 chapters)
Practical OneOps
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Using Ruby to create and transition assembly


Now that we know the basics of the REST API and know how to access it via the command line, we can start writing scripts to do various things. Our goal is to create an assembly, add some platforms to it, and transition it, all through a script. So, let's start with a simple script and see if we can build on top of it. We start by porting what we did from the command line to a Ruby script, accessing our organization. Our script looks something like this:

require 'rest-client'
require 'json'
token = 'CMS8qQDddG1AZxazkTz5'
server = 'http://localhost:9090'
client = RestClient::Resource.new(server,token,'')
result = client['/account/organizations'].get
puts result

If you save the script and run it, you can see the output also as given later. Of course, you will have to substitute the token and server with your own values.

As you can see, the output is as expected. Now let's modify the code a little and see if we can create an assembly:

require 'rest...