{
  "GlobalSettings": {
    "type": "dynamic"
  },
  "vectors": [
    {
      "URL": "$BaseURL.snowflakecomputing.com/api/v2/statements",
      "URLSetting": {
        "requestType": "post",
        "requestBody": "%7B%0A%20%20%22statement%22%3A%20%22SELECT%20ORGANIZATION_NAME%2C%20REGION%2C%20ACCOUNT_NAME%2C%20USAGE_TYPE%2C%20SUM(CASE%20WHEN%20LOWER(RATING_TYPE)%20%3D%20%27compute%27%20THEN%20USAGE%20ELSE%200%20END)%20AS%20usage_in_credits%2C%20SUM(CASE%20WHEN%20LOWER(RATING_TYPE)%20IN%20(%27transfer%27%2C%20%27storage%27)%20THEN%20USAGE%20ELSE%200%20END)%20AS%20usage_in_terabyte%2C%20SUM(USAGE_IN_CURRENCY)%20FROM%20SNOWFLAKE.ORGANIZATION_USAGE.USAGE_IN_CURRENCY_DAILY%20WHERE%20USAGE_DATE%20%3D%20DATEADD(day%2C%20-1%2C%20current_date)%20GROUP%20BY%20ORGANIZATION_NAME%2C%20REGION%2C%20ACCOUNT_NAME%2C%20USAGE_TYPE%3B%22%2C%0A%20%20%22timeout%22%3A%2060%2C%0A%20%20%22warehouse%22%3A%20%22COMPUTE_WH%22%0A%7D",
        "requestHeaders": [
          "Authorization:Bearer $AuthToken",
          "Accept:application/json",
          "Content-Type:application/json",
          "X-Snowflake-Authorization-Token-Type:KEYPAIR_JWT"
        ]
      },
      "metrics": [
        {
          "mPath": "$.data[*]",
          "attribute": [
            {
              "name": "[4]",
              "index": 1,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[5]",
              "index": 2,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[6]",
              "index": 3,
              "operation": "none",
              "type": 1
            }
          ]
        }
      ],
      "path": [
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][0]",
          "replaceVectorKey": "Organization_Name",
          "defName": "Unknown Organization"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][1]",
          "replaceVectorKey": "Region_Name",
          "defName": "Unknown Region"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][2]",
          "replaceVectorKey": "Account_Name",
          "defName": "Unknown Account"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][3]",
          "replaceVectorKey": "Usage_Type",
          "defName": "Unknown Usage_Type"
        }
      ]
    }
  ]
}
