Skip to content

Commit

Permalink
Log commented section checkpoints in example.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mmore500 committed Dec 31, 2023
1 parent 4b19db4 commit 15e3af9
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions scripts/example/example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ fi

# Let us try several requests:

# List all users:
log_checkpoint "List all users:"
curl -v --location --request GET 'http://localhost:8080/users?provider=google' --header "Authorization: Bearer $TOKEN"

# List all taxa
log_checkpoint "List all taxa"
echo -n "Taxa: "
curl --location --request GET 'http://localhost:8080/taxa?provider=google' --header "Authorization: Bearer $TOKEN"
echo

# Create taxon:
log_checkpoint "Create taxon:"
curl -v --location --request PUT 'http://localhost:8080/taxa/bbacilliformis?provider=google' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $TOKEN" \
Expand All @@ -76,17 +76,17 @@ curl -v --location --request PUT 'http://localhost:8080/taxa/bbacilliformis?prov
"description": "Example taxon"
}'

# List all loci:
log_checkpoint "List all loci:"
echo -n "Loci: "
curl --location --request GET 'http://localhost:8080/taxa/bbacilliformis/loci?provider=google' \
--header "Authorization: Bearer $TOKEN"
echo

# Delete locus (mark deprecated):
log_checkpoint "Delete locus (mark deprecated):"
curl -v --location --request DELETE 'http://localhost:8080/taxa/bbacilliformis/loci/ftsZ?provider=google' \
--header "Authorization: Bearer $TOKEN"

# Create locus:
log_checkpoint "Create locus:"
for x in locus1 locus2 locus3 locus4 locus5 locus6 locus7; do
curl -v --location --request PUT "http://localhost:8080/taxa/bbacilliformis/loci/$x?provider=google" \
--header 'Content-Type: application/json' \
Expand All @@ -97,15 +97,15 @@ for x in locus1 locus2 locus3 locus4 locus5 locus6 locus7; do
}";
done

# Load alleles:
log_checkpoint "Load alleles:"
for x in 1 2 3 4 5 6 7; do
curl -v --location --request POST "http://localhost:8080/taxa/bbacilliformis/loci/locus${x}/alleles/files?provider=google" \
--header 'Content-Type: multipart/form-data' \
--header "Authorization: Bearer $TOKEN" \
--form "file=@profiles_${x}.txt" ;
done

# List alleles:
log_checkpoint "List alleles:"
for x in 1 2 3 4 5 6 7; do
echo -n "Alleles[locus${x}]: "
curl --location --request GET "http://localhost:8080/taxa/bbacilliformis/loci/locus${x}/alleles?provider=google" \
Expand All @@ -118,7 +118,7 @@ curl --location --request GET "http://localhost:8080/taxa/bbacilliformis/loci/lo
--header "Authorization: Bearer $TOKEN"
echo

# List all schemas:
log_checkpoint "List all schemas:"
echo -n "Schemas: "
curl --location --request GET 'http://localhost:8080/taxa/bbacilliformis/schemas?provider=google' \
--header "Authorization: Bearer $TOKEN"
Expand All @@ -128,7 +128,7 @@ curl --location --request GET 'http://localhost:8080/taxa/bbacilliformis/schemas
--header "Authorization: Bearer $TOKEN"
echo

# Create schema:
log_checkpoint "Create schema:"
curl -v --location --request PUT "http://localhost:8080/taxa/bbacilliformis/schemas/mlst7?provider=google" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $TOKEN" \
Expand All @@ -140,12 +140,12 @@ curl -v --location --request PUT "http://localhost:8080/taxa/bbacilliformis/sche
"loci": ["locus1", "locus2", "locus3", "locus4", "locus5", "locus6", "locus7"]
}';

# List all projects:
log_checkpoint "List all projects:"
echo -n "Projects: "
curl --location --request GET 'http://localhost:8080/projects?provider=google' --header "Authorization: Bearer $TOKEN"
echo

# Create project:
log_checkpoint "Create project:"
curl -v --location --request POST 'http://localhost:8080/projects?provider=google' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $TOKEN" \
Expand Down Expand Up @@ -174,13 +174,13 @@ else
fi


# List all datasets:
log_checkpoint "List all datasets:"
echo -n "Datasets: "
curl --location --request GET "http://localhost:8080/projects/$PROJECT/datasets?provider=google" \
--header "Authorization: Bearer $TOKEN"
echo

# Create dataset:
log_checkpoint "Create dataset:"
curl -v --location --request POST "http://localhost:8080/projects/$PROJECT/datasets?provider=google" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $TOKEN" \
Expand All @@ -206,13 +206,13 @@ else
echo "ok DATASET is defined."
fi

# Load profiles:
log_checkpoint "Load profiles:"
curl -v --location --request POST "http://localhost:8080/projects/$PROJECT/datasets/$DATASET/profiles/files?provider=google" \
--header 'Content-Type: multipart/form-data' \
--header "Authorization: Bearer $TOKEN" \
--form 'file=@profiles.txt'

# List profiles:
log_checkpoint "List profiles:"
echo -n "Profiles: "
curl --location --request GET "http://localhost:8080/projects/$PROJECT/datasets/$DATASET/profiles?provider=google" \
--header "Authorization: Bearer $TOKEN"
Expand All @@ -224,7 +224,7 @@ for x in $(seq 10); do
echo;
done

# Run inference:
log_checkpoint "Run inference:"
curl -v --location --request POST "http://localhost:8080/projects/$PROJECT/jobs?provider=google" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $TOKEN" \
Expand All @@ -234,7 +234,7 @@ curl -v --location --request POST "http://localhost:8080/projects/$PROJECT/jobs?
\"parameters\": [\"$DATASET\", 3]
}"

# List inferences:
log_checkpoint "List inferences:"
echo -n "Inferences: "
curl --location --request GET "http://localhost:8080/projects/$PROJECT/datasets/$DATASET/inferences?provider=google" \
--header "Authorization: Bearer $TOKEN"
Expand Down

0 comments on commit 15e3af9

Please sign in to comment.