5.2 Manage a step

Summary:

  1. Find and get information about steps

  2. Delete steps

Function Name

Method

Return Type

Description

list_steps

list_steps()

dict

Get a single step if it exists.

get_step

get_step (step_name)

list of dict

Get the list of all steps.

delete_one_step

delete_one_step (step_name)

dict[str, str]

Delete one step.

❓ For step update and deletion, you need the name (the name you provide when creating the step) of the step you want to update/delete. You can find it with function list_steps() (see the previous part).

5.2.1 Find and get information about steps

To get information about a step, we need its name in the environment. You can search its name in the list of step’s name of the environment.

5.2.1.1 Get list of steps

Function definition

To get all steps available in the current environment, you can get a list of step name with this function:

CraftAiSdk.list_steps()

Returns

List of steps represented as dict (with keys “id”, “name”). The return type is a list of dict.

5.2.1.2 Get information about one step

Function definition

Get all information (repository, dependency, …) about one step in the current environment with its name.

CraftAiSdk.get_step(step_name)

Parameters

  • step_name (str) – The name of the step to get.

Returns

The step information (with key “name”) or None if the step does not exist. The return type is a dict.

5.2.2 Delete steps

5.2.2.1 Delete steps function

Function definition

Delete step in the environment with his name.

CraftAiSdk.delete_step(step_name, force_dependents_deletion=False)

Parameters

  • step_name (str) – Name of the step to delete as defined in the create step function.

  • force_dependents_deletion (bool, optional) – if True the associated step’s dependencies will be deleted too (pipeline, pipeline executions, deployments). Defaults to False.

Returns

Deleted step represented as dict (with key “name”). The return type is a dict [str, str].

Warning

You can’t delete a step that is used in a pipeline