Skip to content

Commit 20775c9

Browse files
committed
Added Workload Factory API Samples
1 parent 78e8bae commit 20775c9

File tree

8 files changed

+17
-19
lines changed

8 files changed

+17
-19
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ usage() {
1717
cat >&2 <<EOF
1818
This script will break a SnapMirror relationship on a FSx for ONTAP file systems.
1919
20-
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c destionation_credentials_id -r destionation_aws_region -f destionation_fs_id -s snapmirror_id
20+
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c destination_credentials_id -r destination_aws_region -f destination_fs_id -s snapmirror_id
2121
2222
Where: refresh_token - Is a refresh token used to obtain an access token needed
2323
to run the Workload Factory APIs. You can obtain a refresh
@@ -29,7 +29,7 @@ Where: refresh_token - Is a refresh token used to obtain an access token needed
2929
Workload Factory credentials you have access to
3030
destination_aws_region - is the AWS region where the destination file system is located
3131
destination_fs_id - is the AWS file system ID of the file system that is the
32-
destionation of the relationship relationship
32+
destination of the relationship relationship
3333
snapmirror_id - is the SnapMirror Relationship ID of the relationship to break. Run
3434
'list_snapmirrors' to get a list of relationships you have access to
3535

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This script is used to create a SnapMirror relationship on a FSx for ONTAP file
1919
2020
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID [-l throttle] [-s schedule] \\
2121
-C source_credentials_id -R source_aws_region -F source_fs_id [-Y source_type] -M source_svm_ID -N source_svm_name -V source_volume \\
22-
-c destionation_credentials_id -r destionation_aws_region -f destionation_fs_id [-y destination_type] -m destination_svm_ID -n destination_svm_name
22+
-c destination_credentials_id -r destination_aws_region -f destination_fs_id [-y destination_type] -m destination_svm_ID -n destination_svm_name
2323
2424
Where: refresh_token - Is a refresh token used to obtain an access token needed
2525
to run the Workload Factory APIs. You can obtain a refresh
@@ -42,7 +42,7 @@ Where: refresh_token - Is a refresh token used to obtain an access token needed
4242
destination_credentials_ID - is the Workload Factory credentials ID for the AWS account. Run
4343
'list_credentials' to get a list of credentials you have access to
4444
destination_aws_region - is the AWS region where the destination file system is located
45-
destination_fs_ID - is the AWS file system ID of the file system that is the destionation of the relationship relationship
45+
destination_fs_ID - is the AWS file system ID of the file system that is the destination of the relationship relationship
4646
destination_svm_ID - is the SVM ID of the within destination file system where you want the volume replicated to
4747
destination_svm_name - is the name of the SVM on the destination file system where you want the volume replicated to
4848
destination_type - is the type of the destination file system. Either 'FSx' or 'on-prem' (optional, defaults to "FSx")

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
################################################################################
1616
usage() {
1717
cat >&2 <<EOF
18-
This script ill delete a SnapMirror relationship on a FSx for ONTAP file system.
18+
This script will delete a SnapMirror relationship on a FSx for ONTAP file system.
1919
2020
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -s snapmirror_ID \\
2121
-C source_credentials_id -R source_aws_region -F source_fs_id [-Y source_type] \\
22-
-c destionation_credentials_id -r destionation_aws_region -f destionation_fs_id [-y destination_type]
22+
-c destination_credentials_id -r destination_aws_region -f destination_fs_id [-y destination_type]
2323
2424
Where: refresh_token - Is a refresh token used to obtain an access token needed
2525
to run the Workload Factory APIs. You can obtain a refresh
@@ -37,7 +37,7 @@ Where: refresh_token - Is a refresh token used to obtain an access token needed
3737
destination_credentials_ID - is the Workload Factory credentials ID for the AWS account. Run
3838
'list_credentials' to get a list of credentials you have access to
3939
destination_aws_region - is the AWS region where the destination file system is located
40-
destination_fs_ID - is the AWS file system ID of the file system that is the destionation of the relationship relationship
40+
destination_fs_ID - is the AWS file system ID of the file system that is the destination of the relationship relationship
4141
destination_type - is the type of the destination file system. Either 'FSx' or 'on-prem' (optional, defaults to "FSx")
4242
4343
Instead of passing parameters on the command line, you can set the

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ usage() {
1717
cat >&2 <<EOF
1818
This script will re-sync a SnapMirror relationships on a FSx for ONTAP file system.
1919
20-
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c destionation_credentials_id -r destionation_aws_region -f destionation_fs_id -s snapmirror_id
20+
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c destination_credentials_id -r destination_aws_region -f destination_fs_id -s snapmirror_id
2121
2222
Where: refresh_token - Is a refresh token used to obtain an access token needed
2323
to run the Workload Factory APIs. You can obtain a refresh
@@ -27,7 +27,7 @@ Where: refresh_token - Is a refresh token used to obtain an access token needed
2727
destination_credentials_ID - is the Workload Factory credentials ID for the AWS account. Run
2828
'list_credentials' to get a list of credentials you have access to
2929
destination_aws_region - is the AWS region where the destination file system is located
30-
destination_fs_id - is the AWS file system ID of the file system that is the destionation of the relationship relationship
30+
destination_fs_id - is the AWS file system ID of the file system that is the destination of the relationship relationship
3131
snapmirror_id - is the SnapMirror Relationship ID of the relationship to break
3232
3333
Instead of passing parameters on the command line, you can set the

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ usage() {
1717
cat >&2 <<EOF
1818
This script will reverse a SnapMirror relationship on a FSx for ONTAP file system.
1919
20-
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c destionation_credentials_id -r destionation_aws_region -f destionation_fs_id -s snapmirror_id
20+
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c destination_credentials_id -r destination_aws_region -f destination_fs_id -s snapmirror_id
2121
2222
Where: refresh_token - Is a refresh token used to obtain an access token needed
2323
to run the Workload Factory APIs. You can obtain a refresh
@@ -27,7 +27,7 @@ Where: refresh_token - Is a refresh token used to obtain an access token needed
2727
destination_credentials_ID - is the Workload Factory credentials ID for the AWS account. Run
2828
'list_credentials' to get a list of credentials you have access to
2929
destination_aws_region - is the AWS region where the destination file system is located
30-
destination_fs_id - is the AWS file system ID of the file system that is the destionation of the relationship relationship
30+
destination_fs_id - is the AWS file system ID of the file system that is the destination of the relationship relationship
3131
snapmirror_id - is the SnapMirror Relationship ID of the relationship to break
3232
3333
Instead of passing parameters on the command line, you can set the

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ usage() {
1717
cat >&2 <<EOF
1818
This script will update a SnapMirror relationship on a FSx for ONTAP file system.
1919
20-
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c destionation_credentials_id -r destionation_aws_region -f destionation_fs_id -s snapmirror_id
20+
Usage: $(basename $0) -t refresh_token -a blueXP_account_ID -c destination_credentials_id -r destination_aws_region -f destination_fs_id -s snapmirror_id
2121
2222
Where: refresh_token - Is a refresh token used to obtain an access token needed
2323
to run the Workload Factory APIs. You can obtain a refresh
@@ -27,7 +27,7 @@ Where: refresh_token - Is a refresh token used to obtain an access token needed
2727
destination_credentials_ID - is the Workload Factory credentials ID for the AWS account. Run
2828
'list_credentials' to get a list of credentials you have access to
2929
destination_aws_region - is the AWS region where the destination file system is located
30-
destination_fs_id - is the AWS file system ID of the file system that is the destionation of the relationship relationship
30+
destination_fs_id - is the AWS file system ID of the file system that is the destination of the relationship relationship
3131
snapmirror_id - is the SnapMirror Relationship ID of the relationship to update
3232
3333
Instead of passing parameters on the command line, you can set the

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ done
6767
missing_args=false
6868
if [ -z "$REFRESH_TOKEN" ]; then
6969
cat >&2 <<EOF
70-
Error: A BlueXP refresh tokon is required to run this script.
70+
Error: A BlueXP refresh token is required to run this script.
7171
Can you be obtain from this web page:
7272
7373
https://services.cloud.netapp.com/refresh-token

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ get_token() {
4646

4747
createToken=false
4848
if [ -r $tokenFile ]; then
49-
let diff=(`date +%s` - `date -r $tokenFile +%s`)
49+
let diff="$(date +%s) - $(date -r wf_utils +%s)"
5050
if [ $diff -gt $token_valid ]; then
5151
createToken=true
5252
fi
@@ -155,12 +155,10 @@ urlencode() {
155155
echo "$@" | awk -v ORS="" '{ gsub(/./,"&\n") ; print }' | while read l
156156
do
157157
c="`echo "$l" | grep '[^-._~0-9a-zA-Z]'`"
158-
if [ "$l" == "" ]
159-
then
158+
if [ "$l" == "" ]; then
160159
echo -n "%20"
161160
else
162-
if [ -z "$c" ]
163-
then
161+
if [ -z "$c" ]; then
164162
echo -n "$l"
165163
else
166164
printf %%%02X \'"$c"

0 commit comments

Comments
 (0)