From b5ac50f8475f361e900803234c7928457ec45a0e Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Tue, 7 Jul 2026 16:49:09 -0500 Subject: [PATCH 1/2] Fixed a bug in get_latency_configuration when there are no volume level latency configurations. Also, renamed it 'list_eda_latency_config'. Also, renamed 'list_latency_events' to 'list_eda_latency_events'. --- Management-Utilities/Workload-Factory-API-Samples/README.md | 4 ++-- .../{get_latency_configuration => list_eda_latency_config} | 3 +++ .../{list_latency_events => list_eda_latency_events} | 0 3 files changed, 5 insertions(+), 2 deletions(-) rename Management-Utilities/Workload-Factory-API-Samples/{get_latency_configuration => list_eda_latency_config} (98%) rename Management-Utilities/Workload-Factory-API-Samples/{list_latency_events => list_eda_latency_events} (100%) diff --git a/Management-Utilities/Workload-Factory-API-Samples/README.md b/Management-Utilities/Workload-Factory-API-Samples/README.md index b5dda71..8a64ea2 100644 --- a/Management-Utilities/Workload-Factory-API-Samples/README.md +++ b/Management-Utilities/Workload-Factory-API-Samples/README.md @@ -54,7 +54,6 @@ If you do create a new script, please consider contributing it back to this repo | [eda_project_config_create](eda_project_config_create) | This creates a new EDA project configuration. | | [eda_project_config_delete](eda_project_config_delete) | This deletes a EDA project configuration. | | [fsxn_credentials_set](fsxn_credentials_set) | This sets the credentials for a specified FSx for ONTAP file system. | -| [get_latency_configuration](get_latency_configuration) | Get the latency configuration for the BlueXP account. | | [get_latency_metrics](get_latency_metrics) | Get the specific details of a latency event. | | [link_associate](link_associate) | This associates a Workload Factory Link with a specified FSx for ONTAP file system. | | [link_delete](link_delete) | This deletes a Workload Factory Link. | @@ -68,9 +67,10 @@ If you do create a new script, please consider contributing it back to this repo | [list_cicd_clones](list_cicd_clones) | This lists all the clones that you have access to in the specified CI/CD project. | | [list_cicd_projects](list_cicd_projects) | This lists all the CI/CD projects that you have access to. | | [list_credentials](list_credentials) | This lists all the Workload Factory credentials that you have access to. | +| [list_eda_latency_config](list_eda_latency_config) | Get the latency configuration for the BlueXP account. | | [list_eda_project_config](list_eda_project_config) | This lists the EDA project configuration. | | [list_filesystems](list_filesystems) | This lists all the FSx for ONTAP file systems that you have access to in the specified AWS region. | -| [list_latency_events](list_latency_events) | This lists all the latnecy events associated with the BlueXP account. | +| [list_eda_latency_events](list_eda_latency_events) | This lists all the latnecy events associated with the BlueXP account. | | [list_links](list_links) | This lists all the Workload Factory Links that you have access to. | | [list_snapmirrors](list_snapmirrors) | This lists all the SnapMirror relationships that are associated with the specified file system. | | [list_snapshots](list_snapshots) | This lists all the snapshots that are associated with the specified volumes. | diff --git a/Management-Utilities/Workload-Factory-API-Samples/get_latency_configuration b/Management-Utilities/Workload-Factory-API-Samples/list_eda_latency_config similarity index 98% rename from Management-Utilities/Workload-Factory-API-Samples/get_latency_configuration rename to Management-Utilities/Workload-Factory-API-Samples/list_eda_latency_config index 5cd3b5d..3d18556 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/get_latency_configuration +++ b/Management-Utilities/Workload-Factory-API-Samples/list_eda_latency_config @@ -126,6 +126,9 @@ echo "Default Latency Configuration:" sort -f $tmpout2 | column -s, -t -R 4,5,6,7 -N "Account ID,Created By,Status,Warning Read Threshold,Warning Write Threshold,Critical Read Threshold,Critical Write Threshold" # # Now get the latency configuration for each volume. +if [ $(jq -r '.config.filesystems | length' $tmpout) == "0" ]; then + exit +fi jq_query='.config.filesystems | to_entries | .[] | .key + " " + (.value | to_entries | .[] | .key + " " + (.value.warning.readLatency.latencyThresholdMs | tostring) + " " + (.value.warning.writeLatency.latencyThresholdMs | tostring) + " " + (.value.critical.readLatency.latencyThresholdMs | tostring) + " " + (.value.critical.writeLatency.latencyThresholdMs | tostring) + " ")' if jq -r "$jq_query" $tmpout > $tmpout2 2> $tmperr; then : diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_latency_events b/Management-Utilities/Workload-Factory-API-Samples/list_eda_latency_events similarity index 100% rename from Management-Utilities/Workload-Factory-API-Samples/list_latency_events rename to Management-Utilities/Workload-Factory-API-Samples/list_eda_latency_events From 7b737c55f9b708b0168f5b31152960e1d1d5d23b Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Mon, 13 Jul 2026 09:54:29 -0500 Subject: [PATCH 2/2] Added support for the -j option, and fixed a bug if the credentials was null. --- .../list_credentials | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_credentials b/Management-Utilities/Workload-Factory-API-Samples/list_credentials index c798139..6a0844d 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_credentials +++ b/Management-Utilities/Workload-Factory-API-Samples/list_credentials @@ -16,7 +16,7 @@ usage() { cat >&2 < $tmpout2 2> $tmperr; then - : +if [ $raw == "true" ]; then + cat $tmpout else - echo "Failed to parse the output from the API." - cat $tmperr >&2 - exit 1 + if jq -r "$jq_query" $tmpout > $tmpout2 2> $tmperr; then + : + else + echo "Failed to parse the output from the API." + cat $tmperr >&2 + exit 1 + fi fi # # Check to see if there are more. nextToken=$(jq -r '.nextToken' $tmpout) while [ "$nextToken" != "null" ]; do run_curl GET "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/credentials/v1/credentials?nextToken=$nextToken" $tmpout $tmperr - if jq -r "$jq_query" $tmpout >> $tmpout2 2> $tmperr; then - : + if [ $raw == "true" ]; then + cat $tmpout else - echo "Failed to parse the output from the API." - cat $tmperr >&2 - exit 1 + if jq -r "$jq_query" $tmpout >> $tmpout2 2> $tmperr; then + : + else + echo "Failed to parse the output from the API." + cat $tmperr >&2 + exit 1 + fi fi nextToken=$(jq -r '.nextToken' $tmpout) done -sort -f -k 2,2 -k 1,1 $tmpout2 | column -t -N "Name,Type,Account,ID,Number Associated Resources" +if [ $raw != "true" ]; then + sort -f -k 2,2 -k 1,1 $tmpout2 | column -t -N "Name,Type,Account,ID,Number Associated Resources" +fi