This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgcurl.sh
executable file
·55 lines (38 loc) · 1.6 KB
/
gcurl.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
MANETUQL_PAT="e0f671e2-924b-43cf-8da7-d06433d370fe"
TRACE="--trace-ascii tracefile"
FLAGS="--show-error --fail"
URL="https://portal.eu.manetu.io/graphql"
PROVIDER="pr1"
PROVIDER2="pr2"
USER="user1"
USER2="user2"
function mutate {
QUERY=`echo '{ "query":"mutation {' $1 '}" }'`
echo "Mutate: |$QUERY|"
echo -n "Response: "
curl --data "$QUERY" $TRACE $FLAGS --header 'Content-Type: application/json' -u ":$MANETUQL_PAT" "$URL"
echo; echo
}
function query {
QUERY=`echo '{ "query":"query {' $1 '}" }'`
echo "Query: |$QUERY|"
echo -n "Response: "
curl --data "$QUERY" $TRACE $FLAGS --header 'Content-Type: application/json' -u ":$MANETUQL_PAT" "$URL"
echo; echo
}
# Mutations
mutate 'create_vault (label:\"'$USER'\", role: USER) { label bid sid created last_updated role state }'
mutate 'upsert_vault (label:\"'$USER'\", role: USER) { label bid sid created last_updated role state }'
#Queries
#Attributes
query 'get_provider_vaults(labels:[\"'$PROVIDER'\"]) { label name attributes(sparql_expr:\"SELECT ?s ?p ?o WHERE { ?s ?p ?o }\"){ name value } }'
query 'get_password_reset_questions { last_updated questions secrets }'
query 'get_profile { name email }'
query 'get_provider { activity { last_ts } }'
query 'get_provider_policy { policy { created default_choice description from last_updated legalese to } pupid }'
query 'get_provider_task_counts { all }'
query 'get_provider_tasks { assignee description }'
query 'get_provider_vaults(labels:[\"'$USER'\"]) { name label }'
#All Vaults
query 'get_provider_vaults(scope:ALL) { label }'
query 'get_user_vaults(providers:\"'$PROVIDER'\" roles:\"ADMIN\") { label }'