-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrefresh_dev_deployment.py
More file actions
47 lines (40 loc) · 1.09 KB
/
refresh_dev_deployment.py
File metadata and controls
47 lines (40 loc) · 1.09 KB
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
# Based on:
# https://github.com/dagster-io/dagster/issues/3803
import requests
import json
RELOAD_REPOSITORY_LOCATION_MUTATION = """
mutation ($repositoryLocationName: String!) {
reloadRepositoryLocation(repositoryLocationName: $repositoryLocationName) {
__typename
... on RepositoryLocation {
name
repositories {
name
}
isReloadSupported
}
... on RepositoryLocationLoadFailure {
name
error {
message
}
}
}
}
"""
dagit_host = "127.0.0.1"
variables = {
"repositoryLocationName": "popgetter",
}
reload_res = requests.post(
"http://{dagit_host}:3000/graphql?query={query_string}&variables={variables}".format(
dagit_host=dagit_host,
query_string=RELOAD_REPOSITORY_LOCATION_MUTATION,
variables=json.dumps(variables),
)
).json()
did_succeed = False
if reload_res:
# did_succeed = reload_res["data"]["reloadRepositoryLocation"]["__typename"] == "RepositoryLocation"
print(reload_res)
print(f"Reload {'succeeded' if did_succeed else 'failed'}")