Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster/dagster/cli/api.py
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | from dagster.core.snap.execution_plan_snapshot import ( | ||||
ExecutionPlanSnapshot, | ExecutionPlanSnapshot, | ||||
ExecutionPlanSnapshotErrorData, | ExecutionPlanSnapshotErrorData, | ||||
) | ) | ||||
from dagster.core.storage.tags import check_tags | from dagster.core.storage.tags import check_tags | ||||
from dagster.core.telemetry import telemetry_wrapper | from dagster.core.telemetry import telemetry_wrapper | ||||
from dagster.core.types.loadable_target_origin import LoadableTargetOrigin | from dagster.core.types.loadable_target_origin import LoadableTargetOrigin | ||||
from dagster.grpc import DagsterGrpcServer | from dagster.grpc import DagsterGrpcServer | ||||
from dagster.grpc.impl import ( | from dagster.grpc.impl import ( | ||||
get_external_executable_params, | |||||
get_external_execution_plan_snapshot, | get_external_execution_plan_snapshot, | ||||
get_external_job_params, | |||||
get_external_pipeline_subset_result, | get_external_pipeline_subset_result, | ||||
get_external_schedule_execution, | get_external_schedule_execution, | ||||
get_partition_config, | get_partition_config, | ||||
get_partition_names, | get_partition_names, | ||||
get_partition_set_execution_param_data, | get_partition_set_execution_param_data, | ||||
get_partition_tags, | get_partition_tags, | ||||
) | ) | ||||
from dagster.grpc.types import ( | from dagster.grpc.types import ( | ||||
ExecuteRunArgs, | ExecuteRunArgs, | ||||
ExecuteStepArgs, | ExecuteStepArgs, | ||||
ExecutionPlanSnapshotArgs, | ExecutionPlanSnapshotArgs, | ||||
ExternalExecutableArgs, | ExternalJobArgs, | ||||
ExternalScheduleExecutionArgs, | ExternalScheduleExecutionArgs, | ||||
ListRepositoriesInput, | ListRepositoriesInput, | ||||
ListRepositoriesResponse, | ListRepositoriesResponse, | ||||
LoadableRepositorySymbol, | LoadableRepositorySymbol, | ||||
PartitionArgs, | PartitionArgs, | ||||
PartitionNamesArgs, | PartitionNamesArgs, | ||||
PartitionSetExecutionParamArgs, | PartitionSetExecutionParamArgs, | ||||
PipelineSubsetSnapshotArgs, | PipelineSubsetSnapshotArgs, | ||||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | @unary_api_cli_command( | ||||
output_cls=(ExternalScheduleExecutionData, ExternalScheduleExecutionErrorData), | output_cls=(ExternalScheduleExecutionData, ExternalScheduleExecutionErrorData), | ||||
) | ) | ||||
def schedule_execution_data_command(args): | def schedule_execution_data_command(args): | ||||
recon_repo = recon_repository_from_origin(args.repository_origin) | recon_repo = recon_repository_from_origin(args.repository_origin) | ||||
return get_external_schedule_execution(recon_repo, args) | return get_external_schedule_execution(recon_repo, args) | ||||
@unary_api_cli_command( | @unary_api_cli_command( | ||||
name="executable_params", | name="job_params", | ||||
help_str=( | help_str=( | ||||
"[INTERNAL] Return the execution params for a triggered execution. This is an internal " | "[INTERNAL] Return the execution params for a triggered execution. This is an internal " | ||||
"utility. Users should generally not invoke this command interactively." | "utility. Users should generally not invoke this command interactively." | ||||
), | ), | ||||
input_cls=ExternalExecutableArgs, | input_cls=ExternalJobArgs, | ||||
output_cls=(ExternalExecutionParamsData, ExternalExecutionParamsErrorData), | output_cls=(ExternalExecutionParamsData, ExternalExecutionParamsErrorData), | ||||
) | ) | ||||
def executable_params_command(args): | def job_params_command(args): | ||||
recon_repo = recon_repository_from_origin(args.repository_origin) | recon_repo = recon_repository_from_origin(args.repository_origin) | ||||
return get_external_executable_params(recon_repo, args) | return get_external_job_params(recon_repo, args) | ||||
@whitelist_for_serdes | @whitelist_for_serdes | ||||
class ExecuteRunArgsLoadComplete(namedtuple("_ExecuteRunArgsLoadComplete", "")): | class ExecuteRunArgsLoadComplete(namedtuple("_ExecuteRunArgsLoadComplete", "")): | ||||
pass | pass | ||||
@click.command( | @click.command( | ||||
▲ Show 20 Lines • Show All 459 Lines • ▼ Show 20 Lines | def create_api_cli_group(): | ||||
group.add_command(pipeline_subset_snapshot_command) | group.add_command(pipeline_subset_snapshot_command) | ||||
group.add_command(execution_plan_snapshot_command) | group.add_command(execution_plan_snapshot_command) | ||||
group.add_command(list_repositories_command) | group.add_command(list_repositories_command) | ||||
group.add_command(partition_config_command) | group.add_command(partition_config_command) | ||||
group.add_command(partition_tags_command) | group.add_command(partition_tags_command) | ||||
group.add_command(partition_names_command) | group.add_command(partition_names_command) | ||||
group.add_command(partition_set_execution_param_command) | group.add_command(partition_set_execution_param_command) | ||||
group.add_command(schedule_execution_data_command) | group.add_command(schedule_execution_data_command) | ||||
group.add_command(executable_params_command) | group.add_command(job_params_command) | ||||
group.add_command(launch_scheduled_execution) | group.add_command(launch_scheduled_execution) | ||||
group.add_command(grpc_command) | group.add_command(grpc_command) | ||||
return group | return group | ||||
api_cli = create_api_cli_group() | api_cli = create_api_cli_group() |