Differential D8508 Diff 40125 examples/docs_snippets/docs_snippets/concepts/dagit/graphql/client_example.py
Changeset View
Changeset View
Standalone View
Standalone View
examples/docs_snippets/docs_snippets/concepts/dagit/graphql/client_example.py
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | |||||
if reload_info.status == ReloadRepositoryLocationStatus.SUCCESS: | if reload_info.status == ReloadRepositoryLocationStatus.SUCCESS: | ||||
do_something_on_success() | do_something_on_success() | ||||
else: | else: | ||||
raise Exception( | raise Exception( | ||||
"Repository location reload failed because of a " | "Repository location reload failed because of a " | ||||
f"{reload_info.failure_type} error: {reload_info.message}" | f"{reload_info.failure_type} error: {reload_info.message}" | ||||
) | ) | ||||
# end_reload_repo_location_marker | # end_reload_repo_location_marker | ||||
# start_shutdown_repo_location_marker | |||||
from dagster_graphql import ( | |||||
ShutdownRepositoryLocationInfo, | |||||
ShutdownRepositoryLocationStatus, | |||||
) | |||||
shutdown_info: ShutdownRepositoryLocationInfo = client.shutdown_repository_location(REPO_NAME) | |||||
if shutdown_info.status == ShutdownRepositoryLocationStatus.SUCCESS: | |||||
do_something_on_success() | |||||
else: | |||||
raise Exception(f"Repository location shutdown failed: {shutdown_info.message}") | |||||
# end_shutdown_repo_location_marker |