Package Workflow association with Organisation

For each environment, the de-association/association of PWFs, products, components in respective environments/instances (namely, core platform, ITOps, Invoice PWF) can be done. This will include the de-association of monitoring/support PWFs after data migration, as well as the association of new ITOps PWF and these steps are done via API.

 

Postman Collection contains sample request/response samples for the various APIs for association and de-association. It is on need basis that these need to get executed. For actual usage, these should be replaced with appropriate values for host, headers and request body. PFB the details of each of these APIs:

Postman collection available at: (https://ustglobal.sharepoint.com/:u:/r/teams/InnovationEngineering/Shared%20Documents/Knowledge%20Management/SmartOps%20Deployment/7.0.0/7.0_CorePlatform_PostmanCollection.zip?csf=1&web=1&e=UuTsda)

 

  1. Invoke the SmartOps Login API for the applicable Organization.

    URL: POST https://<host_name>/pwf/api/smartops/login

    Body: {"realm":"<orgname>","userName":"<user_name>","password":"<password>"}

     

  2. Invoke the Get all PWFS, Products and Components (stacks) API with the following parameters to fetch all available PWFS, products and components:

    URL: GET https://<host_name>/pwf/api/smartops/pwf/fetch-smartops-capabilities

    Headers:

    • Organization-name–Unique identifier for the organization.

    • Authorization –Access token generated after invoking SmartOps login API (offline token can also be used)

    • user –User Id


    NoteThis API response provides the details of the PWFs, products and components available and it is based on these values the input for the rest of the APIs given below can be derived.

  3. Invoke the Add Product and PWF association API to add or associate applicable PWFs and Products in the required Organization.

    URL: PUT https://<host_name>/pwf/api/smartops/pwf/create-pwf-or-product-association

    Headers:

    • Organization-name –Unique identifier for the organisation.

    • Authorization –Access token generated after invoking SmartOps login API (offline token can also be used)

    • user –User Id

    Body: {"componentId": <component_id>,"componentType":"<component_type>"}

    • Component ID –Unique identifier of the package workflow or product (copied from previous step)

    • Component Type –pwf / product

     


    Note: Repeat this step for every PWF / product to be associated to the organization.

  4. Invoke Disable PWF Association API if you need to de-associate any PWF from an organization.

    URL: PUT > https://<host_name>/pwf/api/smartops/pwf/disable-pwf-association?pwfId=<pwf_id>

    Headers: offline-token or Authorization, user and Organization-key

    Param: <pwf_id>

    Note: Disabling PWF association will only disable the association of PWF with that organization. If there are any active projects associated wit that PWF, these projects should be de-activated or deleted to avoid further executions of these projects.

  5. Invoke Remove Product Association API if you need to de-associate any Product from an organization.

    URL: DELETE > https://<host_name>/pwf/api/smartops/pwf/remove-product-association/<product_id>

    Headers: offline-token or Authorization, user and Organization-key

    Param: <product_id>

     

  6. Associate/De-Associate components/stack to a Product or a PWF
    The details are as follows: 

    1. API details to Associate Stacks with PWF/Product:

      URL: PUT
      https://<hostname>/pwf/api/smartops/pwf/add-component-association

      Headers: offline-token or Authorization, user and Organization-key
      Body: {"componentId":<component_id>,"componentType":"<component_type>","stacks":[<list_of_stacks>]}

    2. API details to De-associate Stacks from PWF/Product:

      URL:DELETE https://<hostname>/pwf/api/smartops/pwf/remove-component-association

      Headers: offline-token or Authorization, user and Organization-key

      Body: {"componentId":<component_id>,"componentType":"<component_type>","stacks":[<list_of_stacks>]}

       

Note:

  1. Replace request body with corresponding values of componentId, componentType, stack.

  2. The componentType can be either product/pwf.

  3. The componentId is the corresponding id of the product or pwf

  4. The stacks should be list of applicable components which needs to be associated for the product/pwf.

  5. The values of the componentId and the stack can be obtained from the API which fetches all PWFs, Products and Components (api/smartops/pwf/fetch-smartops-capabilities)

Related Topics:

 

Feedback

Copyright © 2021 UST Global. All Rights Reserved.