Skip to content

Commit bcc97b3

Browse files
committed
Fixed an issue when a link didn't have the cloudResourceId assoicated with it.
1 parent 8a44741 commit bcc97b3

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ if [ -z "$token" ]; then
108108
exit 1
109109
fi
110110

111-
run_curl "POST" "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/fsx/v2/credentials/${CREDENTIALS_ID}/regions/${AWS_REGION}/file-systems/${FILESYSTEM_ID}/links" $tmpout $tmperr '{"linkId":"'$LINK_ID'"}'
111+
run_curl "POST" "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/fsx/v2/credentials/${CREDENTIALS_ID}/regions/${AWS_REGION}/file-systems/${FILESYSTEM_ID}/links" $tmpout $tmperr '{"linkId":"'$LINK_ID'"}' application/json

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ if [ -z "$token" ]; then
9494
exit 1
9595
fi
9696

97-
jq_query='.items[] | if(.type == "connector") then "\(.name);\(.id);\(.type);\(.state.status);N/A;N/A;N/A;\(.associatedTargets.items)" else "\(.name);\(.id);\(.type);\(.state.status);\(.region);\(.vpcId);\(.cloudResourceId | split(":") | .[6]);\(.associatedTargets.items)" end'
97+
jq_query='.items[] | if(.type == "connector") then "\(.name);\(.id);\(.type);\(.state.status);N/A;N/A;N/A;\(.associatedTargets.items)" else "\(.name);\(.id);\(.type);\(.state.status);\(.region);\(.vpcId);\(if(.cloudResourceId == null) then "N/A" else .cloudResourceId | split(":") | .[6] end);\(.associatedTargets.items)" end'
9898

9999
run_curl GET "$token" "https://api.workloads.netapp.com/accounts/${BLUEXP_ACCOUNT_ID}/links/v1/links?include=associatedTargets,state,features" $tmpout $tmperr
100100
if jq -r "$jq_query" $tmpout > $tmpout2 2> $tmperr; then

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ run_curl () {
9797

9898
if [ -z "$accept" ]; then
9999
accept="application/json, text/plain, */*"
100-
shift 6
100+
if [ $# -lt 6 ]; then
101+
shift $#
102+
else
103+
shift 6
104+
fi
101105
else
102106
shift 7
103107
fi

0 commit comments

Comments
 (0)