From 05b46c9ed6358c2955e62680a56ed7806daacf83 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 16 Apr 2026 08:19:52 -0500 Subject: [PATCH 01/11] Updated a help message. --- .../Workload-Factory-API-Samples/bluexp_fsxn_discovery | 2 +- .../Workload-Factory-API-Samples/fsxn_credentials_set | 2 +- .../Workload-Factory-API-Samples/link_associate | 2 +- .../Workload-Factory-API-Samples/link_disassociate | 2 +- .../Workload-Factory-API-Samples/list_filesystems | 2 +- .../Workload-Factory-API-Samples/list_snapmirrors | 2 +- Management-Utilities/Workload-Factory-API-Samples/list_svms | 2 +- Management-Utilities/Workload-Factory-API-Samples/list_volumes | 2 +- .../Workload-Factory-API-Samples/snapshot_create | 2 +- Management-Utilities/Workload-Factory-API-Samples/volume_clone | 2 +- Management-Utilities/Workload-Factory-API-Samples/volume_delete | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery b/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery index 0a167baf..939cdb23 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery +++ b/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery @@ -100,7 +100,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh token is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/fsxn_credentials_set b/Management-Utilities/Workload-Factory-API-Samples/fsxn_credentials_set index 68ee5b1a..e7c2300a 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/fsxn_credentials_set +++ b/Management-Utilities/Workload-Factory-API-Samples/fsxn_credentials_set @@ -96,7 +96,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/link_associate b/Management-Utilities/Workload-Factory-API-Samples/link_associate index 9bc8c6f3..ef546c35 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/link_associate +++ b/Management-Utilities/Workload-Factory-API-Samples/link_associate @@ -83,7 +83,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/link_disassociate b/Management-Utilities/Workload-Factory-API-Samples/link_disassociate index 2bf73bea..f1f8061c 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/link_disassociate +++ b/Management-Utilities/Workload-Factory-API-Samples/link_disassociate @@ -83,7 +83,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_filesystems b/Management-Utilities/Workload-Factory-API-Samples/list_filesystems index 3dbb0b3a..95ab48f0 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_filesystems +++ b/Management-Utilities/Workload-Factory-API-Samples/list_filesystems @@ -84,7 +84,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to use to list the file systems is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_snapmirrors b/Management-Utilities/Workload-Factory-API-Samples/list_snapmirrors index 97ed5808..d4e2beb1 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_snapmirrors +++ b/Management-Utilities/Workload-Factory-API-Samples/list_snapmirrors @@ -85,7 +85,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_svms b/Management-Utilities/Workload-Factory-API-Samples/list_svms index 72a09642..fd2e00aa 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_svms +++ b/Management-Utilities/Workload-Factory-API-Samples/list_svms @@ -83,7 +83,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_volumes b/Management-Utilities/Workload-Factory-API-Samples/list_volumes index 403ed8dc..40115ed9 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_volumes +++ b/Management-Utilities/Workload-Factory-API-Samples/list_volumes @@ -85,7 +85,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/snapshot_create b/Management-Utilities/Workload-Factory-API-Samples/snapshot_create index 1a0b510d..6c5cbd6f 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/snapshot_create +++ b/Management-Utilities/Workload-Factory-API-Samples/snapshot_create @@ -86,7 +86,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/volume_clone b/Management-Utilities/Workload-Factory-API-Samples/volume_clone index 94524dda..c11a61d9 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/volume_clone +++ b/Management-Utilities/Workload-Factory-API-Samples/volume_clone @@ -87,7 +87,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/volume_delete b/Management-Utilities/Workload-Factory-API-Samples/volume_delete index a423db66..edf864f2 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/volume_delete +++ b/Management-Utilities/Workload-Factory-API-Samples/volume_delete @@ -88,7 +88,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The ID of the credentials to delete is required. +required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' From 757ab621bc248ce6c0ac49e5ec3e297b6dcc5737 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 16 Apr 2026 08:20:44 -0500 Subject: [PATCH 02/11] Added route table and endpoint support. --- .../create_fsxn_filesystem | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem index 3aca0ea1..927638e1 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem @@ -20,12 +20,13 @@ ################################################################################ usage () { cat 1>&2 < $tmpout 2>&1 @@ -240,7 +251,7 @@ else if [ $waitForCompletion == "true" ]; then i=0 while [ $i -lt $MaxIterations ]; do - aws fsx describe-file-systems --file-system-ids $fsid --output=json --region=$region > $tmpout 2>&1 + aws fsx describe-file-systems $endpoint_url --file-system-ids $fsid --output=json --region=$region > $tmpout 2>&1 if [ $? -eq 0 ]; then status=$(jq -r '.FileSystems[0].Lifecycle' $tmpout 2> /dev/null) if [ "$status" == "AVAILABLE" ]; then From bf086a79dd66a05d1be0515cc07d2491afaa5f65 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 16 Apr 2026 08:22:09 -0500 Subject: [PATCH 03/11] Added CI/CD and EDA Project APIs samples. --- .../cicd_clones_create | 127 ++++++++++++++ .../cicd_clones_delete | 115 +++++++++++++ .../cicd_project_create | 135 +++++++++++++++ .../cicd_project_delete | 116 +++++++++++++ .../eda_project_config_create | 156 ++++++++++++++++++ .../eda_project_config_delete | 107 ++++++++++++ .../list_cicd_clones | 143 ++++++++++++++++ .../list_cicd_projects | 137 +++++++++++++++ .../list_eda_project_config | 124 ++++++++++++++ 9 files changed, 1160 insertions(+) create mode 100755 Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create create mode 100755 Management-Utilities/Workload-Factory-API-Samples/cicd_clones_delete create mode 100755 Management-Utilities/Workload-Factory-API-Samples/cicd_project_create create mode 100755 Management-Utilities/Workload-Factory-API-Samples/cicd_project_delete create mode 100755 Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create create mode 100755 Management-Utilities/Workload-Factory-API-Samples/eda_project_config_delete create mode 100755 Management-Utilities/Workload-Factory-API-Samples/list_cicd_clones create mode 100755 Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects create mode 100755 Management-Utilities/Workload-Factory-API-Samples/list_eda_project_config diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create new file mode 100755 index 00000000..27263987 --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create @@ -0,0 +1,127 @@ +#!/bin/bash +# +################################################################################ +# This script is used to delete a EDA CI/CD clone. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmpout2=$(mktemp /tmp/list_volumes-out2.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmpout2 $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 < /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi +body='{ + "cloneName": "'$CLONE_NAME'", + '$snapshot_name' + "parentVolumeId": "'$VOLUME_ID'" +}' + +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/projects/${PROJECT_ID}/operations/clone" +run_curl POST "$token" "$URL" $tmpout $tmperr "$body" +echo "The CI/CD clone $CLONE_NAME was created and is mountable at $(jq -r '.mountPoints[0].mountPoint' $tmpout)." diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_delete b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_delete new file mode 100755 index 00000000..fe2d4892 --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_delete @@ -0,0 +1,115 @@ +#!/bin/bash +# +################################################################################ +# This script is used to delete a EDA CI/CD clone. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmpout2=$(mktemp /tmp/list_volumes-out2.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmpout2 $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 < /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi + +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/projects/${PROJECT_ID}/operations/clones/${CLONE_VOLUME_ID}" +run_curl DELETE "$token" "$URL" $tmpout $tmperr +echo "The CI/CD clone $CLONE_VOLUME_ID was deleted." diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create new file mode 100755 index 00000000..b266c642 --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create @@ -0,0 +1,135 @@ +#!/bin/bash +# +################################################################################ +# This script is used to create a EDA CI/CD project. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmpout2=$(mktemp /tmp/list_volumes-out2.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmpout2 $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 < /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi + +body='{ + "name": "'$PROJECT_NAME'", + "credentials_id": "'$CREDENTIALS_ID'", + "volumes": [ + { + "id": "'$VOLUME_ID'", + "region": "'$REGION'", + "fileSystemId": "'$FILESYSTEM_ID'", + "credentialsId": "'$CREDENTIALS_ID'" + } + ], + "operationPolicy": { + "max_clone_number": 0, + "max_clone_size": 0, + "max_days_retention": 0 + } +}' + +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/projects" +run_curl POST "$token" "$URL" $tmpout $tmperr "$body" +echo "return status=$?" +echo "Project $PROJECT_NAME has been created." diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_project_delete b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_delete new file mode 100755 index 00000000..f7d9e1a0 --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_delete @@ -0,0 +1,116 @@ +#!/bin/bash +# +################################################################################ +# This script is used to delete a EDA CI/CD project. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmpout2=$(mktemp /tmp/list_volumes-out2.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmpout2 $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 < /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi + +if [ "$raw" = true ]; then + jq_query='.' +else + jq_query='.items[] | "\(.projectName) \(.fileSystemId) \(.volumeName) \(.numberOfClones)"' +fi + +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/projects/$projectId" +run_curl DELETE "$token" "$URL" $tmpout $tmperr +echo "Project with ID $projectId has been deleted." diff --git a/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create new file mode 100755 index 00000000..fb7f321b --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create @@ -0,0 +1,156 @@ +#!/bin/bash +# +################################################################################ +# This script is used to create the EDA Project filter user has access to. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmpout2=$(mktemp /tmp/list_volumes-out2.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmpout2 $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 <&2 + usage +else + if [ ${#filter_types[@]} -gt 0 -a ${#tags[@]} -ne ${#filter_types[@]} ]; then + echo "Error: If you specify the filter types, you must specify a filter type for all the tags." >&2 + usage + fi +fi +# +# Check that the required commands are available. +for cmd in jq curl; do + if ! command -v $cmd &> /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi + +body='{ "filters": [ { "tags": [ ' +i=0 +while [ $i -lt ${#tags[@]} ]; do + filter_type="multiselect" + if [ ${#filter_types[@]} -gt 0 ]; then + filter_type="${filter_types[$i]}" + if [ $filter_type != "single" -a $filter_type != "multiselect" ]; then + echo "Error: Invalid filter type '$filter_type' for tag '${tags[$i]}'. Filter type must be either 'single' or 'multiselect'." >&2 + usage + fi + fi + body+='{ + "key": "'${tags[$i]}'", + "label": "'${tags[$i]}'", + "type": "'$filter_type'", + "target": "tag" + }' + let i=i+1 + if [ $i -lt ${#tags[@]} ]; then + body+=',' + fi +done +body+='], "resourceProps": [ { + "propName": "OntapVolumeType", + "label": "Volume Type", + "type": "single" } + ] } ], + "status": "active" }' + +echo "body: $body" +exit 0 +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/configure" +run_curl POST "$token" "$URL" $tmpout $tmperr "$body" + +echo "output" +cat $tmpout +echo "error" +cat $tmperr diff --git a/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_delete b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_delete new file mode 100755 index 00000000..968fa732 --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_delete @@ -0,0 +1,107 @@ +#!/bin/bash +# +################################################################################ +# This script is used to delete the EDA Project filter user has access to. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 < /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi + +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/configure" +run_curl DELETE "$token" "$URL" $tmpout $tmperr + +echo "exit code=$?" +echo "output" +cat $tmpout +echo "error" +cat $tmperr diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_cicd_clones b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_clones new file mode 100755 index 00000000..77c4e8e0 --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_clones @@ -0,0 +1,143 @@ +#!/bin/bash +# +################################################################################ +# This script is used to list all the EDA CI/CD projects user has access to. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmpout2=$(mktemp /tmp/list_volumes-out2.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmpout2 $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 < /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi + +if [ "$raw" = true ]; then + jq_query='.' +else + jq_query='.items[] | "\(.name) \(.size/1024/1024/1024) \(.daysLeft) \(.volumeUuid) \(.status)"' +fi + +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/projects/${PROJECT_ID}/operations/clones" +run_curl GET "$token" "$URL" $tmpout $tmperr +if jq -r "$jq_query" $tmpout > $tmpout2 2> $tmperr; then + : +else + echo "Error: Failed to parse the output from the API." >&2 + cat $tmperr >&2 + exit 1 +fi +# +# Check to see if there are more. +nextToken=$(jq -r '.nextToken' $tmpout) +while [ "$nextToken" != "null" ]; do + run_curl GET "$token" "$URL?nextToken=${nextToken}" $tmpout $tmperr + if jq -r "$jq_query" $tmpout >> $tmpout2 2> $tmperr; then + : + else + echo "Error: Failed to parse the output from the API." >&2 + cat $tmperr >&2 + exit 1 + fi + nextToken=$(jq -r '.nextToken' $tmpout) +done +if [ "$raw" = true ]; then + cat $tmpout2 +else + sort -f $tmpout2 | column -t -N "Name,Size (GB),Days Left,Volume UUID,Status" +fi diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects new file mode 100755 index 00000000..db96c413 --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects @@ -0,0 +1,137 @@ +#!/bin/bash +# +################################################################################ +# This script is used to list all the EDA CI/CD projects user has access to. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmpout2=$(mktemp /tmp/list_volumes-out2.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmpout2 $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 < /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi + +if [ "$raw" = true ]; then + jq_query='.' +else + jq_query='.items[] | "\(.projectName) \(.projectId) \(.fileSystemId) \(.volumeName) \(.numberOfClones)"' +fi + +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/projects" +run_curl GET "$token" "$URL" $tmpout $tmperr +if jq -r "$jq_query" $tmpout > $tmpout2 2> $tmperr; then + : +else + echo "Error: Failed to parse the output from the API." >&2 + cat $tmperr >&2 + exit 1 +fi +# +# Check to see if there are more. +nextToken=$(jq -r '.nextToken' $tmpout) +while [ "$nextToken" != "null" ]; do + run_curl GET "$token" "$URL?nextToken=${nextToken}" $tmpout $tmperr + if jq -r "$jq_query" $tmpout >> $tmpout2 2> $tmperr; then + : + else + echo "Error: Failed to parse the output from the API." >&2 + cat $tmperr >&2 + exit 1 + fi + nextToken=$(jq -r '.nextToken' $tmpout) +done +if [ "$raw" = true ]; then + cat $tmpout2 +else + sort -f $tmpout2 | column -t -N "Name,Project ID,File System,Volume Name,Number of Clones" +fi diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_eda_project_config b/Management-Utilities/Workload-Factory-API-Samples/list_eda_project_config new file mode 100755 index 00000000..0065e703 --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/list_eda_project_config @@ -0,0 +1,124 @@ +#!/bin/bash +# +################################################################################ +# This script is used to list the EDA Project filter user has access to. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmpout2=$(mktemp /tmp/list_volumes-out2.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmpout2 $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 < /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi + +if [ $raw == "true" ]; then + jq_query='.' +else + jq_query='.createdBy as $cb | (.items[] | select(.target == "tag") | "\(.label) \(.key) " + $cb)' +fi + +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/configure" +run_curl GET "$token" "$URL" $tmpout $tmperr +if jq -r "$jq_query" $tmpout > $tmpout2 2> $tmperr; then + : +else + echo "Error: Failed to parse the output from the API." >&2 + cat $tmperr >&2 + exit 1 +fi + +if [ $raw == "true" ]; then + cat $tmpout2 +else + sort -f $tmpout2 | column -t -N "Label,Key,Created By" +fi From 0c7ce8a502c8eaca9a807380d788ce1d9d0cc874 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 16 Apr 2026 08:50:18 -0500 Subject: [PATCH 04/11] Add CI/CD and EDA Project support. --- .../cicd_clones_create | 2 +- .../eda_project_config_create | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create index 27263987..eff52b81 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create @@ -118,7 +118,7 @@ if [ -z "$token" ]; then fi body='{ "cloneName": "'$CLONE_NAME'", - '$snapshot_name' + '$SNAPSHOT_NAME' "parentVolumeId": "'$VOLUME_ID'" }' diff --git a/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create index fb7f321b..107fbfb7 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create +++ b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create @@ -28,9 +28,9 @@ Where: refresh_token - Is a refresh token used to obtain an access token needed credentials you have access to. -g tag1[,tag2,...] - is a comma separated list of tags to use in the filter. -y single|multiselect,single|multiselect,... - is a comma separated list of filter types - corresponding to the tags specified with the -a option. - The filter type can be either 'single' or 'multiselect'. - If not provided, multiselect will be used for all tags. + corresponding to the tags specified with the -a option. + The filter type can be either 'single' or 'multiselect'. + If not provided, multiselect will be used for all tags. Instead of passing parameters on the command line, you can set the following environment variables: @@ -145,12 +145,6 @@ body+='], "resourceProps": [ { ] } ], "status": "active" }' -echo "body: $body" -exit 0 URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/configure" run_curl POST "$token" "$URL" $tmpout $tmperr "$body" - -echo "output" -cat $tmpout -echo "error" -cat $tmperr +echo "Project filter created." From c8bd50be343d4e3109ec6677ac81d9cc0a2caf52 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 16 Apr 2026 08:50:43 -0500 Subject: [PATCH 05/11] Added route table and endpoint support. --- .../fsx-ontap-aws-cli-scripts/create_fsxn_filesystem | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem index 927638e1..df1652e8 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem @@ -122,7 +122,7 @@ while [ ! -z "$1" ]; do shift ;; -route-tables|--route-tables) routeTables='"RouteTableIds":"'$2'",' - shfit + shift ;; -type|--type) availType=$2 From 79c222533e690e793bb790b5b081b089c411bbd0 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 16 Apr 2026 11:42:31 -0500 Subject: [PATCH 06/11] Add CI/CD and EDA Project samples --- .../cicd_clones_create | 17 +++++---------- .../cicd_clones_delete | 13 +++--------- .../cicd_project_create | 8 +++---- .../cicd_project_delete | 21 +++---------------- .../eda_project_config_create | 14 +++---------- .../eda_project_config_delete | 19 +++-------------- .../list_cicd_clones | 17 +++++---------- .../list_cicd_projects | 12 ++--------- .../list_eda_project_config | 12 ++--------- 9 files changed, 29 insertions(+), 104 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create index eff52b81..3a28f166 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create @@ -1,7 +1,7 @@ #!/bin/bash # ################################################################################ -# This script is used to delete a EDA CI/CD clone. +# This script is used to create a EDA CI/CD clone. # # It is dependent on the 'wf_utils' file that is included in this repo. That # file contains the 'get_token' function that is used to obtain a valid @@ -14,18 +14,15 @@ ################################################################################ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= - export CREDENTIALS_ID= + export PROJECT_ID= EOF exit 1 } @@ -70,11 +67,10 @@ fi # # Process command line arguments. SNAPSHOT_NAME="" -while getopts "ht:a:c:p:v:n:s:" opt; do +while getopts "ht:a:p:v:n:s:" opt; do case $opt in t) REFRESH_TOKEN="$OPTARG" ;; a) BLUEXP_ACCOUNT_ID="$OPTARG" ;; - c) CREDENTIALS_ID="$OPTARG" ;; p) PROJECT_ID="$OPTARG" ;; n) CLONE_NAME="$OPTARG" ;; v) VOLUME_ID="$OPTARG" ;; @@ -90,9 +86,6 @@ https://services.cloud.netapp.com/refresh-token\n\n' required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. -You can get a list of credentials by running the "list_credentials" script -found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["PROJECT_ID"]='Error: The EDA CI/CD project ID is required to run this script. You can get a list of projects you have access to by running the "list_cicd_projects" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_delete b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_delete index fe2d4892..a9cd9d68 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_delete +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_delete @@ -16,16 +16,13 @@ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= - export CREDENTIALS_ID= + export PROJECT_ID= EOF exit 1 } @@ -66,11 +63,10 @@ fi . "$wf_utils" # # Process command line arguments. -while getopts "ht:a:c:p:v:" opt; do +while getopts "ht:a:p:v:" opt; do case $opt in t) REFRESH_TOKEN="$OPTARG" ;; a) BLUEXP_ACCOUNT_ID="$OPTARG" ;; - c) CREDENTIALS_ID="$OPTARG" ;; p) PROJECT_ID="$OPTARG" ;; v) CLONE_VOLUME_ID="$OPTARG" ;; *) usage ;; @@ -84,9 +80,6 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. -You can get a list of credentials by running the "list_credentials" script -found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["PROJECT_ID"]='Error: The EDA CI/CD project ID is required to run this script. You can get a list of projects you have access to by running the "list_cicd_projects" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create index b266c642..cb9e3b66 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create @@ -16,16 +16,13 @@ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= - export CREDENTIALS_ID= + export PROJECT_NAME= + export REGION= EOF exit 1 } diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_project_delete b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_delete index f7d9e1a0..650d09ac 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/cicd_project_delete +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_delete @@ -16,16 +16,13 @@ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= - export CREDENTIALS_ID= EOF exit 1 } @@ -64,12 +60,10 @@ fi . "$wf_utils" # # Process command line arguments. -raw=false -while getopts "ht:a:c:p:" opt; do +while getopts "ht:a:p:" opt; do case $opt in t) REFRESH_TOKEN="$OPTARG" ;; a) BLUEXP_ACCOUNT_ID="$OPTARG" ;; - c) CREDENTIALS_ID="$OPTARG" ;; p) projectId="$OPTARG" ;; *) usage ;; esac @@ -82,11 +76,8 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh token is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script. -You can get a list of credentials by running the "list_credentials" script -found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["projectId"]='Error: The ID of the project to delete is required. -You can get a list of projects by running the "list_cicd_project" script +You can get a list of projects by running the "list_cicd_projects" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' check_required_options @@ -105,12 +96,6 @@ if [ -z "$token" ]; then exit 1 fi -if [ "$raw" = true ]; then - jq_query='.' -else - jq_query='.items[] | "\(.projectName) \(.fileSystemId) \(.volumeName) \(.numberOfClones)"' -fi - URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/projects/$projectId" run_curl DELETE "$token" "$URL" $tmpout $tmperr echo "Project with ID $projectId has been deleted." diff --git a/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create index 107fbfb7..b2cd484a 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create +++ b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_create @@ -16,19 +16,16 @@ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= - export CREDENTIALS_ID= EOF exit 1 } @@ -68,11 +64,10 @@ fi # # Process command line arguments. typeset -a tags filter_types -while getopts "ht:a:c:g:y:" opt; do +while getopts "ht:a:g:y:" opt; do case $opt in t) REFRESH_TOKEN="$OPTARG" ;; a) BLUEXP_ACCOUNT_ID="$OPTARG" ;; - c) CREDENTIALS_ID="$OPTARG" ;; g) tags=($(echo "$OPTARG" | tr ',' ' ')) ;; y) filter_types=($(echo "$OPTARG" | tr ',' ' ')) ;; *) usage ;; @@ -86,9 +81,6 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. -You can get a list of credentials by running the "list_credentials" script -found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' check_required_options diff --git a/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_delete b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_delete index 968fa732..91613fbb 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_delete +++ b/Management-Utilities/Workload-Factory-API-Samples/eda_project_config_delete @@ -16,23 +16,19 @@ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= - export CREDENTIALS_ID= EOF exit 1 } @@ -61,11 +57,10 @@ fi . "$wf_utils" # # Process command line arguments. -while getopts "ht:a:c:" opt; do +while getopts "ht:a:" opt; do case $opt in t) REFRESH_TOKEN="$OPTARG" ;; a) BLUEXP_ACCOUNT_ID="$OPTARG" ;; - c) CREDENTIALS_ID="$OPTARG" ;; *) usage ;; esac done @@ -77,9 +72,6 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. -You can get a list of credentials by running the "list_credentials" script -found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' check_required_options # @@ -99,9 +91,4 @@ fi URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/configure" run_curl DELETE "$token" "$URL" $tmpout $tmperr - -echo "exit code=$?" -echo "output" -cat $tmpout -echo "error" -cat $tmperr +echo "EDA Project filter deleted successfully." diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_cicd_clones b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_clones index 77c4e8e0..0c39eaa6 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_cicd_clones +++ b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_clones @@ -1,7 +1,7 @@ #!/bin/bash # ################################################################################ -# This script is used to list all the EDA CI/CD projects user has access to. +# This script is used to list all the EDA CI/CD clones user has access to. # # It is dependent on the 'wf_utils' file that is included in this repo. That # file contains the 'get_token' function that is used to obtain a valid @@ -14,18 +14,15 @@ ################################################################################ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= - export CREDENTIALS_ID= + export PROJECT_ID= EOF exit 1 } @@ -66,11 +63,10 @@ fi # # Process command line arguments. raw=false -while getopts "ht:a:c:jp:" opt; do +while getopts "ht:a:jp:" opt; do case $opt in t) REFRESH_TOKEN="$OPTARG" ;; a) BLUEXP_ACCOUNT_ID="$OPTARG" ;; - c) CREDENTIALS_ID="$OPTARG" ;; j) raw=true ;; p) PROJECT_ID="$OPTARG" ;; *) usage ;; @@ -84,9 +80,6 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. -You can get a list of credentials by running the "list_credentials" script -found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["PROJECT_ID"]='Error: The EDA CI/CD project ID is required to run this script. You can get a list of projects you have access to by running the "list_cicd_projects" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects index db96c413..3ecff31a 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects +++ b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects @@ -16,16 +16,13 @@ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= - export CREDENTIALS_ID= EOF exit 1 } @@ -64,11 +60,10 @@ fi # # Process command line arguments. raw=false -while getopts "ht:a:c:j" opt; do +while getopts "ht:a:j" opt; do case $opt in t) REFRESH_TOKEN="$OPTARG" ;; a) BLUEXP_ACCOUNT_ID="$OPTARG" ;; - c) CREDENTIALS_ID="$OPTARG" ;; j) raw=true ;; *) usage ;; esac @@ -81,9 +76,6 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. -You can get a list of credentials by running the "list_credentials" script -found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' check_required_options # diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_eda_project_config b/Management-Utilities/Workload-Factory-API-Samples/list_eda_project_config index 0065e703..8bdd177c 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_eda_project_config +++ b/Management-Utilities/Workload-Factory-API-Samples/list_eda_project_config @@ -16,16 +16,13 @@ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= - export CREDENTIALS_ID= EOF exit 1 } @@ -64,11 +60,10 @@ fi # # Process command line arguments. raw=false -while getopts "ht:a:c:j" opt; do +while getopts "ht:a:j" opt; do case $opt in t) REFRESH_TOKEN="$OPTARG" ;; a) BLUEXP_ACCOUNT_ID="$OPTARG" ;; - c) CREDENTIALS_ID="$OPTARG" ;; j) raw=true ;; *) usage ;; esac @@ -81,9 +76,6 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. -You can get a list of credentials by running the "list_credentials" script -found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' check_required_options # From 1716caffd1dc49965edd19fa6e87ab1b90e2fa95 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 16 Apr 2026 13:15:23 -0500 Subject: [PATCH 07/11] Added endpoint support. --- .../create_fsxn_filesystem | 6 +- .../fsx-ontap-aws-cli-scripts/create_fsxn_svm | 13 ++- .../create_fsxn_volume | 31 +++-- .../delete_fsxn_filesystem | 22 ++-- .../fsx-ontap-aws-cli-scripts/delete_fsxn_svm | 16 ++- .../delete_fsxn_volume | 17 +-- .../list_fsxn_filesystems | 19 ++-- .../fsx-ontap-aws-cli-scripts/list_fsxn_svms | 13 ++- .../list_fsxn_volumes | 107 ++++++++++-------- 9 files changed, 133 insertions(+), 111 deletions(-) diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem index df1652e8..e6df553f 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_filesystem @@ -24,9 +24,9 @@ Usage: $(basename $0) -name fileSystemName -subnetID1 subnetID1 -subnetID2 subne where fileSystemName: Is the name you want to assign the file system. subnetID1: Is the subnet ID of the preferred subnet you want the file system to be accessible from. - subnetID2: Is the subnet ID of the standby subnet you want the file system to be accessible from. Only allowed for multi availability zone deployments. + subnetID2: Is the subnet ID of the standby subnet you want the file system to be accessible from. Only allowed for multi-availability zone deployments. security-group-id: Is the security ID that you want applied to the ENIs that are assigned to the file system. - route_table_ids: is a comma separated list of route table ids you want updated with the floating IPs from the file system. Only useful for multi available zone deployments. + route_table_ids: is a comma separated list of route table ids you want updated with the floating IPs from the file system. Only useful for multi-availability zone deployments. region: Is the AWS region where the FSxN file system will reside. availability: Specifies whether the HA pair should be spread across 'single' or 'multiple' availability zones. Valid settings are 'single' or 'multi' (default). size: Is size, in gigabytes, you want the file system to be. Minimum is 1024 per number of HA pairs. Default is 1024. @@ -121,7 +121,7 @@ while [ ! -z "$1" ]; do -security-group-id|--security-group-id) securityGroupOption="--security-group-ids $2" shift ;; - -route-tables|--route-tables) routeTables='"RouteTableIds":"'$2'",' + -route-tables|--route-tables) routeTables='"RouteTableIds":["'$(echo "$2" | sed -e 's/,/","/g')'"],' shift ;; -type|--type) diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_svm b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_svm index 2ee3d274..94af7e93 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_svm +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_svm @@ -21,13 +21,14 @@ ################################################################################ usage () { cat 1>&2 < /dev/null | jq -r ".FileSystems[] | if((.Tags[] | select(.Key == \"Name\") .Value) == \"${fileSystemName}\") then .FileSystemId else empty end" 2> /dev/null) + fsid=$(aws fsx describe-file-systems $endpoint_url --region $region --output=json 2> /dev/null | jq -r ".FileSystems[] | if((.Tags[] | select(.Key == \"Name\") .Value) == \"${fileSystemName}\") then .FileSystemId else empty end" 2> /dev/null) fi if [ -z "$fsid" ]; then @@ -91,7 +94,7 @@ if [ -z "$fsid" ]; then fi # # Create the SVM -aws fsx create-storage-virtual-machine --name $svmName --region=$region --file-system-id "$fsid" --output=json > $tmpout 2>&1 +aws fsx create-storage-virtual-machine $endpoint_url --name $svmName --region=$region --file-system-id "$fsid" --output=json > $tmpout 2>&1 if [ $? != "0" ]; then echo "Failed to create storage virtual machine." 1>&2 @@ -107,7 +110,7 @@ else if [ $waitForCompletion == true ]; then i=0 while [ $i -lt $maxIterations ]; do - aws fsx describe-storage-virtual-machines --storage-virtual-machine-ids $svmId --output=json --region=$region > $tmpout 2>&1 + aws fsx describe-storage-virtual-machines $endpoint_url --storage-virtual-machine-ids $svmId --output=json --region=$region > $tmpout 2>&1 if [ $? -eq 0 ]; then status=$(jq -r '.StorageVirtualMachines[0].Lifecycle' $tmpout 2> /dev/null) if [ "$status" == "CREATED" ]; then diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_volume b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_volume index 02a555bd..0db9a192 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_volume +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/create_fsxn_volume @@ -21,7 +21,7 @@ ################################################################################ usage () { cat 1>&2 <&2 usage fi ;; - v) volumeStyle=$OPTARG - ;; - a) aggregateOption='"AggregateConfiguration":{"Aggregates":["'$OPTARG'"]},' - ;; - w) waitForCompletion=true - ;; - *) usage - ;; + v) volumeStyle=$OPTARG ;; + a) aggregateOption='"AggregateConfiguration":{"Aggregates":["'$OPTARG'"]},' ;; + w) waitForCompletion=true ;; + *) usage ;; esac done # @@ -95,7 +90,7 @@ if [ $volumeStyle != "FLEXVOL" -a $volumeStyle != "FLEXGROUP" ]; then usage fi -aws fsx create-volume --volume-type ONTAP --name $volumeName --ontap-configuration '{ +aws fsx create-volume --volume-type ONTAP $endpoint_url --name $volumeName --ontap-configuration '{ "JunctionPath": "/'$volumeName'", "SecurityStyle": "UNIX", "SizeInMegabytes" : '$size', @@ -119,7 +114,7 @@ else if [ "$waitForCompletion" == "true" ]; then i=0 while [ $i -lt $maxIterations ]; do - aws fsx describe-volumes --volume-ids $volumeId --region=$region --output=json > $tmpout 2>&1 + aws fsx describe-volumes $endpoint_url --volume-ids $volumeId --region=$region --output=json > $tmpout 2>&1 status=$(jq -r .Volumes[0].Lifecycle $tmpout 2> /dev/null) if [ $status == "CREATED" ]; then printf "\nVolume '$volumeName'($volumeId) has been created.\n" diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_filesystem b/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_filesystem index 0409dd7d..1a16fb20 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_filesystem +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_filesystem @@ -27,13 +27,14 @@ ################################################################################ usage () { cat 1>&2 < $tmpout | jq -r '.FileSystems[] | if((.Tags[] | select(.Key == "Name") .Value) == "'"${fileSystemName}"'") then .FileSystemId else empty end' 2> /dev/null)) + fsid=($(aws fsx describe-file-systems $endpoint_url --region=$region --output=json 2> $tmpout | jq -r '.FileSystems[] | if((.Tags[] | select(.Key == "Name") .Value) == "'"${fileSystemName}"'") then .FileSystemId else empty end' 2> /dev/null)) if [ ${#fsid[*]} -gt 1 ]; then echo "Error, more than one file system matched the file system name '$fileSystemName'." 1>&2 @@ -140,7 +144,7 @@ if [ -z "$fsid" ]; then else # # Get the file system name based on the fsid. - aws fsx describe-file-systems --file-system-ids $fsid --region=$region --output=json > $tmpout 2>&1 + aws fsx describe-file-systems $endpoint_url --file-system-ids $fsid --region=$region --output=json > $tmpout 2>&1 if [ $? -ne 0 ]; then echo "Error, failed to get the file system name based on the ID ($fsid)." 1>&2 cat $tmpout 1>&2 @@ -155,7 +159,7 @@ else fi # # Create a JSON file with all the SVMs associated with the file system. -aws fsx describe-storage-virtual-machines --region=$region --output=json --filters Name=file-system-id,Values=$fsid > $svmsFile 2>&1 +aws fsx describe-storage-virtual-machines $endpoint_url --region=$region --output=json --filters Name=file-system-id,Values=$fsid > $svmsFile 2>&1 if [ $? -ne 0 ]; then echo "Error, failed to get the list of SVMs." 1>&2 cat $svmsFile 1>&2 @@ -163,7 +167,7 @@ if [ $? -ne 0 ]; then fi # # Create a JSON file with all the FSXN volumes associated with the file system. -aws fsx describe-volumes --region=$region --output=json --filters Name=file-system-id,Values=$fsid > $volumesFile 2>&1 +aws fsx describe-volumes --region=$region $endpoint_url --output=json --filters Name=file-system-id,Values=$fsid > $volumesFile 2>&1 if [ $? -ne 0 ]; then echo "Error, failed to get the list of volumes." 1>&2 cat $volumesFile 1>&2 @@ -188,7 +192,7 @@ svms=($(jq -r '.StorageVirtualMachines[] | select(.FileSystemId == "'$fsId'") | # # First delete all the SVMs. The 'delete_fsxn_svm' script will delete all the volumes associated with the SVM. for svmId in ${svms[*]}; do - delete_fsxn_svm -n -w $enableBackup -i $svmId -r $region + delete_fsxn_svm -n -w $enableBackup -i $svmId -r $region $endpoint_arg if [ $? -ne 0 ]; then echo "Error, failed to delete the SVM with SVM ID '$svmId'." 1>&2 exit 1 @@ -196,7 +200,7 @@ for svmId in ${svms[*]}; do done # # Now that all the volumes and all the SVMs have been deleted, we can delete the filesystem. -aws fsx delete-file-system --file-system-id $fsid --output=json --region=$region > $tmpout 2>&1 +aws fsx delete-file-system $endpoint_url --file-system-id $fsid --output=json --region=$region > $tmpout 2>&1 if [ $? != "0" ]; then printf "\nError, failed to delete file system.\n" 1>&2 cat $tmpout 1>&2 @@ -208,7 +212,7 @@ else if [ $waitForCompletion == "true" ]; then i=0 while [ $i -lt $MaxIterations ]; do - aws fsx describe-file-systems --file-system-ids $fsid --output=json --region=$region > $tmpout 2>&1 + aws fsx describe-file-systems $endpoint_url --file-system-ids $fsid --output=json --region=$region > $tmpout 2>&1 if [ $? -eq 0 ]; then status=$(jq -r '.FileSystems[0].Lifecycle' $tmpout 2> /dev/null) if [ "$status" != "DELETING" -a "$status" != "PENDING" ]; then diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_svm b/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_svm index ed00a64c..bc591cec 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_svm +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_svm @@ -23,13 +23,14 @@ ################################################################################ usage () { cat 1>&2 < $volumesFile 2>&1 +aws fsx describe-volumes $endpoint_url --region=$region --output=json --filters Name=storage-virtual-machine-id,Values=$svmID > $volumesFile 2>&1 if [ $? -ne 0 ]; then echo "Error, failed to get the list of volumes for SVM: $svmID." 1>&2 cat $volumesFile 1>&2 @@ -144,7 +148,7 @@ if [ ! -z "${volumes[*]}" ]; then maxNumRunning=1 # Only do one initially, if it completes successfully, then do the rest concurrently. printf "\nDeleting all the volumes associated with ${svmID}.\n" while [ $i -lt $numVolumes ]; do - delete_fsxn_volume -r $region -w -q -i ${volumes[$i]} $enableBackup & + delete_fsxn_volume -r $region -w -q -i ${volumes[$i]} $enableBackup $endpoint_arg & let i+=1 let numRunning+=1 printf "\rTotal number of volumes to delete: ${numVolumes}. Number of deletes currently running: ${numRunning}. Number waiting to be started: $((numVolumes-i)). " @@ -189,7 +193,7 @@ if [ ! -z "${volumes[*]}" ]; then fi # # Now that all the volumes have been deleted, delete the storage virtual machine. -aws fsx delete-storage-virtual-machine --region=$region --storage-virtual-machine-id $svmID > $tmpout 2>&1 +aws fsx delete-storage-virtual-machine $endpoint_url --region=$region --storage-virtual-machine-id $svmID > $tmpout 2>&1 if [ $? != "0" ]; then echo "Failed to delete storage virtual machine." 1>&2 @@ -204,7 +208,7 @@ else if [ $waitForDelete == "true" ]; then i=0 while [ $i -lt $MaxIterations ]; do - aws fsx describe-storage-virtual-machines --storage-virtual-machine-ids $svmID --output=json --region=$region > $tmpout 2>&1 + aws fsx describe-storage-virtual-machines $endpoint_url --storage-virtual-machine-ids $svmID --output=json --region=$region > $tmpout 2>&1 if [ $? -eq 0 ]; then status=$(jq -r '.StorageVirtualMachines[0].Lifecycle' $tmpout 2> /dev/null) if [ "$status" != "DELETING" -a "$status" != "PENDING" ]; then diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_volume b/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_volume index 685dc08f..af72be6f 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_volume +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/delete_fsxn_volume @@ -20,12 +20,13 @@ ################################################################################ usage () { cat 1>&2 < $tmpout 2>&1 + aws fsx describe-s3-access-point-attachments $endpoint_url --names $s3ApName --output=json --region=$region > $tmpout 2>&1 if [ $? -eq 0 ]; then status=$(jq -r .S3AccessPointAttachments[0].Lifecycle $tmpout 2> /dev/null) if [ "$status" != "DELETING" -a "$status" != "PENDING" ]; then @@ -84,7 +85,7 @@ waitForVolumeDelete () { # Wait for the volume to be deleted. i=0 while [ $i -lt $MaxIterations ]; do - aws fsx describe-volumes --volume-ids $volumeId --output=json --region=$region > $tmpout 2>&1 + aws fsx describe-volumes $endpoint_url --volume-ids $volumeId --output=json --region=$region > $tmpout 2>&1 if [ $? -eq 0 ]; then status=$(jq -r .Volumes[0].Lifecycle $tmpout 2> /dev/null) if [ "$status" != "DELETING" -a "$status" != "PENDING" ]; then @@ -125,7 +126,7 @@ waitForCompletion=false quiet=false # # Process command line arguments. -while getopts "qhwbi:r:" option; do +while getopts "qhwbi:r:e:" option; do case $option in r) region="$OPTARG" ;; @@ -137,6 +138,8 @@ while getopts "qhwbi:r:" option; do ;; q) quiet=true ;; + e) endpoint_url="--endpoint-url $OPTARG" + ;; *) usage ;; esac @@ -155,11 +158,11 @@ if [ -z "$volumeId" ]; then usage fi -aws fsx describe-s3-access-point-attachments --filter "Name=volume-id,Values=$volumeId" --region=$region --output=json > $tmpout 2>&1 +aws fsx describe-s3-access-point-attachments $endpoint_url --filter "Name=volume-id,Values=$volumeId" --region=$region --output=json > $tmpout 2>&1 if [ "$(jq -r '.S3AccessPointAttachments | length' $tmpout 2>&1)" != "0" ]; then while read s3apName; do [ $quiet != "true" ] && printf "S3 Access Point '$s3apName' is being deleted." 1>&2 - aws fsx detach-and-delete-s3-access-point --name $s3apName --region=$region --output=json > $tmpout 2>&1 + aws fsx detach-and-delete-s3-access-point $endpoint_url --name $s3apName --region=$region --output=json > $tmpout 2>&1 if waitForS3ApDelete $s3apName $volumeId; then : else @@ -169,7 +172,7 @@ if [ "$(jq -r '.S3AccessPointAttachments | length' $tmpout 2>&1)" != "0" ]; then done < <(jq -r '.S3AccessPointAttachments[] | .S3AccessPoint.ResourceARN | split("/")[1]' $tmpout 2>/dev/null) fi -aws fsx delete-volume --volume-id $volumeId --region=$region --output=json --ontap-configuration '{"SkipFinalBackup": '$skipBackup'}' --output=json > $tmpout 2>&1 +aws fsx delete-volume $endpoint_url --volume-id $volumeId --region=$region --output=json --ontap-configuration '{"SkipFinalBackup": '$skipBackup'}' --output=json > $tmpout 2>&1 if [ $? != "0" ]; then echo "Failed to delete volume." 1>&2 diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_filesystems b/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_filesystems index 422f1417..684a149a 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_filesystems +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_filesystems @@ -42,7 +42,7 @@ ################################################################################ usage () { cat 1>&2 < /dev/null | jq -r '.FileSystems[] | if((.Tags[] | select(.Key == "Name") .Value) == "'"${fileSystemName}"'") then .FileSystemId else empty end' 2> /dev/null) + fsid=$(aws fsx describe-file-systems $endpoint_url --region=$region --output=json 2> /dev/null | jq -r '.FileSystems[] | if((.Tags[] | select(.Key == "Name") .Value) == "'"${fileSystemName}"'") then .FileSystemId else empty end' 2> /dev/null) if [ ! -z "$fsid" ]; then - aws fsx describe-file-systems --file-system-ids $fsid --region=$region --query "$queryString" --output=json > $fileSystemsFile 2>&1 + aws fsx describe-file-systems $endpoint_url --file-system-ids $fsid --region=$region --query "$queryString" --output=json > $fileSystemsFile 2>&1 else echo "Error, failed to get the file system ID based on a file system name of '$fileSystemName'." 1>&2 exit 1 fi else if [ -z "$fsid" ]; then - aws fsx describe-file-systems --region=$region --query "$queryString" --output=json > $fileSystemsFile 2>&1 + aws fsx describe-file-systems $endpoint_url --region=$region --query "$queryString" --output=json > $fileSystemsFile 2>&1 else - aws fsx describe-file-systems --file-system-ids $fsid --region=$region --query "$queryString" --output=json > $fileSystemsFile 2>&1 + aws fsx describe-file-systems $endpoint_url --file-system-ids $fsid --region=$region --query "$queryString" --output=json > $fileSystemsFile 2>&1 fi fi @@ -205,14 +208,14 @@ for region in ${regions[*]}; do fi if [ $contents == "true" ]; then - aws fsx describe-storage-virtual-machines --region=$region --output=json > $svmsFile 2>&1 + aws fsx describe-storage-virtual-machines $endpoint_url --region=$region --output=json > $svmsFile 2>&1 if [ $? -ne 0 ]; then echo "Error, failed to get the list of SVMs." 1>&2 cat $svmsFile 1>&2 exit 1 fi - aws fsx describe-volumes --region=$region --output=json > $volumesFile 2>&1 + aws fsx describe-volumes $endpoint_url --region=$region --output=json > $volumesFile 2>&1 if [ $? -ne 0 ]; then echo "Error, failed to get the list of volumes." 1>&2 cat $volumesFile 1>&2 diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_svms b/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_svms index 0b0ff91f..e5097e5e 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_svms +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_svms @@ -28,12 +28,13 @@ ################################################################################ usage () { cat 1>&2 < /dev/null | jq -r '.FileSystems[] | if((.Tags[] | select(.Key == "Name") .Value) == "'"${fileSystemName}"'") then .FileSystemId else empty end' 2> /dev/null) + fileSystemID=$(aws fsx describe-file-systems $endpoint_url --output=json --region=$region 2> /dev/null | jq -r '.FileSystems[] | if((.Tags[] | select(.Key == "Name") .Value) == "'"${fileSystemName}"'") then .FileSystemId else empty end' 2> /dev/null) if [ -z "$fileSystemID" ]; then if [ "$allRegions" != "true" ]; then echo "Error, failed to find a file system with the name '$fileSystemName'. Maybe in a different region?" 1>&2 @@ -126,7 +129,7 @@ for region in ${regions[*]}; do else filter="--filter Name=file-system-id,Values=$fileSystemID" fi - aws fsx describe-storage-virtual-machines --output=json --region=$region $filter | jq -r '.StorageVirtualMachines[] | "\(.FileSystemId),\(.StorageVirtualMachineId),\(.Endpoints.Nfs.IpAddresses[0]),\(.Name),\(.Lifecycle)"' | sort > $tmpout + aws fsx describe-storage-virtual-machines $endpoint_url --region=$region $filter | jq -r '.StorageVirtualMachines[] | "\(.FileSystemId),\(.StorageVirtualMachineId),\(.Endpoints.Nfs.IpAddresses[0]),\(.Name),\(.Lifecycle)"' | sort > $tmpout if [ $includeIp == "true" ]; then ipFmt="%16s" ipHeader="IP" @@ -136,7 +139,7 @@ for region in ${regions[*]}; do fi if [ $includeFsName == "true" ]; then - aws fsx describe-file-systems --output=json --region=$region | jq -r '.FileSystems[] | .FileSystemId + "," + (.Tags[] | select(.Key == "Name") .Value)' > $tmpout2 + aws fsx describe-file-systems $endpoint_url --region=$region | jq -r '.FileSystems[] | .FileSystemId + "," + (.Tags[] | select(.Key == "Name") .Value)' > $tmpout2 awk -F, -v region=$region -v ipFmt=$ipFmt -v ipHeader=$ipHeader 'BEGIN {first=1; maxNameLen=0; while(getline < "'$tmpout2'") {fss[$1]=$2; if(length($2) > maxNameLen) {maxNameLen=length($2)}}; maxNameLen +=2; formatStr="%12s %20s%-"maxNameLen"s %23s "ipFmt" %13s %s\n"}; {if(first) {printf "\n"; printf formatStr, "Region", "FileSystem ID", "(Name)", "SVM ID", ipHeader, "State", "SVM Name"; first=0}; if(ipHeader != "IP") {ip=""} else {ip=$3}; name="("fss[$1]")"; printf formatStr, region, $1, name, $2, ip, $5, $4}' < $tmpout else awk -F, -v region=$region -v ipFmt=$ipFmt -v ipHeader=$ipHeader 'BEGIN {first=1; formatStr="%12s %23s %23s "ipFmt" %13s %s\n"}; {if(first) {printf "\n"; printf formatStr, "Region", "FileSystem ID", "SVM ID", ipHeader, "State", "SVM Name"; first=0}; if(ipHeader != "IP") {ip=""} else {ip=$3}; printf formatStr, region, $1, $2, ip, $5, $4}' < $tmpout diff --git a/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_volumes b/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_volumes index 2ddf3941..d3ee81e3 100755 --- a/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_volumes +++ b/Management-Utilities/fsx-ontap-aws-cli-scripts/list_fsxn_volumes @@ -33,7 +33,7 @@ ################################################################################ usage () { cat 1>&2 < /dev/null | jq -r ".FileSystems[] | if((.Tags[] | select(.Key == \"Name\") .Value) == \"${fileSystemName}\") then .FileSystemId else empty end" 2> /dev/null) + fsid=$(aws fsx describe-file-systems $endpoint_url --region $region --output=json 2> /dev/null | jq -r ".FileSystems[] | if((.Tags[] | select(.Key == \"Name\") .Value) == \"${fileSystemName}\") then .FileSystemId else empty end" 2> /dev/null) if [ -z "$fsid" ]; then echo "Error, failed to find the file system with the file system name of '$fileSystemName'." 1>&2 exit 1 @@ -125,7 +128,7 @@ if [ ! -z "$fileSystemName" ]; then fi if [ ! -z "$fsid" -a -z "$fileSystemName" ]; then - fileSystemName=$(aws fsx describe-file-systems --region $region --output=json 2> /dev/null | jq -r ".FileSystems[] | if(.FileSystemId == \"$fsid\") then (.Tags[] | select(.Key == \"Name\") .Value) else empty end" 2> /dev/null) + fileSystemName=$(aws fsx describe-file-systems $endpoint_url --region $region --output=json 2> /dev/null | jq -r ".FileSystems[] | if(.FileSystemId == \"$fsid\") then (.Tags[] | select(.Key == \"Name\") .Value) else empty end" 2> /dev/null) filter='--filters [{"Name":"file-system-id","Values":["'$fsid'"]}]' fi @@ -160,67 +163,71 @@ for region in ${regions[*]}; do if [ ! -z "$(getent hosts fsx.$region.amazonaws.com)" ]; then if [ -z "$svmID" ]; then if [ "$excludeRoot" != "true" ]; then - aws fsx describe-volumes $filter --region=$region --output=json | jq -r '.Volumes[] | "'$jqFields'"' | egrep ",$volumePattern," | sort > $volumeList + aws fsx describe-volumes $filter $endpoint_url --region=$region --output=json | jq -r '.Volumes[] | "'$jqFields'"' | egrep ",$volumePattern," | sort > $volumeList else - aws fsx describe-volumes $filter --region=$region --output=json | jq -r '.Volumes[] | if(.OntapConfiguration.StorageVirtualMachineRoot | not) then "'$jqFields'" else empty end' | egrep ",$volumePattern," | sort > $volumeList + aws fsx describe-volumes $filter $endpoint_url --region=$region --output=json | jq -r '.Volumes[] | if(.OntapConfiguration.StorageVirtualMachineRoot | not) then "'$jqFields'" else empty end' | egrep ",$volumePattern," | sort > $volumeList fi else if [ "$excludeRoot" != "true" ]; then - aws fsx describe-volumes $filter --region=$region --output=json | jq -r '.Volumes[] | if(.OntapConfiguration.StorageVirtualMachineId == "'$svmID'") then "'$jqFields'" else empty end' | egrep ",$volumePattern," | sort > $volumeList + aws fsx describe-volumes $filter $endpoint_url --region=$region --output=json | jq -r '.Volumes[] | if(.OntapConfiguration.StorageVirtualMachineId == "'$svmID'") then "'$jqFields'" else empty end' | egrep ",$volumePattern," | sort > $volumeList else - aws fsx describe-volumes $filter --region=$region --output=json | jq -r '.Volumes[] | if(.OntapConfiguration.StorageVirtualMachineId == "'$svmID'" and (.OntapConfiguration.StorageVirtualMachineRoot | not)) then "'$jqFields'" else empty end' | egrep ",$volumePattern," | sort > $volumeList + aws fsx describe-volumes $filter $endpoint_url --region=$region --output=json | jq -r '.Volumes[] | if(.OntapConfiguration.StorageVirtualMachineId == "'$svmID'" and (.OntapConfiguration.StorageVirtualMachineRoot | not)) then "'$jqFields'" else empty end' | egrep ",$volumePattern," | sort > $volumeList fi fi if [ $includeFsName == "true" ]; then - aws fsx describe-file-systems --region=$region --output=json | jq -r '.FileSystems[] | .FileSystemId + "," + (.Tags[] | select(.Key == "Name") .Value)' > $fsNames - aws fsx describe-storage-virtual-machines --region=$region --output=json | jq -r '.StorageVirtualMachines[] | "\(.StorageVirtualMachineId),\(.Name)"' > $svmNames + aws fsx describe-file-systems $endpoint_url --region=$region --output=json | jq -r '.FileSystems[] | .FileSystemId + "," + (.Tags[] | select(.Key == "Name") .Value)' > $fsNames + aws fsx describe-storage-virtual-machines $endpoint_url --region=$region --output=json | jq -r '.StorageVirtualMachines[] | "\(.StorageVirtualMachineId),\(.Name)"' > $svmNames awk -F, -v region=$region 'BEGIN {first=1; maxFsNameLen=0; maxSvmNameLen=0; while(getline < "'$fsNames'") {fss[$1]=$2; if(length($2) > maxFsNameLen) {maxFsNameLen=length($2)}}; maxFsNameLen +=2; while(getline < "'$svmNames'") {svm[$1]=$2; if(length($2) > maxSvmNameLen) {maxSvmNameLen=length($2)}}; maxSvmNameLen +=2; formatStr="%12s %21s%-"maxFsNameLen"s %21s-%-"maxSvmNameLen"s %24s %10s %s\n"}; {if(first) {printf "\n"; printf formatStr, "Region", "FileSystem ID", "(Name)", "SVM", "(Name)", "Volume ID", "State", "Volume Name"; first=0}; fsName="("fss[$1]")"; svmName="("svm[$6]")"; printf formatStr, region, $1, fsName, $6, svmName, $3, $4, $2}' < $volumeList else if [ $extraInfo == "true" ]; then - volIds=$(awk -F, '{print $3}' < $volumeList) - if [ ! -z "$volIds" ]; then - echo "[" > $cloudwatchQueryFile - first=true - for volId in $volIds; do - volId2=$(echo $volId | sed -e 's/-/_/g') - if [ "$first" = "true" ]; then - first=false - else - echo "," >> $cloudwatchQueryFile - fi - cat <> $cloudwatchQueryFile - { - "Id": "m$volId2", - "MetricStat": { - "Metric": { - "Namespace": "AWS/FSx", - "MetricName": "StorageUsed", - "Dimensions": [ - { - "Name": "VolumeId", - "Value": "$volId" + if [ $(wc -l $volumeList | awk '{print $1}') -gt 500 ]; then + echo "Sorry, too many volumes to get CloudWatch statics for." + else + volIds=$(awk -F, '{print $3}' < $volumeList) + if [ ! -z "$volIds" ]; then + echo "[" > $cloudwatchQueryFile + first=true + for volId in $volIds; do + volId2=$(echo $volId | sed -e 's/-/_/g') + if [ "$first" = "true" ]; then + first=false + else + echo "," >> $cloudwatchQueryFile + fi + cat <> $cloudwatchQueryFile + { + "Id": "m$volId2", + "MetricStat": { + "Metric": { + "Namespace": "AWS/FSx", + "MetricName": "StorageUsed", + "Dimensions": [ + { + "Name": "VolumeId", + "Value": "$volId" + }, + { + "Name": "FileSystemId", + "Value": "$(awk -F, -v volId=$volId '$3 == volId {print $1}' < $volumeList)" + }] }, - { - "Name": "FileSystemId", - "Value": "$(awk -F, -v volId=$volId '$3 == volId {print $1}' < $volumeList)" - }] - }, - "Period": 300, - "Stat": "Average" + "Period": 300, + "Stat": "Average" + } } - } EOF - done - echo "]" >> $cloudwatchQueryFile - aws cloudwatch get-metric-data --region $region --metric-data-queries file://$cloudwatchQueryFile --start-time=$(date -u -d '5 minutes ago' +"%Y-%m-%dT%H:%M:%SZ") --end-time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") --output=json > $cloudwatchOutputFile 2>&1 - for volId in $volIds; do - volId2=$(echo $volId | sed -e 's/-/_/g') - capacity=$(jq -r '.MetricDataResults[] | select(.Id == "m'$volId2'") | .Values[0] // 0' < $cloudwatchOutputFile) - echo "$volId,$capacity" >> $volCapacityFile - done - awk -F, -v region=$region -v volCapacityFile=$volCapacityFile 'BEGIN {first=1; formatStr="%12s %21s %21s %24s %10s %16s %15s %s\n"; while (getline < volCapacityFile) {volidCapacities[$1]=sprintf("%10.0f",$2/1024/1024)}}; {if(first) {printf "\n"; printf formatStr, "Region", "FileSystem ID", "SVM", "Volume ID", "State", "Volume Size (MB)", "Used (MB)", "Volume Name"; first=0}; printf formatStr, region, $1, $6, $3, $4, $5, volidCapacities[$3], $2}' < $volumeList - fi + done + echo "]" >> $cloudwatchQueryFile + aws cloudwatch get-metric-data --region $region --metric-data-queries file://$cloudwatchQueryFile --start-time=$(date -u -d '5 minutes ago' +"%Y-%m-%dT%H:%M:%SZ") --end-time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") --output=json > $cloudwatchOutputFile + for volId in $volIds; do + volId2=$(echo $volId | sed -e 's/-/_/g') + capacity=$(jq -r '.MetricDataResults[] | select(.Id == "m'$volId2'") | .Values[0] // 0' < $cloudwatchOutputFile) + echo "$volId,$capacity" >> $volCapacityFile + done + awk -F, -v region=$region -v volCapacityFile=$volCapacityFile 'BEGIN {first=1; formatStr="%12s %21s %21s %24s %10s %16s %15s %s\n"; while (getline < volCapacityFile) {volidCapacities[$1]=sprintf("%10.0f",$2/1024/1024)}}; {if(first) {printf "\n"; printf formatStr, "Region", "FileSystem ID", "SVM", "Volume ID", "State", "Volume Size (MB)", "Used (MB)", "Volume Name"; first=0}; printf formatStr, region, $1, $6, $3, $4, $5, volidCapacities[$3], $2}' < $volumeList + fi + fi else awk -F, -v region=$region 'BEGIN {first=1; formatStr="%12s %21s %21s %24s %10s %s\n"}; {if(first) {printf "\n"; printf formatStr, "Region", "FileSystem ID", "SVM", "Volume ID", "State", "Volume Name"; first=0}; printf formatStr, region, $1, $6, $3, $4, $2}' < $volumeList fi From d588e9b306586efa4993218ff930ae6c2206683e Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Thu, 16 Apr 2026 13:16:15 -0500 Subject: [PATCH 08/11] Updated an error message. --- .../Workload-Factory-API-Samples/bluexp_fsxn_discovery | 2 +- .../Workload-Factory-API-Samples/fsxn_credentials_set | 2 +- .../Workload-Factory-API-Samples/link_associate | 2 +- .../Workload-Factory-API-Samples/link_disassociate | 2 +- .../Workload-Factory-API-Samples/list_filesystems | 2 +- .../Workload-Factory-API-Samples/list_snapmirrors | 2 +- Management-Utilities/Workload-Factory-API-Samples/list_svms | 2 +- Management-Utilities/Workload-Factory-API-Samples/list_volumes | 2 +- .../Workload-Factory-API-Samples/snapshot_create | 2 +- Management-Utilities/Workload-Factory-API-Samples/volume_clone | 2 +- Management-Utilities/Workload-Factory-API-Samples/volume_delete | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery b/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery index 939cdb23..0ce40b4e 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery +++ b/Management-Utilities/Workload-Factory-API-Samples/bluexp_fsxn_discovery @@ -100,7 +100,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh token is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to list resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/fsxn_credentials_set b/Management-Utilities/Workload-Factory-API-Samples/fsxn_credentials_set index e7c2300a..03a1db01 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/fsxn_credentials_set +++ b/Management-Utilities/Workload-Factory-API-Samples/fsxn_credentials_set @@ -96,7 +96,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/link_associate b/Management-Utilities/Workload-Factory-API-Samples/link_associate index ef546c35..b784cbc5 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/link_associate +++ b/Management-Utilities/Workload-Factory-API-Samples/link_associate @@ -83,7 +83,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/link_disassociate b/Management-Utilities/Workload-Factory-API-Samples/link_disassociate index f1f8061c..29b826db 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/link_disassociate +++ b/Management-Utilities/Workload-Factory-API-Samples/link_disassociate @@ -83,7 +83,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_filesystems b/Management-Utilities/Workload-Factory-API-Samples/list_filesystems index 95ab48f0..a2e59f14 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_filesystems +++ b/Management-Utilities/Workload-Factory-API-Samples/list_filesystems @@ -84,7 +84,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to list resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_snapmirrors b/Management-Utilities/Workload-Factory-API-Samples/list_snapmirrors index d4e2beb1..9e6352ec 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_snapmirrors +++ b/Management-Utilities/Workload-Factory-API-Samples/list_snapmirrors @@ -85,7 +85,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_svms b/Management-Utilities/Workload-Factory-API-Samples/list_svms index fd2e00aa..aa562f60 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_svms +++ b/Management-Utilities/Workload-Factory-API-Samples/list_svms @@ -83,7 +83,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to list resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_volumes b/Management-Utilities/Workload-Factory-API-Samples/list_volumes index 40115ed9..b76e48fd 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_volumes +++ b/Management-Utilities/Workload-Factory-API-Samples/list_volumes @@ -85,7 +85,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to list resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to list resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/snapshot_create b/Management-Utilities/Workload-Factory-API-Samples/snapshot_create index 6c5cbd6f..6d858d35 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/snapshot_create +++ b/Management-Utilities/Workload-Factory-API-Samples/snapshot_create @@ -86,7 +86,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/volume_clone b/Management-Utilities/Workload-Factory-API-Samples/volume_clone index c11a61d9..433dbf06 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/volume_clone +++ b/Management-Utilities/Workload-Factory-API-Samples/volume_clone @@ -87,7 +87,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' diff --git a/Management-Utilities/Workload-Factory-API-Samples/volume_delete b/Management-Utilities/Workload-Factory-API-Samples/volume_delete index edf864f2..c2f0667d 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/volume_delete +++ b/Management-Utilities/Workload-Factory-API-Samples/volume_delete @@ -88,7 +88,7 @@ required_options["REFRESH_TOKEN"]='Error: A BlueXP refresh tokon is required to required_options["BLUEXP_ACCOUNT_ID"]='Error: A BlueXP account ID is required to run this script. You can get the list of accounts you have access to by running the "list_bluexp_accts" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' -required_options["CREDENTIALS_ID"]='Error: The Workload Facotry credentials ID used to manage resources is required to run this script. +required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID used to manage resources is required to run this script. You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' From ba3378db5dee942adc6ddeab4400f0c5266d91e8 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Fri, 17 Apr 2026 11:39:49 -0500 Subject: [PATCH 09/11] Added a new list_snapshots script. --- .../list_snapshots | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100755 Management-Utilities/Workload-Factory-API-Samples/list_snapshots diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_snapshots b/Management-Utilities/Workload-Factory-API-Samples/list_snapshots new file mode 100755 index 00000000..6ff19d9f --- /dev/null +++ b/Management-Utilities/Workload-Factory-API-Samples/list_snapshots @@ -0,0 +1,135 @@ +#!/bin/bash +# +################################################################################ +# This script is used to list all the snapshots that a volume has. +# +# It is dependent on the 'wf_utils' file that is included in this repo. That +# file contains the 'get_token' function that is used to obtain a valid +# access token that is needed to run the Workload Factory APIs. The file needs +# to either be in the command search path or in the current directory. +################################################################################ + +################################################################################ +# This function just prints the usage of this script and exits the program. +################################################################################ +usage() { + cat >&2 < + export BLUEXP_ACCOUNT_ID= + export CREDENTIALS_ID= + export AWS_REGION= + export FILESYSTEM_ID= +EOF + exit 1 +} + +################################################################################ +# Main logic starts here. +################################################################################ +tmpout=$(mktemp /tmp/list_volumes-out.XXXXXX) +tmpout2=$(mktemp /tmp/list_volumes-out2.XXXXXX) +tmperr=$(mktemp /tmp/list_volumes-err.XXXXXX) +trap 'rm -f $tmpout $tmpout2 $tmperr' exit +# +# Source the wf_utils file. +wf_utils=$(command -v wf_utils) +if [ -z "$wf_utils" ]; then + if [ ! -x "./wf_utils" ]; then + cat >&2 < /dev/null; then + echo "Error: The required command '$cmd' not found. Please install it." >&2 + exit 1 + fi +done + +token=$(get_token) +if [ -z "$token" ]; then + echo "Error: Failed to obtain an access token. Exiting." >&2 + exit 1 +fi + +jq_query='.snapshots[] | .name + " " + (.creationTime/1000 | strftime("%Y-%m-%d_%H:%M:%S")) + " " + (.size | tostring)' +run_curl GET "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/fsx/v2/credentials/${CREDENTIALS_ID}/regions/${AWS_REGION}/file-systems/${FILESYSTEM_ID}/volumes/${VOLUME_ID}?include=snapshots" $tmpout $tmperr +if jq -r "$jq_query" $tmpout > $tmpout2 2> $tmperr; then + : +else + echo "Error: Failed to parse the output from the API." >&2 + cat $tmperr >&2 + exit 1 +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}/fsx/v2/credentials/${CREDENTIALS_ID}/regions/${AWS_REGION}/file-systems/${FILESYSTEM_ID}/volumes/${VOLUME_ID}?include=snapshots&nextToken=${nextToken}" $tmpout $tmperr + if jq -r "$jq_query" $tmpout >> $tmpout2 2> $tmperr; then + : + else + echo "Error: Failed to parse the output from the API." >&2 + cat $tmperr >&2 + exit 1 + fi + nextToken=$(jq -r '.nextToken' $tmpout) +done +sort -f $tmpout2 | column -t -N "Name,Date,Size" -R 3 From ff192812fcfdf9397c170bcc37139be602e7faef Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Fri, 17 Apr 2026 11:43:59 -0500 Subject: [PATCH 10/11] Made the cicd_clones_create script retreive the volume from the project so the user didn't have to prvoide it; Created a new list_snapshots script so a user can easily get the snapshots; Updated list_cicd_project to list the volume_ID associated with the volume so it can be used with 'list_snapshots'. --- .../cicd_clones_create | 18 +++++++++++------- .../cicd_project_create | 13 ++++++------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create index 3a28f166..717de6d5 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_clones_create @@ -16,7 +16,7 @@ usage() { cat >&2 <&2 exit 1 fi + +URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/projects" +run_curl GET "$token" "$URL" $tmpout $tmperr +VOLUME_ID=$(jq -r '.items[] | select(.projectId == "'$PROJECT_ID'") | .volumeId' $tmpout) +if [ -z "$VOLUME_ID" ]; then + echo "Error: Failed to obtain the volume ID for the project. Exiting." >&2 + exit 1 +fi + body='{ "cloneName": "'$CLONE_NAME'", '$SNAPSHOT_NAME' diff --git a/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create index cb9e3b66..104f4bc4 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create +++ b/Management-Utilities/Workload-Factory-API-Samples/cicd_project_create @@ -16,7 +16,7 @@ usage() { cat >&2 < export BLUEXP_ACCOUNT_ID= export PROJECT_NAME= - export REGION= + export AWS_REGION= EOF exit 1 } @@ -64,14 +64,13 @@ fi . "$wf_utils" # # Process command line arguments. -raw=false while getopts "ht:a:c:n:f:r:v:" opt; do case $opt in t) REFRESH_TOKEN="$OPTARG" ;; a) BLUEXP_ACCOUNT_ID="$OPTARG" ;; c) CREDENTIALS_ID="$OPTARG" ;; n) PROJECT_NAME="$OPTARG" ;; - r) REGION="$OPTARG" ;; + r) AWS_REGION="$OPTARG" ;; f) FILESYSTEM_ID="$OPTARG" ;; v) VOLUME_ID="$OPTARG" ;; *) usage ;; @@ -89,7 +88,7 @@ required_options["CREDENTIALS_ID"]='Error: The Workload Factory credentials ID u You can get a list of credentials by running the "list_credentials" script found in this GitHub repository: https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/Management-Utilities/Workload-Factory-API-Samples\n\n' required_options["PROJECT_NAME"]='Error: The name to assign to the project is required.\n\n' -required_options["REGION"]='Error: The AWS region where the file system is located is required.\n\n' +required_options["AWS_REGION"]='Error: The AWS region where the file system is located is required.\n\n' required_options["FILESYSTEM_ID"]='Error: The ID of the FSx for ONTAP file system where the volume is located is required.\n\n' required_options["VOLUME_ID"]='Error: The ID of the volume to be included in the project is required.\n\n' @@ -115,7 +114,7 @@ body='{ "volumes": [ { "id": "'$VOLUME_ID'", - "region": "'$REGION'", + "region": "'$AWS_REGION'", "fileSystemId": "'$FILESYSTEM_ID'", "credentialsId": "'$CREDENTIALS_ID'" } From ebe2f5740ff07b8eab9f99f39a54c38ecb449ff6 Mon Sep 17 00:00:00 2001 From: Keith Cantrell Date: Fri, 17 Apr 2026 11:44:17 -0500 Subject: [PATCH 11/11] Made the cicd_clones_create script retreive the volume from the project so the user didn't have to prvoide it; Created a new list_snapshots script so a user can easily get the snapshots; Updated list_cicd_project to list the volume_ID associated with the volume so it can be used with 'list_snapshots'. --- .../Workload-Factory-API-Samples/list_cicd_projects | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects index 3ecff31a..4f701379 100755 --- a/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects +++ b/Management-Utilities/Workload-Factory-API-Samples/list_cicd_projects @@ -96,7 +96,7 @@ fi if [ "$raw" = true ]; then jq_query='.' else - jq_query='.items[] | "\(.projectName) \(.projectId) \(.fileSystemId) \(.volumeName) \(.numberOfClones)"' + jq_query='.items[] | "\(.projectName) \(.projectId) \(.fileSystemId) \(.volumeName) \(.volumeId) \(.numberOfClones)"' fi URL="https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/builders/v1/projects" @@ -125,5 +125,5 @@ done if [ "$raw" = true ]; then cat $tmpout2 else - sort -f $tmpout2 | column -t -N "Name,Project ID,File System,Volume Name,Number of Clones" + sort -f $tmpout2 | column -t -N "Name,Project ID,File System,Volume Name,Volume ID,Number of Clones" fi