Skip to main content
A newer release of this product is available.

Storage volumes volume.uuid top-metrics directories endpoint overview

Contributors

Overview

You can use this API to retrieve a list of directories with the greatest value performance metric or capacity metric for a specified volume. Use the top_metric parameter to specify which type of metric to filter for. This API is used to provide insight into IO metrics, namely iops, throughput, and non_recursive_bytes_used. This API only supports returning one metric per request.

Retrieve a list of the directories with the most IO activity

For a report on the directories with the most IO activity returned in descending order, specify the performance metric type you want to filter for by passing the iops or throughput property into the top_metric parameter. If the metric type is not specified, by default the API returns a list of the directories with the greatest number of the average read operations per second. The maximum number of directories returned by the API for a metric type is 25.

Retrieve a list of the largest directories

For a report on the largest directories returned in descending order, specify the capacity metric by passing the non_recursive_bytes_used property into the top_metric parameter. If the metric type is not specified, by default the API returns a list of directories with the greatest number of average read operations per second. The maximum number of directories returned by the API for a metric type is 25.

Failure to return list of directories with most IO activity

The API can sometimes fail to return the list of directories with the most IO activity, due to the following reasons:

– The volume does not have the activity tracking feature enabled.

– The volume does not have read/write traffic.

– The read traffic is served by the NFS/CIFS client filesystem cache.

– On rare occasions, the incoming traffic pattern is not suitable to obtain the list of directories with the most IO activity.

Failure to return list of largest directories

The API can sometimes fail to return the list of largest directories, due to the following reasons:

– The volume does not have file system analytics enabled.

– The volume's file system analytics database version doesn't support this report.

Failure to return the pathnames for the list of directories with most IO activity

The API can sometimes fail to obtain the filesystem pathnames for the list of directory entries, due to internal transient errors. In such cases, instead of the pathname, the API will return "{:" for every directory entry. You can get more information about the directory entry by invoking the GET on the below API using the above obtained fileid. "GET /api/storage/volumes/{}/files/{path}?inode_number="

Examples

Retrieving a list of the directories with the greatest average number of read operations per second

# The API:
GET /api/storage/volumes/{volume.uuid}/top-metrics/directories

# The Call:
curl -X GET "https://<mgmt-ip>/api/storage/volumes/{volume.uuid}/top-metrics/directories?top_metric=iops.read"

# The Response:
{
"records": [
  {
    "volume": {
      "name": "vol1",
    },
    "iops": {
      "read": 1495,
      "error": {
        "lower_bound": 1495,
        "upper_bound": 1505
      }
    },
    "path": "/dir1/dir2",
    "svm": {
      "uuid": "572361f3-e769-439d-9c04-2ba48a08ff43",
      "name": "vs1",
      "_links": {
        "self": {
          "href": "/api/svm/svms/572361f3-e769-439d-9c04-2ba48a08ff43"
        }
      }
    },
    "_links": {
      "directory": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir1%2Fdir2"
      },
      "metadata": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir1%2Fdir2?return_metadata=true"
      }
    }
  },
  {
    "volume": {
      "name": "vol1",
    },
    "iops": {
      "read": 1022,
      "error": {
        "lower_bound": 1022,
        "upper_bound": 1032
      }
    },
    "path": "/dir3/dir4",
    "svm": {
      "uuid": "572361f3-e769-439d-9c04-2ba48a08ff43",
      "name": "vs1",
      "_links": {
        "self": {
          "href": "/api/svm/svms/572361f3-e769-439d-9c04-2ba48a08ff43"
        }
      }
    },
    "_links": {
      "directory": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir3%2Fdir4"
      },
      "metadata": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir3%2Fdir4?return_metadata=true"
      }
    }
  },
  {
    "volume": {
      "uuid": "73b293df-e9d7-46cc-a9ce-2df8e52ef864",
      "name": "vol1",
      "_links": {
        "self": {
          "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864"
        }
      }
    },
    "iops": {
      "read": 345,
      "error": {
        "lower_bound": 345,
        "upper_bound": 355
      }
    },
    "path": "/dir12",
    "svm": {
      "uuid": "572361f3-e769-439d-9c04-2ba48a08ff43",
      "name": "vs1",
      "_links": {
        "self": {
          "href": "/api/svm/svms/572361f3-e769-439d-9c04-2ba48a08ff43"
        }
      }
    },
    "_links": {
      "directory": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir12"
      },
      "metadata": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir12?return_metadata=true"
      }
    }
  }
],
"num_records": 3,
"_links": {
  "self": {
    "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/top-metrics/directories?top_metric=iops.read"
  }
}
}

