You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Cancel all started tasks

Description

By calling this endpoint, all the started tasks across all nodes will be reopen. Automatic tasks will also be executed.

PUT http://<server>:<port>/<runtime_name>/api/v1/scheduler/maintenance/tasks/cancelStarted

Setting the property blueriq.processengine.cancel-started-tasks to true when running in a multi-node environment might cause problems because while the cancellation of started tasks triggered on one node is running, a specific task could be still in progress on another node and it might be reopen.

Cancel all started tasks endpoint was created in order to avoid these types of situations.

The endpoint overrules the blueriq.processengine.cancel-started-tasks property.

Usage

The following steps should be followed for using this endpoint:

  1. Make sure that there exists a runtime user with a role that has the permission SCHEDULER_MANAGER.
  2. Check that blueriq.oauth2.client-id and blueriq.oauth2.secret are defined in application.properties file. If they are missing, please define them.
  3. Access Runtime Swagger Interface: 

    http://<server>:<port>/<runtime>/api/v1/docs/index.html
  4. Fill the username and the password and press Generate Token in order to obtain a new token.
  5. Expand scheduler.
  6. Expand PUT /scheduler/maintenance/tasks/cancelStarted.
  7. Press Try it out!

 

Update Application Name And Version

Description

By calling one of these endpoint, the application ids for cases matching the application name from the url will be updated with new values. Every job registered to these cases will be updated as well.

PUT http://<server>:<port>/<runtime_name>/api/v1/scheduler/maintenance/applications/{currentApplicationId}?caseId={caseId}

{
"name" : {newApplicationName},
"version" : {newApplicationVersion}
}


Validations

  1. Current application id consists of application name and application version. Format of the application id is: applicationName:applicationVersion.
  2. Current application id is mandatory, case id is optional.
    If case id is specified, only one case will be updated. If case id is not specified all cases matching the application id will be updated.
  3. Either new name or new version must be specified in the request body.

Steps:

  1. Find all cases matching the application id (from the url). If case id is specified, find the case by it's id.
  2. Update application id for the cases from step 1, with the new data sent in the request body. Name or version or both can be updated, depending on what is specified in the request body.
  3. Get the jobs for the cases and update them accordingly.

Request examples:

  1. Update application name.

    1.1 Update application name

    The application ids, for the cases with the current application id "export-TestOldProject:0.0-Trunk", are updated to "export-TestNewProject:0.0-Trunk". 

    PUT http://<server>:<port>/<runtime_name>/api/v1/scheduler/maintenance/applications/export-TestOldProject:0.0-Trunk

    {
    "name" : "export-TestNewProject"
    }

  2. Update application version

    The application ids, for the cases with the current application id "export-TestOldProject:0.0-Trunk", are updated to "export-TestOldProject:0.1-Trunk". 

    PUT http://<server>:<port>/<runtime_name>/api/v1/scheduler/maintenance/applications/export-TestOldProject:0.0-Trunk

    {
    "version" : "0.1-Trunk"
    }

  3. Update application id (both name and version)

    The application ids, for the cases with the current application id "export-TestOldProject:0.0-Trunk", are updated to "export-TestNewProject:0.1-Trunk". 

    PUT http://<server>:<port>/<runtime_name>/api/v1/scheduler/maintenance/applications/export-TestOldProject/0.0-Trunk

    {
    "name" : "export-TestNewProject",
    "version" : "0.1-Trunk"
    }

  4. Update application id for a specific case
    1. Update application name

      The application id, for the case with the current application id "export-TestOldProject:0.0-Trunk" and case id 1, is updated to "export-TestNewProject:0.0-Trunk". 

      PUT http://<server>:<port>/<runtime_name>/api/v1/scheduler/maintenance/applications/export-TestOldProject:0.0-Trunk?caseId=1

      {
      "name" : "export-TestNewProject"
      }

    2. Update application version

      The application id, for the case with the current application id "export-TestOldProject:0.0-Trunk" and case id 1, is updated to "export-TestOldProject:0.1-Trunk". 

      PUT http://<server>:<port>/<runtime_name>/api/v1/scheduler/maintenance/applications/export-TestOldProject:0.0-Trunk?caseId=1

      {
      "version" : "0.1-Trunk"
      }

    3. Update application id

      The application id, for the case with the current application id "export-TestOldProject:0.0-Trunk" and case id 1, is updated to "export-TestNewProject:0.1-Trunk". 

      PUT http://<server>:<port>/<runtime_name>/api/v1/scheduler/maintenance/applications/export-TestOldProject/0.0-Trunk?caseId=1

      {
      "name" : "export-TestNewProject",
      "version" : "0.1-Trunk"
      }

Usage

The following steps should be followed for using this endpoint:

  1. Make sure that there exists a runtime user with a role that has the permission SCHEDULER_MANAGER.
  2. Check that blueriq.oauth2.client-id and blueriq.oauth2.secret are defined in application.properties file. If they are missing, please define them.
  3. Access Runtime Swagger Interface: 

    http://<server>:<port>/<runtime>/api/v1/docs/index.html
  4. Fill the username and the password and press Generate Token in order to obtain a new token.
  5. Expand scheduler.
  6. Expand PUT /scheduler/maintenance/applications/{currentApplicationId}
  7. Specify the request parameters.
  8. Press Try it out!
  • No labels