From b5ac50f8475f361e900803234c7928457ec45a0e Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Tue, 7 Jul 2026 16:49:09 -0500 Subject: [PATCH 1/8] 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/8] 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 From 8714765b9c60fd3af8564f948ed1d71418338cc7 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Wed, 22 Jul 2026 10:36:45 -0500 Subject: [PATCH 3/8] Fixed a typo --- Management-Utilities/Workload-Factory-API-Samples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/README.md b/Management-Utilities/Workload-Factory-API-Samples/README.md index 8a64ea2..1884c8a 100644 --- a/Management-Utilities/Workload-Factory-API-Samples/README.md +++ b/Management-Utilities/Workload-Factory-API-Samples/README.md @@ -70,7 +70,7 @@ If you do create a new script, please consider contributing it back to this repo | [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_eda_latency_events](list_eda_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 latency 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. | From 594a112672661188bc273f21e391467b10b5882d Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Wed, 22 Jul 2026 10:37:21 -0500 Subject: [PATCH 4/8] Made it where the -j option would attempt to format the output. --- .../Workload-Factory-API-Samples/list_credentials | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_credentials b/Management-Utilities/Workload-Factory-API-Samples/list_credentials index 6a0844d..4f86c98 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_credentials +++ b/Management-Utilities/Workload-Factory-API-Samples/list_credentials @@ -100,7 +100,11 @@ jq_query='.items[] | if(.type == "ONTAP") then "\(if(.metadata.fileSystemId != n run_curl GET "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/credentials/v1/credentials?$filter" $tmpout $tmperr if [ $raw == "true" ]; then - cat $tmpout + if jq -r . $tmpout 2>&1 > /dev/null ; then + : + else + cat $tmpout + fi else if jq -r "$jq_query" $tmpout > $tmpout2 2> $tmperr; then : @@ -116,7 +120,11 @@ 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 [ $raw == "true" ]; then - cat $tmpout + if jq -r . $tmpout 2>&1 > /dev/null ; then + : + else + cat $tmpout + fi else if jq -r "$jq_query" $tmpout >> $tmpout2 2> $tmperr; then : From 7c8b21de842231c758f946a61768d11809535fe4 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 30 Jul 2026 15:46:46 -0500 Subject: [PATCH 5/8] Added support for SVM Configuration Replication --- .../snapmirror_create | 108 ++++++++++++------ 1 file changed, 76 insertions(+), 32 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create b/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create index 984cf8e..495ebf8 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create +++ b/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create @@ -17,9 +17,9 @@ usage() { cat >&2 <&2 usage ;; esac + case "$DESTINATION_TYPE" in - "FSx") DESTINATION_TYPE="FileSystem" ;; - "on-prem") DESTINATION_TYPE="OnPrem" ;; + "FSx") + DESTINATION_TYPE="FileSystem" + if [ -z "$DESTINATION_AWS_REGION" ]; then + echo "Error: the destination AWS region is required if the destination type isn't on-prem." + usage + fi + DESTINATION_REGION='"region":"'$DESTINATION_AWS_REGION'",' + ;; + "on-prem") + DESTINATION_TYPE="OnPrem" + DESTINATION_REGION="" + ;; *) echo "Error: Invalid destination type '$DESTINATION_TYPE'. Must be either 'FSx' or 'on-prem'." >&2 usage ;; esac + +if [ -z "$DESTINATION_VOLUME" ]; then + DESTINATION_VOLUME="${SOURCE_VOLUME}_copy" +fi # # Check that the required commands are available. for cmd in jq curl; do @@ -176,13 +203,24 @@ if [ -z "$token" ]; then exit 1 fi +if [ "$SVMDR" == "false" ]; then + if [ -z "$DESTINATION_SVM_ID" -o -z "$DESTINATION_SVM_NAME" ]; then + echo "Error: The destination SVM ID and destination SVM name are required if not using the -x option." >&2 + usage + fi + DESTINATION_SVM='"svm":{"id":"'${DESTINATION_SVM_ID}'","name":"'${DESTINATION_SVM_NAME}'"},' +else + DESTINATION_SVM="" +fi + +set -x run_curl POST "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/fsx/v2/replication" \ $tmpout $tmperr \ '{"source": { "type":"'${SOURCE_TYPE}'", "id":"'${SOURCE_FS_ID}'", "credentialsId":"'${SOURCE_CREDENTIALS_ID}'", - "region":"'${SOURCE_AWS_REGION}'", + '${SOURCE_REGION}' "volumes": [ { "name":"'${SOURCE_VOLUME}'", @@ -195,9 +233,15 @@ run_curl POST "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOU "type":"'${DESTINATION_TYPE}'", "id":"'${DESTINATION_FS_ID}'", "credentialsId":"'${DESTINATION_CREDENTIALS_ID}'", - "region":"'${DESTINATION_AWS_REGION}'", - "svm": {"id":"'${DESTINATION_SVM_ID}'", "name":"'${DESTINATION_SVM_NAME}'"}, - "volume": {"tieringPolicy": {"coolingPeriod": 2, "name": "AUTO"}} + '$DESTINATION_REGION' + '$DESTINATION_SVM' + "volume": { + "useSourceVolumeTieringPolicy":true, + "name":"'${DESTINATION_VOLUME}'" + } + }, + "svmConfiguration":{ + "replicateSvmConfiguration":'${SVMDR}' }, "throttle":'${THROTTLE}', "schedule": "'${SCHEDULE}'" From 12f21320c127bb145c4bcdfb2f5de9b4aa5b2a84 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 30 Jul 2026 15:48:29 -0500 Subject: [PATCH 6/8] Fixed some inconsistencies with variables names. --- .../bluexp_fsxn_discovery | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery b/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery index d7e5970..c22b78b 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery +++ b/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery @@ -10,7 +10,7 @@ ################################################################################ usage () { cat 1>&2 < export BLUEXP_BLUE_ACCOUNT_ID= export CREDENTIALS_ID= - export AWS_AWS_REGION= + export AWS_REGION= export USERNAME= export PASSWORD= From e1774709112226f3da9bd601d1d80b58e4e83fd4 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 30 Jul 2026 16:06:53 -0500 Subject: [PATCH 7/8] Added support for SVM Configuration Replication --- .../Workload-Factory-API-Samples/snapmirror_create | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create b/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create index 495ebf8..74f437b 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create +++ b/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create @@ -154,7 +154,7 @@ check_required_options case "$SOURCE_TYPE" in "FSx") SOURCE_TYPE="FileSystem" - if [ -z "$SOURCE_AWS_REGION"]; then + if [ -z "$SOURCE_AWS_REGION" ]; then echo "Error: the source AWS region is required if the source type isn't on-prem." usage fi From 18a473de6c72cc9aaac88364a9d2cb6479e8c01c Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 30 Jul 2026 16:16:12 -0500 Subject: [PATCH 8/8] Added support for SVM Configuration Replication --- .../Workload-Factory-API-Samples/snapmirror_create | 1 - 1 file changed, 1 deletion(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create b/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create index 74f437b..dd55cf7 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create +++ b/Management-Utilities/Workload-Factory-API-Samples/snapmirror_create @@ -213,7 +213,6 @@ else DESTINATION_SVM="" fi -set -x run_curl POST "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/fsx/v2/replication" \ $tmpout $tmperr \ '{"source": {