Itential vendor logo

Vendor

Itential

Product

IAP

Method

Library

Project Type

Workflow Project


View Repository
Workflow

IAP - Workflow Utilities - Modular Automations

Overview

The Itential solution enables network teams to build automations that can include common tasks for IAP job history management, documentation of use cases in IAP, and IAP workflow optimization tasks. This is a library of related automations that can be used as modular components in your own larger, end-to-end workflows.

Workflows

NameOverview
Archive Jobs and Tasks Collections - IAPWorkflow that can archive data from the IAP Jobs and Tasks collections in MongoDB.
Restore Archived Jobs and Tasks - IAPWorkflow that restores archived IAP Jobs and Tasks collections in MongoDB database.
As Built Documentation - IAPWorkflow that creates a document in markdown format that includes each component of the pre-built, as well as the relationships between the components.
Chunk Array For Loop - IAPWorkflow that splits large inputs into groups to be run in a child job loop

For further technical details on how to install and use this Workflow Project, please click the Technical Documentation tab.

Table of Contents

Getting Started

This section is helpful for deployments as it provides you with pertinent information on prerequisites and properties.

Helpful Background Information

Workflows often include logic that varies from business to business. As a result, we often find that our Workflow Projects are more useful as modular components that can be incorporated into a larger process. In addition, they often can add value as a learning tool on how we integrate with other systems and how we do things within the Itential Automation Platform.

While these can be utilized, you may find more value in using them as a starting point to build around.

Prerequisites

Itential Workflow Projects are built and tested on particular versions of IAP. In addition, Workflow Projects are often dependent on external systems and as such, these Workflow Projects will have dependencies on these other systems. This version of IAP - Workflow Utilities has been tested with:

  • IAP 2023.1

External Dependencies

NameOS VersionAPI Version
Itential app-artifacts^6.5.3-2023.1.1

Adapters

NameVersionConfiguration Notes
adapter-db_mongo0.6.2

How to Install

To install the Workflow Project:

  • Verify you are running a supported version of the Itential Automation Platform (IAP) as listed above in the Supported IAP Versions section in order to install the Example Project.
  • Import the Example Project in Admin Essentials.

Testing

Cypress is generally used to test all Itential Example Projects. While Cypress is an opensource tool, at Itential we have internal libraries that have been built around Cypress to allow us to test with a deployed IAP.

When certifying our Example Projects for a release of IAP we run these tests against the particular version of IAP and create a release branch in GitLab. If you do not see the Example Project available in your version of IAP please contact Itential.

While Itential tests this Example Project and its capabilities, it is often the case the customer environments offer their own unique circumstances. Therefore, it is our recommendation that you deploy this Example Project into a development/testing environment in which you can test the Example Project.

Using this Workflow Project

Workflow Projects contain 1 or more workflows. Each of these workflows have different inputs and outputs.

Archive Jobs and Tasks Collections - IAP

Workflow that can archive data from the IAP Jobs and Tasks collections in MongoDB.

Capabilities include:

  • Creates new archive collection(s) for jobs collection
  • Creates new archive collection(s) for tasks collection
  • Optionally delete documents from job collection after archive
  • Optionally delete documents from tasks collection after archive
  • Specify number of documents per collection
  • Specify age of data to archive

Entry Point IAP Component

The primary IAP component to run Archive Jobs and Tasks Collections - IAP is listed below:

IAP Component NameIAP Component Type
Archive Jobs and Tasks Collections - IAPWorkflow

Inputs

The following table lists the inputs for Archive Jobs and Tasks Collections - IAP:

NameTypeRequiredDescriptionExample Value
createArchiveCollectionsbooleanyesWhether or not to create new archive collections
true
deleteCopiedDataFromCollectionsbooleanyesWhether or not to delete old data from collections after copy
true
verbosebooleanyesWhether or not to display outcome as manual tasks
false
copyMoveJobsDataToCollectionstringyesName for jobs archive collection
job_archive
copyMoveJobsDataToCollectionstringyesName for tasks archive collection
tasks_archive
copyMoveDataOlderThanDaysnumberyesAge of data to archive in days
30
batchSizenumberyesHow many documents per archive collection
50
adapterIdstringyesName of MongoDB adapter to use
mongodb

Outputs

The following table lists the outputs for Archive Jobs and Tasks Collections - IAP:

NameTypeDescriptionExample Value
messagearrayArray of messages from each step of the automation
[
  "Successfully backed up matching items from the IAP Jobs collection",
  "Successfully backed up matching items from the IAP Tasks collection",
  "Successfully deleted matching items from the IAP Jobs collection",
  "Successfully deleted matching items from the IAP Tasks collection",
  "Successfully backed up matching items from the IAP Jobs collection",
  "Successfully backed up matching items from the IAP Tasks collection",
  "Successfully deleted matching items from the IAP Jobs collection",
  "Successfully deleted matching items from the IAP Tasks collection",
  "Successfully backed up matching items from the IAP Jobs collection",
  "Successfully backed up matching items from the IAP Tasks collection",
  "Successfully deleted matching items from the IAP Jobs collection",
  "Successfully deleted matching items from the IAP Tasks collection",
  "No data found older than 14 days"
]
totalJobsnumberTotal number of archived jobs
50

