Managing the Lifecycle of a Service (IOS) - Lifecycle Manager (Part 1)
  • 18 Oct 2024
  • Dark
    Light
  • PDF

Managing the Lifecycle of a Service (IOS) - Lifecycle Manager (Part 1)

  • Dark
    Light
  • PDF

Article summary

We are ready to begin the Lifecycle Manager portion of the use-case where we will be exposing a service that configures and reserves a port in NetBox.  

Lifecycle Manager Video

Step 1

From the IAP Dashboard, select Lifecycle Manager.

Step 2 

From the Lifecycle Manager homepage, select Create Resource +.  

Step 3

Name the Resource Lab – LCM Port VLAN – XX and click Create.

Step 4

A service is defined by having a model.  The model defines characteristics of what the service looks like.  We want to include things such as device, interface, and description, but also include some of our inventory keys so that when we are ready to delete the resource, it will have those references.  

Step 5

On the Schema tab, replace the curly brackets within the properties key with the schema from the code block in this article and click Save.


{
    "autoApprove": {
        "type": "boolean"
    },
    "device": {
        "type": "string"
    },
    "type": {
        "type": "string"
    },
    "interface": {
        "type": "number"
    },
    "subInterface": {
        "type": "number"
    },
    "description": {
        "type": "string"
    },
    "ipAddress": {
        "type": "string"
    },
    "vlan": {
        "type": "number"
    },
    "subnetMask": {
        "type": "string"
    },
    "vlanNetboxID": {
        "type": "number"
    },
    "ipNetboxID": {
        "type": "number"
    }
}

Step 6

Now that we have a resource, we will associate Actions.  Select the Actions tab.

Step 7 

You’ll notice the resource already has three actions: Create, Update, and Delete.  We’ll start with Create.  Select Create.

Step 8 

The Create action will create a new instance.  Select + Workflow.  Notice there are options to select an existing workflow or to create a new workflow.   We would like to use a prebuilt workflow, so we will locate and select the Lab – LCM Port VLAN Create – XX workflow.  Click Save.

Step 9

Notice the validation note that appears.  We have the option to add JSTs before or after the execution of the workflow.   This is where we will map data from our resource model to our workflow and then from our workflow back to our resource model.  If the model and the workflow have the same inputs and outputs, JSTs are not needed, however we will more commonly find that the workflow will have different keys, which is why we will want to use JSTs.  

Step 10 

In our exercise, we do not need to transform the data from the model to the workflow, but we do need to transform the output of our workflow back into the model.  Select + JST for the post Transformation and then select + Create New.  The JST will open in a new tab.

Step 11

The incoming and outgoing schemas are pre-populated.  Map the Incoming Schema workflowOutputs to the instance Outgoing Schema by clicking the half circle to the right of the Incoming Schema and dragging a line to the half circle to the left of the Outgoing Schema.  Make the following connections.

  • autoApprove to autoApprove
  • device to device
  • type to type
  • interface to interface
  • description to description
  • reservedVLAN to subInterface
  • reservedVLAN to vlan
  • reservedIP to ipAddress
  • vlanID to vlanNetboxID
  • ipID to ipNetboxID
  • subnetMask to subnetMask

Step 12

When all connections have been made, click Save and then close the tab to return to Lifecycle Manager.

Step 13

The JST has been added and the Create action is complete. Navigate back to the Resource using the breadcrumb. Here you can see that the Create action was successfully updated.

Step 14

We would like to use the Create Action to create a new Instance, which is a discrete occurrence of a resource.  Select the Instances tab.

Step 15

From the Instances tab, select + New Instance.

Step 16

Name the instance lcm-port-vlan-XX.   Enter an optional description if desired and select the Create Action.

Step 17

Toggle the JSON View switch and paste the data from the code block in this article into the JSON body.  Optionally, you can modify the description. 

{
  "_id": "",
  "autoApprove": true,
  "device": "IOS",
  "type": "GigabitEthernet",
  "interface": 1,
  "description": "my interface"
}

Step 18

Click Save.  This runs the workflow associated with the Lifecycle Manager Create Action to instantiate your instance for the resource.  

Step 19

To view an audit of the action, click the ellipses to the right of the instance record and select View.

Step 20 

The History tab displays and shows that the instance is Running.  When the instance completes, the status will update to Complete.

Step 21

To view details of the instance, select the completed instance.   Here you can see that both the workflow and transformation successfully completed.  If you would like to view workflow details, select View Job and the workflow will open in a new Operations Manager tab.

Step 22

Here you can see that each task of the workflow successfully completed.  Review the workflow and then close the Operations Manager tab to return to Lifecycle Manager.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.