{
  "GlobalSettings": {
    "type": "dynamic",
    "separator": "_",
    "commonReplaceChars": "/",
    "commonURLHeaders": [
      ""
    ]
  },
  "vectors": [
    {
      "URL": "$BaseURL/v3/apps",
      "urlId": 1,
      "replaceParams": [
        {
          "param": "guid",
          "path": "$.resources[?(@.state == 'STARTED')].guid"
        },
	{
          "param": "appName",
          "path": "$.resources[?(@.state == 'STARTED')].name",
	  "mappedPeer": "guid"
        }
      ],
      "URLSetting": {
        "requestType": "get"
      }
    },
    {
      "URL": "$BaseURL/v3/apps/guid#1/tasks#appName#1",
      "urlId": 2,
	  "depURLIds": [
        1
      ],
      "path": [
	{
          "isPartOfHierarchy": true,
          "defName": "appName#1"
        },
	{
          "isPartOfHierarchy": true,
          "defName": "$SERVER"
        },
	{
          "isPartOfHierarchy": true,
          "query": "$.resources[*].name",
          "replaceVectorKey": "taskName"
        }
      ],
      "URLSetting": {
        "requestType": "get"
      },
      "metrics": [
        {
          "mPath": "$.resources[?(@.name == 'taskName')].",
          "attribute": [
            {
              "operation": "none",
              "name": "state",
              "index": 1,
              "type": 1,
              "dataFromPattern": {
                "value": true,
                "pattern": [
                  {
                    "pValue": "FAILED",
                    "updatedValue": 0,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "CANCELING",
                    "updatedValue": 1,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "PENDING",
                    "updatedValue": 2,
                    "useAsRegex": false
                  },
                  {
                    "pValue": "RUNNING",
                    "updatedValue": 3,
                    "useAsRegex": false
                  },
		  {
                    "pValue": "SUCCEEDED",
                    "updatedValue": 4,
                    "useAsRegex": false
                  }
                ]
              }
            },
            {
              "operation": "none",
              "name": "memory_in_mb",
              "index": 2,
              "type": 1
            },
            {
              "operation": "none",
              "name": "disk_in_mb",
              "index": 3,
              "type": 1
            }
          ]
        }
      ]
    }
  ]
}