Query Output

There are no query output examples for Archive Jobs and Tasks Collections - IAP.

Example Inputs and Outputs

Example 1

Input:

{
    "createArchiveCollections": true,
    "deleteCopiedDataFromCollections": true,
    "verbose": true,
    "copyMoveJobsDataToCollection": "job_archive",
    "copyMoveTasksDataToCollection": "tasks_archive",
    "copyMoveDataOlderThanDays": 14,
    "adapterId": "mongodb",
    "batchSize": 5
  } 

Output:

{
"message": [
    "Successfully backed up matching items from the IAP Jobs collection",
    "Successfully backed up matching items from the IAP Tasks collection",
    "Successfully deleted matching items from the IAP Jobs collection",
    "Successfully deleted matching items from the IAP Tasks collection",
    "Successfully backed up matching items from the IAP Jobs collection",
    "Successfully backed up matching items from the IAP Tasks collection",
    "Successfully deleted matching items from the IAP Jobs collection",
    "Successfully deleted matching items from the IAP Tasks collection",
    "Successfully backed up matching items from the IAP Jobs collection",
    "Successfully backed up matching items from the IAP Tasks collection",
    "Successfully deleted matching items from the IAP Jobs collection",
    "Successfully deleted matching items from the IAP Tasks collection",
    "No data found older than 14 days"
  ],
  "totalJobs": 35
} 

API Links

No API Links provided.

As Built Documentation - IAP

Workflow that creates a document in markdown format that includes each component of the pre-built, as well as the relationships between the components.

Capabilities include:

  • Automatically fills As-Built document with a Pre-Builts components and their relationship
  • Renders document in easily transferable markdown format
  • Fill in any remaining information using the optional provided template

Entry Point IAP Component

The primary IAP component to run As Built Documentation - IAP is listed below:

IAP Component NameIAP Component Type
As Built Documentation - IAPWorkflow

Inputs

The following table lists the inputs for As Built Documentation - IAP:

NameTypeRequiredDescriptionExample Value
prebuiltNamestringyesName of the prebuilt to create documentation for, including namespace.
@itentialopensource/cisco-asa-iag
fullTemplatebooleanyesWhether or not to include full As-Built template or just component relationships
false

Outputs

The following table lists the outputs for As Built Documentation - IAP:

