Skip to content

Commit

Permalink
fix test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bma13 committed Aug 13, 2024
1 parent 4860090 commit 7163acc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ if [[ -z "$1" ]]; then
fi
doneflag=0

ARGS=()
GRPCURL="grpcurl -plaintext"
if [[ -n $IAM_TOKEN ]]; then
HEADER="Authorization: Bearer ${IAM_TOKEN}"
GRPCURL="$GRPCURL -H $HEADER"
ARGS+=("-H" "Authorization: Bearer ${IAM_TOKEN}")
fi
if [[ "GetBackup" == "$1" ]]; then
$GRPCURL -d '{"id": "12345678-1234-5678-1234-567812345678"}' localhost:50051 ydbcp.v1alpha1.BackupService.GetBackup
$GRPCURL "${ARGS[@]}" -d '{"id": "12345678-1234-5678-1234-567812345678"}' localhost:50051 ydbcp.v1alpha1.BackupService.GetBackup
doneflag=1
fi
if [[ "ListBackups" == "$1" ]]; then
$GRPCURL -d '{"databaseNameMask": "%", "containerId": "'"$CONTAINER_ID"'"}' localhost:50051 ydbcp.v1alpha1.BackupService.ListBackups
$GRPCURL "${ARGS[@]}" -d '{"databaseNameMask": "%", "containerId": "'"$CONTAINER_ID"'"}' localhost:50051 ydbcp.v1alpha1.BackupService.ListBackups
doneflag=1
fi
if [[ "ListOperations" == "$1" ]]; then
$GRPCURL -d '{"databaseNameMask": "%", "containerId": "'"$CONTAINER_ID"'"}' localhost:50051 ydbcp.v1alpha1.OperationService.ListOperations
$GRPCURL "${ARGS[@]}" -d '{"databaseNameMask": "%", "containerId": "'"$CONTAINER_ID"'"}' localhost:50051 ydbcp.v1alpha1.OperationService.ListOperations
doneflag=1
fi
if [[ "MakeBackup" == "$1" ]]; then
$GRPCURL -d '{"database_name": "/testing-global/ydbc", "database_endpoint": "grpcs://localhost:2135", "source_paths": ["/testing-global/ydbc/orders"], "containerId": "'"$CONTAINER_ID"'"}' localhost:50051 ydbcp.v1alpha1.BackupService.MakeBackup
$GRPCURL "${ARGS[@]}" -d '{"database_name": "/testing-global/ydbc", "database_endpoint": "grpcs://localhost:2135", "source_paths": ["/testing-global/ydbc/orders"], "containerId": "'"$CONTAINER_ID"'"}' localhost:50051 ydbcp.v1alpha1.BackupService.MakeBackup
doneflag=1
fi
if [[ 0 == $doneflag ]]; then
Expand Down

0 comments on commit 7163acc

Please sign in to comment.