Retrieving a list of the directories with the most traffic with failure in obtaining the pathnames for the directories:

# The Call:
curl -X GET "https://<mgmt-ip>/api/storage/volumes/{volume.uuid}/top-metrics/directories?top_metric=throughput.write"

# The Response:
{
"records": [
  {
    "volume": {
      "name": "fv"
    },
    "throughput": {
      "write": 24,
      "error": {
        "lower_bound": 24,
        "upper_bound": 29
      }
    },
    "path": "{4ec6d1ea-d5da-11eb-a25f-005056ac0f77:1232}",
    "svm": {
      "uuid": "0ba74c3e-d5ca-11eb-8fbb-005056ac0f77",
      "name": "vs0",
      "_links": {
        "self": {
          "href": "/api/svm/svms/0ba74c3e-d5ca-11eb-8fbb-005056ac0f77"
        }
      }
    }
  },
  {
    "volume": {
      "name": "fv"
    },
    "throughput": {
      "write": 12,
      "error": {
        "lower_bound": 12,
        "upper_bound": 22
      }
    },
    "path": "{4ec6d1ea-d5da-11eb-a25f-005056ac0f77:6754}",
    "svm": {
      "uuid": "0ba74c3e-d5ca-11eb-8fbb-005056ac0f77",
      "name": "vs0",
      "_links": {
        "self": {
          "href": "/api/svm/svms/0ba74c3e-d5ca-11eb-8fbb-005056ac0f77"
        }
      }
    }
  },
  {
    "volume": {
      "name": "fv"
    },
    "throughput": {
      "write": 8,
      "error": {
        "lower_bound": 8,
        "upper_bound": 10
      }
    },
    "path": "{4ec6d1ea-d5da-11eb-a25f-005056ac0f77:8654}",
    "svm": {
      "uuid": "0ba74c3e-d5ca-11eb-8fbb-005056ac0f77",
      "name": "vs0",
      "_links": {
        "self": {
          "href": "/api/svm/svms/0ba74c3e-d5ca-11eb-8fbb-005056ac0f77"
        }
      }
    }
  }
],
"num_records": 3,
"_links": {
  "self": {
    "href": "/api/storage/volumes/4ec6d1ea-d5da-11eb-a25f-005056ac0f77/top-metrics/directories?top_metric=throughput.write"
  }
}
}

Retrieving a list of the largest directories

The following example shows how to retrieve a list of the largest directories based on the non-recursive bytes used by the contents of a directory.

# The API:
GET /api/storage/volumes/{volume.uuid}/top-metrics/directories

# The Call:
curl -X GET "https://<mgmt-ip>/api/storage/volumes/{volume.uuid}/top-metrics/directories?top_metric=non_recursive_bytes_used"

# The Response:
{
"records": [
  {
    "volume": {
      "name": "vol1"
    },
    "non_recursive_bytes_used": 345,
    "path": "/dir1/dir2",
    "svm": {
      "uuid": "572361f3-e769-439d-9c04-2ba48a08ff43",
      "name": "vs1",
      "_links": {
        "self": {
          "href": "/api/svm/svms/572361f3-e769-439d-9c04-2ba48a08ff43"
        }
      }
    },
    "_links": {
      "directory": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir1%2Fdir2"
      },
      "metadata": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir1%2Fdir2?return_metadata=true"
      }
    }
  },
  {
    "volume": {
      "name": "vol1"
    },
    "non_recursive_bytes_used": 345,
    "path": "/dir3/dir4",
    "svm": {
      "uuid": "572361f3-e769-439d-9c04-2ba48a08ff43",
      "name": "vs1",
      "_links": {
        "self": {
          "href": "/api/svm/svms/572361f3-e769-439d-9c04-2ba48a08ff43"
        }
      }
    },
    "_links": {
      "directory": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir3%2Fdir4"
      },
      "metadata": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir3%2Fdir4?return_metadata=true"
      }
    }
  },
  {
    "volume": {
      "name": "vol1"
    },
    "non_recursive_bytes_used": 345,
    "path": "/dir12",
    "svm": {
      "uuid": "572361f3-e769-439d-9c04-2ba48a08ff43",
      "name": "vs1",
      "_links": {
        "self": {
          "href": "/api/svm/svms/572361f3-e769-439d-9c04-2ba48a08ff43"
        }
      }
    },
    "_links": {
      "directory": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir12"
      },
      "metadata": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir12?return_metadata=true"
      }
    }
  }
],
"num_records": 3,
"_links": {
  "self": {
    "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/top-metrics/directories?top_metric=non_recursive_bytes_used"
  }
}
}

