Oracle by Example brandingCreating an Orchestration to Stop an Instance of Server

section 0Before You Begin

This 30-minute tutorial shows you how to create an orchestration to stop an instance of server.

Background

You will create an orchestration with an Open API connector to call a REST service that retrieves the Server Manager information. You will add the service request and rules to the orchestration, and then map the orchestration input to the input defined in the service requests. Last, you will test the orchestration to verify that it returns the requested data.

In this orchestration, you will only provide the required inputs to the orchestration, and the rest of the tasks are performed automatically.

The orchestration for stopping an instance of server involves creating and adding the following steps:

  1. Open API connection to list all the API calls that can be performed on Server Manager
  2. Service Request to retrieve the state of an instance
  3. Service Request to stop an instance of the server
  4. Rule to check if an instance of the server is running

In the Orchestrator Studio, you can configure a connector service request to invoke a REST service. The Connector design page in the Orchestrator Studio provides a test feature that enables you to test the connector and view the JSON response of the REST service call.

What Do You Need?

  • Orchestrator Studio 7.3 or higher deployed in a JD Edwards EnterpriseOne test environment with a minimum of EnterpriseOne Tools 9.2.3.4.
  • An AIS Server version 9.2.3.0 or higher is running and accessible (based on network configuration) to your Orchestrator Studio.
  • An instance of server running on the Server Manager Console 9.2.3.4 or higher to which you want to make a connection.

section 1Creating a Connection to the Server Manager Console

A connector service request requires a connection, which will list all the REST services (API calls) that can be invoked via the Server Manager Console.

In this task, you will create an OpenAPI connection to list all the REST services on the Server Manager.

  1. On the Orchestrator Studio Home page, click the Tools link.
  2. On the Tools page, click the Connections icon.
  3. Click the New Connection button.
  4. On Connection Information, complete these fields:
    • Name = Stop Instance Open API Connect
    • Description = Connection for stop instance
    • Type = Select Open API from the drop-down list.
    • User/Role. Enter the user authorized to access the connection. The user can be an EnterpriseOne user, role, or *PUBLIC.
    • Environment. Enter the environment where the connections reside.
  5. On the Service Information tab, in the Endpoint field, enter the URL for accessing the Open API documentation, through which you can access the Server Manager REST services. For example:
  6. https://server_manager_console_host:port/manage/mgmtrestservice/v1/open-api-catalog
  7. On the Security tab, select Basic Authentication and then complete these fields to enable access to the Server Manager Console:

    User = Enter an EnterpriseOne user authorized to access the Server Manager Console.

    Password = Enter the password for the EnterpriseOne user.

  8. Enter proxy information on the Proxy tab if necessary for your network configuration.
  9. Save the record.
  10. The Open API connection should look like this:
    Open API Connection
    Open API Connection

section 2Creating the Connector Service Request to Retrieve the State of an Instance

In this task, you will create a connector service request that retrieves the state of the managed instance within Server Manager Console.

  1. On the Orchestrator Studio Home page, click the Service Requests icon.
  2. On the Service Requests page, click the Create Service Request button and select Connector.
  3. On the Connector page, complete the following fields:
    • Service Request = Instance State SR
    • Enter Short Description = State of an instance in the Server Manager.
  4. Click the Product Code drop-down list and select 55 for a customer product code.
  5. Click the Connection field, and under the Open_API category, select the Stop Instance Open API Connect connection, which you created in the previous task.
  6. Click the API drop-down list and select /instancestate.
  7. Click the HTTP Method drop-down list and select GET.
  8. As soon as you select the HTTP Method value, the API Description and API Summary fields are displayed with corresponding values for the selected API. Also, the Pathing and Parameters sections are automatically filled with the appropriate values.
  9. To limit the output to a few returned values, enter the following output values in the Output section:
  10. Output Variable Name
    instanceState instanceState
  11. Save the service request.
  12. To test the service call, click the Test button and make sure you receive the expected output.
  13. The Instance State SR service request should look like this:
    Instance State SR service request
    The Instance State SR service request

section 3Creating the Connector Service Request to Stop an Instance

In this task, you will create a connector service request to stop an instance within the Server Manage Console.

  1. On the Orchestrator Studio Home page, click the Service Requests icon.
  2. On the Service Requests page, click the Create Service Request button and select Connector.
  3. On the Connector page, complete the following fields:
    • Service Request = Stop Instance SR
    • Enter Short Description = Stop the instance.
  4. Click the Product Code drop-down list and select 55 for a customer product code.
  5. Click the Connection field, and under the Open_API category, select the Change Component connection, which you created in the previous task.
  6. Click the API drop-down list and select /stopinstance.
  7. Click the HTTP Method drop-down list and select POST.
  8. As soon as you select the HTTP Method value, the API Description and API Summary fields are displayed with corresponding values for the selected API. Also, the Pathing and Parameters sections are automatically filled with the appropriate values.
  9. Save the service request.
  10. The Stop Instance SR service request should look like this:
    Stop Instance SR service request
    Stop Instance SR service request

