Accessing the Control Center via the REST plugin

In this recipe, we have a closer look at the Orchestrator Control Center.

Getting ready

We need access to the Orchestrator Control Center.

Add the Orchestrator Control Center to the REST plugin as shown in the recipe Working with REST in Chapter 9, Essential Plugins .

How to do it…

The recipe has been broken up into several sections, just work through them.

Explore the Control Center API

We will be having a look at the possibilities of the Control Center API:

  1. Open a browser to the URL and authenticate with your Control Center account: https://[Orchestrator]:8283/vco-controlcenter/docs/
  2. You now are connected to the swagger UI, which helps you explore the Control Center API.

    Explore the Control Center API

  3. Expand server-controller and check out GET /api/server/status and POST /api/server/status/start. We used these functions in recipe Working with REST in Chapter 9, Essential Plugins.

    Explore the Control Center API

Adding start and stop calls

Create control workflows for your Remote Orchestrators.

  1. Check out the swagger UI for the calls /api/server/start, stop, and status calls.
  2. Follow the recipe Working with REST in Chapter 9, Essential Plugins, to add the three functions to the REST host.
  3. Create three workflows from the calls
  4. Edit the GET workflow to set the correct content type.
  5. Edit the POST workflows and move the content input to be an Attribute.
  6. Use the recipe Working with REST in Chapter 9, Essential Plugins, and the Working with JSON in Chapter 6, Advanced Programming, to understand how to phrase the JSON returns.

Usage

There are several ideas that you can use from here:

  • Create a policy that monitors the cluster and restarts VMs or Orchestrator services.
  • Auto deploy additional Orchestrators in a server (stop service, import configuration, join cluster, start service)

How it works...

The ability to tie the Orchestrator control into your workflow enables you to use Orchestrator to orchestrate remote Orchestrators much more easily. As there isn't any documentation except the swagger UI at this time, it may be a bit hard, but I wouldn't be surprised to see someone coming up with an Orchestrator Control Center plug-in soon.

You can also attach the Control Center using the swagger specification URL (see recipe Working with REST in Chapter 9, Essential Plugins). The URL for the swagger spec of Control Center is https://[FQDN Orchestrator]:8283/vco-controlcenter/api/api-docs.

See also

There are several examples in the example pack. They won't work, as you need to define the REST host and the REST call (see resource element in Workflows) but these are an example of what they could look like and what could be done with them:

  • 07.04.1 Orchestrator Service Status
  • 07.04.2 Start Orchestrator Service
  • 07.04.3 Stop Orchestrator Service
  • 07.04.4 Cluster Status
  • The recipe Turning Strings into Objects in Chapter 6, Advanced Programming.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset