Skip to content

Conversation

@farhan10
Copy link

@farhan10 farhan10 commented Oct 8, 2025

"id": "ConfigureVPN-1.0",
"name": "Configure VPN",
"start": "CreateVPN",
"states": [
  {
    "name": "CreateVPN",
    "type": "operation",
    "actions": [
      {
        "name": "CreateVPN",
        "functionRef": {
          "refName": "NSO.RestconfPost",
          "arguments": {
            "input": {
              "data": "{\"l3vpn\":[{\"name\":\"${ .vpn.name }\",\"route-distinguisher\":\"${ .vpn.rd }\"}]} ",
              "path": "restconf/data/l3vpn:vpn"
            },
            "config": {
              "resourceId": "${ .nsoResource }"
            }
          }
        },
        "actionDataFilter": {
          "results": "${ if (.status) then .status else null end }",
          "toStateData": "${ .createServiceResult }"
        }
      }
    ],
    "transition": {
      "nextState": "ConfigureEndpoints"
    }
  },
  {
    "end": true,
    "name": "ConfigureEndpoints",
    "type": "foreach",
    "actions": [
      {
        "name": "ConfigureEndpoint",
        "functionRef": {
          "refName": "NSO.RestconfPost",
          "arguments": {
            "input": {
              "data": "${ {endpoint: { id: .endpoint.name, \"ce-device\": .endpoint.ce, \"ce-interface\": .endpoint.int, \"ip-network\": .endpoint.ip ,bandwidth: .endpoint.bw }}}",
              "path": "restconf/data/l3vpn:vpn/l3vpn=${.vpn.name}"
            },
            "config": {
              "resourceId": "${ .nsoResource }"
            }
          }
        },
        "actionDataFilter": {
          "results": "${ if .status then .status else null end }",
          "toStateData": "${ .createServiceResult }"
        }
      }
    ],
    "iterationParam": "endpoint",
    "inputCollection": "${ .endpoints }",
    "outputCollection": "${ .endpointsConfigureResponses }"
  }
],
"version": "1.0",
"functions": [
  {
    "name": "NSO.RestconfPost",
    "operation": "cisco.nso.v1.0.2.restconf.Post"
  }
],
"description": "",
"specVersion": "0.8"

}

{
    "id": "ConfigureVPN-1.0",
    "name": "Configure VPN",
    "start": "CreateVPN",
    "states": [
      {
        "name": "CreateVPN",
        "type": "operation",
        "actions": [
          {
            "name": "CreateVPN",
            "functionRef": {
              "refName": "NSO.RestconfPost",
              "arguments": {
                "input": {
                  "data": "{\"l3vpn\":[{\"name\":\"${ .vpn.name }\",\"route-distinguisher\":\"${ .vpn.rd }\"}]} ",
                  "path": "restconf/data/l3vpn:vpn"
                },
                "config": {
                  "resourceId": "${ .nsoResource }"
                }
              }
            },
            "actionDataFilter": {
              "results": "${ if (.status) then .status else null end }",
              "toStateData": "${ .createServiceResult }"
            }
          }
        ],
        "transition": {
          "nextState": "ConfigureEndpoints"
        }
      },
      {
        "end": true,
        "name": "ConfigureEndpoints",
        "type": "foreach",
        "actions": [
          {
            "name": "ConfigureEndpoint",
            "functionRef": {
              "refName": "NSO.RestconfPost",
              "arguments": {
                "input": {
                  "data": "${ {endpoint: { id: .endpoint.name, \"ce-device\": .endpoint.ce, \"ce-interface\": .endpoint.int, \"ip-network\": .endpoint.ip ,bandwidth: .endpoint.bw }}}",
                  "path": "restconf/data/l3vpn:vpn/l3vpn=${.vpn.name}"
                },
                "config": {
                  "resourceId": "${ .nsoResource }"
                }
              }
            },
            "actionDataFilter": {
              "results": "${ if .status then .status else null end }",
              "toStateData": "${ .createServiceResult }"
            }
          }
        ],
        "iterationParam": "endpoint",
        "inputCollection": "${ .endpoints }",
        "outputCollection": "${ .endpointsConfigureResponses }"
      }
    ],
    "version": "1.0",
    "functions": [
      {
        "name": "NSO.RestconfPost",
        "operation": "cisco.nso.v1.0.2.restconf.Post"
      }
    ],
    "description": "",
    "specVersion": "0.8"
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant