Spencer Guy
10/08/2022, 3:40 PMArchie Kennedy
10/09/2022, 3:49 PMimport requests
query = """
mutation LaunchRunMutation(
$repositoryLocationName: String!
$repositoryName: String!
$jobName: String!
$runConfigData: RunConfigData!
) {
launchRun(
executionParams: {
selector: {
repositoryLocationName: $repositoryLocationName
repositoryName: $repositoryName
jobName: $jobName
}
runConfigData: $runConfigData
}
) {
__typename
... on LaunchRunSuccess {
run {
runId
}
}
... on RunConfigValidationInvalid {
errors {
message
reason
}
}
... on PythonError {
message
}
}
}
"""
variables = {
"repositoryLocationName": "your_dagster_repo",
"repositoryName": "your_dagster_repo",
"jobName": "your_job",
"runConfigData": {} # This is where op config goes
}
response = <http://requests.post|requests.post>(
"<https://your-dagster.dagster.cloud/prod/graphql>",
json={"query": query, "variables": variables},
headers={"Dagster-Cloud-Api-Token": "<DAGSTER CLOUD SECRET>"},
)
Spencer Guy
10/13/2022, 9:39 PM