Resource plan modification by CLI feature

Use resource plan modification when you want to modify a resource plan using a script.

About resource plan modification by CLI

The EGO CLI Resource Plan Modification feature allows you to modify your resource plan using the command line interface (CLI). Use this feature when you want to modify a resource plan using a script. Benefits of using this feature include triggering the update of resource plan by means of a script. Without this feature, you must log on to the Platform Management Console (PMC) to modify the resource plan.

Scope


Applicability

Details

Operating system

Windows

EGO version

EGO 1.2.3

Commands

Applies only to the egosh command

Limitations

The feature is only available upon request

Known issues

None


Behavior of resource plan modification by CLI

After exporting, editing, and saving the resource plan as C:\ResourcePlan.xml, egosh applyresplan C:\ResourcePlan.xml updates the resource plan:
  • Checks user rights.

    Only the Cluster Administrator or the Consumer Administrator of the top-level consumer can update the resource plan using egosh.

  • Validates the applied resource plan against the schema.

    The applied resource plan must be a valid resource plan XML file.

  • Checks for conflicts between the applied resource plan and the backend resource plan.

    The consumer in the applied resource plan must exist in the backend resource plan.

  • Delivers the applied resource plan to the backend and makes it take effect.

    Calls the EGO API to deliver the applied resource plan to the backend.

Usage


Syntax

Description

consumer applyresplan [-c] [-e error_log_directory] file_path

Applies the specified resource plan

-c

Only checks the resource plan without applying it.

-e

Specifies the directory of the error log. If an error occurs while updating the resource plan, the error messages are appended into the error log in the specified directory.

If the directory of the error log is not specified, the system outputs error messages to

stderr
.

file_path

Specifies the path of the resource plan that you want to apply. The resource plan must be a valid resource plan XML file.


Example of usage

  1. Prepare the resource plans.

    1. Log on to the Platform Management Console as a cluster administrator.

    2. Export the resource plan and save it as C:\ResourcePlan.xml.

    3. Edit ResourcePlan.xml in order to allocate all the resources available to SOASamples, and save it as C:\ResourcePlan_new.xml.

  2. Switch resource plans using egosh in your script.
    1. Log on as a cluster administrator in egosh.

      The credentials are saved in a temp directory. Over the next 8 hours, egosh uses this credential to execute commands and does not need the user's password.

    2. In your script, call egosh applyconsumer -e C:\ C:\ResourcePlan.xml and egosh applyconsumer -e C:\ C:\ResourcePlan_new.xml to switch resource plans when some event occurs.

Behavior of configuration to modify resource plan modification by CLI

None.

Resource plan modification by CLI commands

Commands to monitor


User

Command

Behavior

Cluster Administrator or Consumer Administrator

From the Platform Management Console: Consumers & Plans > Resource Plan

Check the resource plan.


Commands to control


User

Command

Behavior

Cluster Administrator or Consumer Administrator

From the Platform Management Console: Consumers & Plans > Resource Plan

Export the resource plan.

Cluster Administrator or Consumer Administrator

egosh consumer applyresplan

Modify the resource plan.


Commands to display configuration

Not applicable.

Commands for submission


Syntax

Description

consumer applyresplan [-c] [-e error_log_directory] file_path

Applies the specified resource plan

-c

Only checks the resource plan without applying it.

-e

Specifies the directory of the error log. If an error occurs while updating the resource plan, the error messages are appended into the error log in the specified directory.

If the directory of the error log is not specified, the system outputs error messages to stderr.

file_path

Specifies the path of the resource plan that you want to apply. The resource plan must be a valid resource plan XML file.