Skip to main content

Cyware Orchestrate

Work with App Actions

An action executes a defined task to achieve a specific purpose or goal. Each app contains a predefined set of actions available to them. For any app, you can create new actions or work with existing actions. If an app instance is configured for an app, then you can execute app actions in a Playbook.

Add Actions

You can add actions while creating a custom app or while editing or cloning a pre-built app. Add a new action to an app and define the parameters relevant to that action.

Steps

  1. Click Main Menu, and click Apps.

  2. Go to My Apps and navigate to the required app.

  3. To add a new action to an existing app:

    Click the ellipses either on the app or go to the app details page, and click Edit App.

    Note

    You cannot directly edit the Appstore apps. If you need to edit an app that is installed from Appstore, then you need to clone the app and then add the required action.

  4. Under App Details, scroll down to the Actions section.

  5. Click +Action to add a new action to the app.

  6. Configure the following parameters:

    • Action Identifier: Enter an identifier for the action using lowercase alphabets and without spaces. You cannot modify the value of the identifier after saving this action.Example: ip_lookup

    • Action Name: Enter the name of the action. These names are listed in the drop down when you add an app-action node while creating Playbook.

    • Action Description (Optional): Enter a description for the action.

  7. Click Create.

  8. For each action, configure the parameters in the connector.py file using the python editor. Click the Sync icon to sync the values between the editor and the AppDetails section.

    Format for adding new actions and parameters:
    
    # sample actions.
    
    def action_usecase_one(self, query_param_one: str, **kwargs):
    
    endpoint = "use-case-one/"
    
    query_params = {"query_param_one": query_param_one}
    
    response = self.request_handler("GET", endpoint, query_params=query_params)
    
    return response
    
    Usecase_one: Name of the action
    Query_param_one: Name of the parameter
    GET: Enter the method here. Allowed values: GET, PUT, POST, DELETE
  9. Click Save.

Edit Actions

You can edit existing actions and action details for an app. You cannot modify the action identifier and python function name.

Steps

To edit action details:

  1. Click Main Menu, and click Apps.

  2. Go to My Apps, select an app to view the details. You can edit the details of a cloned app or a newly created app.

  3. Click ellipses either on the app or on the app details page, and click Edit App.

  4. Edit the required App Details.

  5. Click Sync in the Python editor to sync up the code and app details.

  6. Click Save.

View Actions

For any app, you can view the associated actions and its details in the app details page.

Steps

To view the app actions:

  1. Click Main Menu, and click Apps.

  2. Select an app to go to the app details page.

  3. In the app details page, click Actions to view the associated actions for an app.

  4. For an action, click the eye icon to view the action details such as accepted parameters and return values if any.