section 4Creating a Rule to Check if an Instance is Running

In this task, you will create a rule to check if an instance is running.

  1. On the Orchestrator Studio Home page, click the Rules icon.
  2. On the Rules, click the New Rule button.
  3. On the Rules design page, complete the following fields:
    • Rule =Instance State is Running
    • Enter Short Description = Check if the instance is running.
  4. Click the Product Code drop-down list and select 55 for a customer product code.
  5. Select the Match Value drop-down menu and select Match Any.
  6. In the first row in the grid, complete the following columns to add a condition:
    • Rule Type. Click the drop-down menu and select String.
    • Value 1. Enter instanceState for the input name.
    • Operator. In the drop-down menu, select contains from the list of operands.
    • Literal. Click this check box to indicate a literal value.
    • Value 2. Enter RUNNING as the value.
    • Literal Value Type. Click this drop-down menu and select the format of the literal value as String.
  7. Click the Save button.
  8. The Instance State is Running rule should look like this:
The Instance State is Running Rule
The instance State is Running Rule

section 5Creating an Orchestration to Stop an Instance

In this task, you will create an orchestration to stop an instance of a server in the Server Manager Console.

This task involves adding a service request (Instance State) created in the previous tasks to the orchestration, adding a rule (Instance is Running) to check if the instance is running, and adding a service request (Stop Instance) to stop the instance of the server. Lastly, you will map the orchestration input to the input defined in the service requests.

  1. Navigate to the Orchestrations page and click the New Orchestration button.
  2. On the Orchestration design page, complete these fields:
    • Orchestration = Stop Instance Orchestration
    • Enter Short Description = Orchestration to stop an instance
  3. Click the Product Code drop-down list and select 55 for a customer product code.
  4. In the Orchestration Steps area, click the Add Step button (+), select Service Request, and then click OK to add a service request to the steps.
  5. At the end of the row with the Connector service request, click the down arrow and select Instance State SR from the drop-down list.
  6. Click the Insert Step After icon, select Rule, and then click OK to add a rule to the steps.
  7. At the end of the row with the rule, click the down arrow and select Instance State is Running from the drop-down list.
  8. In the step that is added, select True in the Action column, then in the Enter Type of Step field that pops up, select Service Request from the drop-down list and click OK.
  9. At the end of the row with the service request, click the down arrow and select Stop Instance SR from the drop-down list.
  10. Enter the orchestration input:
    • Expand the Orchestration Inputs section.
    • In the first row, enter instanceName in the Input column and in the Value Type drop-down list, select String.
  11. Select the Instance State SR Connector step.

    In the Transformations grid,notice that the ${instanceName}input, which is the input to this connector service request, is displayed in the first row. To map the orchestration input to this service request input, click the Available Values drop-down list and select instanceName.

  12. Select the Instance State is Running Rule step.
  13. In the Transformations grid, notice that the ${instanceState} input, which is the input to this rule, is displayed in the first row. To map the orchestration input to this rule input, click the Available Values drop-down list and select instanceState.
  14. Select the Stop Instance SR Connector step.
    In the Transformations grid, notice that the ${instanceName} input, which is the input to this connector service request, is displayed in the first row. To map the orchestration input to this service request input, click the Available Values drop-down list and select instanceName.
  15. Save the Orchestration.
  16. The orchestration should look like this:
    Orchestration
    Orchestration

section 6Testing the Orchestration

Use the Orchestrator Client to test the orchestration and verify that it returns the output as defined in the orchestration.

  1. In the Orchestrator Studio, click the Tools link to access the Tools page, and then click the Orchestrator Client icon.
  2. Sign in with the same credentials that you used to access the Orchestrator Studio.
  3. In Orchestrator Client, select Stop Instance Orchestration from the Orchestration Name drop-down list.
  4. The Orchestrator Client for the Stop Instance Orchestration should look like this:
    The Orchestrator Client for the Stop Instance Orchestration
    The Orchestrator Client for the Stop Instance Orchestration
  5. In the Inputs area, enter values for the input: instanceName
  6. Click Run.
  7. The output should show results for the inputs that you entered.