Skip to content

Commit 36109b6

Browse files
committed
Made some minor changes.
1 parent ff25342 commit 36109b6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Management-Utilities/Workload-Factory-API-Samples/link_associate

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ usage() {
1616
cat >&2 <<EOF
1717
This script is used to associate a link to an FSx for ONTAP file system.
1818
19-
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c credentials_id -r aws_region -f filesystem_ID -l link_id
19+
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c credentials_ID -r aws_region -f filesystem_ID -l link_ID
2020
2121
Where: refresh_token - Is a refresh token used to obtain an access token needed
2222
to run the Workload Factory APIs. You can obtain a refresh
@@ -26,8 +26,8 @@ Where: refresh_token - Is a refresh token used to obtain an access token needed
2626
credentials_ID - is the Workload Factory credentials ID for the AWS account. Run
2727
'list_credentials' to get a list of credentials you have access to
2828
aws_region - is the AWS region where the FSx file systems are located
29-
filesystem_id - is the AWS file system ID of the FSx file system where the volume resides
30-
link_id - Is the id of the link you want to disassociate
29+
filesystem_ID - is the AWS file system ID of the FSx file system where the volume resides
30+
link_ID - Is the id of the link you want to disassociate
3131
3232
Instead of passing parameters on the command line, you can set the
3333
following environment variables:

Management-Utilities/Workload-Factory-API-Samples/list_credentials

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ if [ -z "$token" ]; then
106106
fi
107107

108108
run_curl GET "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/credentials/v1/credentials?$filter" $tmpout $tmperr
109-
if jq -r '.items[] | if(.type == "ONTAP") then "\(.metadata.fileSystemId) \(.type) \(.accountId) \(.id)" else "\(.metadata.name) \(.type) \(.credentials | split(":") | .[4]) \(.id)" end' $tmpout > $tmpout2 2> $tmperr; then
109+
if jq -r '.items[] | if(.type == "ONTAP") then "\(if(.metadata.fileSystemId == null) then .metadata.onPremId else .metadata.fileSystemId end) \(.type) \(.metadata.userName) \(.id) \(.numAssociatedResources)" else "\(.metadata.name) \(.type) \(.credentials | split(":") | .[4]) \(.id) \(.numAssociatedResources)" end' $tmpout > $tmpout2 2> $tmperr; then
110110
:
111111
else
112112
echo "Failed to parse the output from the API."
@@ -118,7 +118,7 @@ fi
118118
nextToken=$(jq -r '.nextToken' $tmpout)
119119
while [ "$nextToken" != "null" ]; do
120120
run_curl GET "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/credentials/v1/credentials?nextToken=$nextToken&$filter" $tmpout $tmperr
121-
if jq -r '.items[] | if(.type == "ONTAP") then "\(.metadata.fileSystemId) \(.type) \(.accountId) \(.id)" else "\(.metadata.name) \(.type) \(.credentials | split(":") | .[4]) \(.id)" end' $tmpout >> $tmpout2 2> $tmperr; then
121+
if jq -r '.items[] | if(.type == "ONTAP") then "\(if(.metadata.fileSystemId == null) then .metadata.onPremId else .metadata.fileSystemId end) \(.type) \(.metadata.userName) \(.id) \(.numAssociatedResources)" else "\(.metadata.name) \(.type) \(.credentials | split(":") | .[4]) \(.id) \(.numAssociatedResources)" end' $tmpout >> $tmpout2 2> $tmperr; then
122122
:
123123
else
124124
echo "Failed to parse the output from the API."
@@ -128,4 +128,4 @@ while [ "$nextToken" != "null" ]; do
128128
nextToken=$(jq -r '.nextToken' $tmpout)
129129
done
130130

131-
sort -f -k 2,2 -k 1,1 $tmpout2 | column -t -N "Name,Type,Account,ID"
131+
sort -f -k 2,2 -k 1,1 $tmpout2 | column -t -N "Name,Type,Account,ID,Number_Associated_Resources"

0 commit comments

Comments
 (0)