NameTypeDescriptionExample Value
renderedTemplateobjectOutput containing markdown data
{
  "renderedTemplate": "\n# Artifacts\n\n## Workflows\n\n * Add ACL Rule - ASA - IAG
\n \n * Delete ACL Rule - ASA - IAG
\n \n * Software Upgrade - ASA - IAG
\n \n * Command Template Runner
\n Parent(s): \n * Software Upgrade - ASA - IAG (Workflow)\n \n * Configuration Change Jinja
\n Parent(s): \n * Software Upgrade - ASA - IAG (Workflow)\n \n\n\n\n***\n## Transformations\n\n * Build ACL Rule Add Data (id: 6234c9881678ea01c7fbcd3c)
\n Parent(s): \n * Add ACL Rule - ASA - IAG (Workflow)\n\n * Evaluate ACL Rule Result (id: 6234ddfb1678ea01c7fbcd3d)
\n Parent(s): \n * Add ACL Rule - ASA - IAG (Workflow)\n \n * Delete ACL Rule - ASA - IAG (Workflow)\n \n * Delete ACL Rule - ASA - IAG (Workflow)\n\n * Build ACL Rule Delete Data (id: 626a7ddb4ed12301aa080f2d)
\n Parent(s): \n * Delete ACL Rule - ASA - IAG (Workflow)\n\n * Software Upgrade - Cisco - ASA (id: 62a1edfe7b7b56017266d46b)
\n Parent(s): \n * Software Upgrade - ASA - IAG (Workflow)\n\n\n\n\n\n\n***\n## Templates\n\n * ASA - Set Boot Marker
\n Parent(s):\n\n\n\n\n***\n## Mop-Templates\n\n * ASA - Software Upgrade Checks
\n Parent(s):\n * ASA - Show Version
\n Parent(s):\n * ASA - File Verification
\n Parent(s):\n * ASA - Reload
\n Parent(s):\n\n\n\n\n***\n## Dependencies\n* @itential/app-workflow_engine\n* @itential/app-json_forms\n" }

Query Output

No object to query upon success

Example Inputs and Outputs

Example 1

Input:

{
  "prebuiltName": "@itentialopensource/cisco-asa-iag",
  "fullTemplate": false
} 

Output:

{
"renderedTemplate": {
    "renderedTemplate": "\n# Artifacts\n\n## Workflows\n\n * Add ACL Rule - ASA - IAG
\n \n * Delete ACL Rule - ASA - IAG
\n \n * Software Upgrade - ASA - IAG
\n \n * Command Template Runner
\n Parent(s): \n * Software Upgrade - ASA - IAG (Workflow)\n \n * Configuration Change Jinja
\n Parent(s): \n * Software Upgrade - ASA - IAG (Workflow)\n \n\n\n\n***\n## Transformations\n\n * Build ACL Rule Add Data (id: 6234c9881678ea01c7fbcd3c)
\n Parent(s): \n * Add ACL Rule - ASA - IAG (Workflow)\n\n * Evaluate ACL Rule Result (id: 6234ddfb1678ea01c7fbcd3d)
\n Parent(s): \n * Add ACL Rule - ASA - IAG (Workflow)\n \n * Delete ACL Rule - ASA - IAG (Workflow)\n \n * Delete ACL Rule - ASA - IAG (Workflow)\n\n * Build ACL Rule Delete Data (id: 626a7ddb4ed12301aa080f2d)
\n Parent(s): \n * Delete ACL Rule - ASA - IAG (Workflow)\n\n * Software Upgrade - Cisco - ASA (id: 62a1edfe7b7b56017266d46b)
\n Parent(s): \n * Software Upgrade - ASA - IAG (Workflow)\n\n\n\n\n\n\n***\n## Templates\n\n * ASA - Set Boot Marker
\n Parent(s):\n\n\n\n\n***\n## Mop-Templates\n\n * ASA - Software Upgrade Checks
\n Parent(s):\n * ASA - Show Version
\n Parent(s):\n * ASA - File Verification
\n Parent(s):\n * ASA - Reload
\n Parent(s):\n\n\n\n\n***\n## Dependencies\n* @itential/app-workflow_engine\n* @itential/app-json_forms\n" } }

API Links

No API Links provided.

Chunk Array For Loop - IAP

Workflow that splits large inputs into groups to be run in a child job loop

Capabilities include:

  • Splits large inputs into sub arrays of specified size
  • Passes split input to wrapper workflow in order to run main workflow
  • Provides wrapper template flow for user to input their actual workflow

Entry Point IAP Component

The primary IAP component to run Chunk Array For Loop - IAP is listed below:

IAP Component NameIAP Component Type
Chunk Array For Loop - IAPWorkflow

Inputs

The following table lists the inputs for Chunk Array For Loop - IAP:

NameTypeRequiredDescriptionExample Value
data_arrayarrayyesArray containing data to split for main workflow
[
  {
    "var": "loop 1"
  },
  {
    "var": "loop 2"
  },
  {
    "var": "loop 3"
  },
  {
    "var": "loop 4"
  },
  {
    "var": "loop 5"
  },
  {
    "var": "loop 6"
  }
]
chunkSizenumberyesSize of chunks to loop on in groups
3

Outputs

There are no outputs for Chunk Array For Loop - IAP.

Query Output

There are no query output examples for Chunk Array For Loop - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "data_array": [
    {
      "var": "loop 1"
    },
    {
      "var": "loop 2"
    },
    {
      "var": "loop 3"
    },
    {
      "var": "loop 4"
    },
    {
      "var": "loop 5"
    },
    {
      "var": "loop 6"
    }
  ],
  "chunkSize": 3
} 

API Links

No API Links provided.

Restore Archived Jobs and Tasks - IAP

Workflow that restores archived IAP Jobs and Tasks collections in MongoDB database.

Capabilities include:

  • Restore jobs from archive collection to jobs collection
  • Restore tasks from archive collection to tasks collection
  • Optionally drop the archive collections from the database

Entry Point IAP Component

The primary IAP component to run Restore Archived Jobs and Tasks - IAP is listed below:

IAP Component NameIAP Component Type
Restore Archived Jobs and Tasks - IAPWorkflow

Inputs

The following table lists the inputs for Restore Archived Jobs and Tasks - IAP:

NameTypeRequiredDescriptionExample Value
adapterIdstringyesName of MongoDB adapter to use
mongodb
deleteFromArchiveCollectionsbooleanyesWhether or not to drop archive collection after restore
true
numberOfArchivedCollectionsnumberyesNumber of collections containing archive data with the same name.
3
archiveJobsCollectionNamestringyesName of the collection containing archived jobs
job_archive_2024-02-06T19:18:20.079Z
archiveTasksCollectionNamestringyesName of the collection containing archived tasks
tasks_archive_2024-02-06T19:18:20.079Z

Outputs

There are no outputs for Restore Archived Jobs and Tasks - IAP.

Query Output

There are no query output examples for Restore Archived Jobs and Tasks - IAP.

Example Inputs and Outputs

Example 1

Input:

{
  "adapterId": "mongodb",
  "deleteFromArchiveCollections": true,
  "numberOfArchivedCollections": 7,
  "archiveJobsCollectionName": "job_archive_2024-02-06T19:18:20.079Z",
  "archiveTasksCollectionName": "tasks_archive_2024-02-06T19:18:20.079Z"
} 

API Links

No API Links provided.

Additional Information

Support

Please use your Itential Customer Success account if you need support when using this Workflow Project.