Retrieving a list of the largest directories where incomplete data is reported

The following example retrieves a list of the largest directories when partial data is returned.

# The API:
GET /api/storage/volumes/{volume.uuid}/top-metrics/directories

# The Call:
curl -X GET "https://<mgmt-ip>/api/storage/volumes/{volume.uuid}/top-metrics/directories?top_metric=non_recursive_bytes_used"

# The Response:
{
"records": [
  {
    "volume": {
      "name": "vol1"
    },
    "non_recursive_bytes_used": 1022,
    "path": "/dir1/dir2",
    "svm": {
      "uuid": "572361f3-e769-439d-9c04-2ba48a08ff43",
      "name": "vs1",
      "_links": {
        "self": {
          "href": "/api/svm/svms/572361f3-e769-439d-9c04-2ba48a08ff43"
        }
      }
    },
    "_links": {
      "directory": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir1%2Fdir2"
      },
      "metadata": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir1%2Fdir2?return_metadata=true"
      }
    }
  },
  {
    "volume": {
      "name": "vol1"
    },
    "non_recursive_bytes_used": 261,
    "path": "/dir12",
    "svm": {
      "uuid": "572361f3-e769-439d-9c04-2ba48a08ff43",
      "name": "vs1",
      "_links": {
        "self": {
          "href": "/api/svm/svms/572361f3-e769-439d-9c04-2ba48a08ff43"
        }
      }
    },
    "_links": {
      "directory": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir12"
      },
      "metadata": {
        "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/files/dir12?return_metadata=true"
      }
    }
  }
],
"num_records": 2,
"incomplete_response_reason": {
  "message": "Partial data has been returned for this metric report. Reason: Data collection for the large directory report is in progress.",
  "code": "111411234",
  "arguments": [
    {
      "message": "Data collection for the large directory report is in progress."
    }
  ]
},
"_links": {
  "self": {
    "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/top-metrics/directories?top_metric=non_recursive_bytes_used"
  }
}
}

Retrieving a list of the largest directories when the file system analytics database version doesn't support this report

The following example shows the behavior of the API when the file system analytics database version doesn't support the large directory report.

# The API:
GET /api/storage/volumes/{volume.uuid}/top-metrics/directories

# The Call:
curl -X GET "https://<mgmt-ip>/api/storage/volumes/{volume.uuid}/top-metrics/directories?top_metric=non_recursive_bytes_used"

# The Response:
{
"records": [
],
"num_records": 0,
"_links": {
  "self": {
    "href": "/api/storage/volumes/73b293df-e9d7-46cc-a9ce-2df8e52ef864/top-metrics/directories?top_metric=non_recursive_bytes_used"
  }
},
"error": {
  "message": "The large directory report for volume \"FV\" in Vserver \"vs0\" is not available because the file system analytics database version doesn't support this report. Use the \"volume analytics off\" command to disable analytics on the volume, then use the \"volume analytics on\" command to re-enable analytics.",
  "code": "124519410"
}
}

Example showing the behavior of the API when there is no read/write traffic:

# The Call:
curl -X GET "https://<mgmt-ip>/api/storage/volumes/{volume.uuid}/top-metrics/directories?top_metric=throughput.write"

# The Response:
{
"records": [
],
"num_records": 0,
"notice": {
  "message": "The activity tracking report for volume \"FV\" in SVM \"vs0\" returned zero records. Check whether the volume have read/write traffic. Refer to the REST API documentation for more information on why there might be no records.",
  "code": "124518418"
},
"_links": {
  "self": {
    "href": "/api/storage/volumes/9af63729-8ac8-11ec-b1bc-005056a79da4/top-metrics/directories?top_metric=throughput.write"
  }
}
}