flytekit.clients.friendly
Directory
Classes
Class | Description |
---|---|
Duration |
A ProtocolMessage. |
SynchronousFlyteClient |
This is a low-level client that users can use to make direct gRPC service calls to the control plane. |
flytekit.clients.friendly.Duration
A ProtocolMessage
Methods
Method | Description |
---|---|
FromJsonString() |
Converts a string to Duration |
FromMicroseconds() |
Converts microseconds to Duration |
FromMilliseconds() |
Converts milliseconds to Duration |
FromNanoseconds() |
Converts nanoseconds to Duration |
FromSeconds() |
Converts seconds to Duration |
FromTimedelta() |
Converts timedelta to Duration |
ToJsonString() |
Converts Duration to string format |
ToMicroseconds() |
Converts a Duration to microseconds |
ToMilliseconds() |
Converts a Duration to milliseconds |
ToNanoseconds() |
Converts a Duration to nanoseconds |
ToSeconds() |
Converts a Duration to seconds |
ToTimedelta() |
Converts Duration to timedelta |
FromJsonString()
def FromJsonString(
value,
):
Converts a string to Duration.
Parameter | Type |
---|---|
value |
FromMicroseconds()
def FromMicroseconds(
micros,
):
Converts microseconds to Duration.
Parameter | Type |
---|---|
micros |
FromMilliseconds()
def FromMilliseconds(
millis,
):
Converts milliseconds to Duration.
Parameter | Type |
---|---|
millis |
FromNanoseconds()
def FromNanoseconds(
nanos,
):
Converts nanoseconds to Duration.
Parameter | Type |
---|---|
nanos |
FromSeconds()
def FromSeconds(
seconds,
):
Converts seconds to Duration.
Parameter | Type |
---|---|
seconds |
FromTimedelta()
def FromTimedelta(
td,
):
Converts timedelta to Duration.
Parameter | Type |
---|---|
td |
ToJsonString()
def ToJsonString()
Converts Duration to string format.
Returns: A string converted from self. The string format will contains 3, 6, or 9 fractional digits depending on the precision required to represent the exact Duration value. For example: “1s”, “1.010s”, “1.000000100s”, “-3.100s”
ToMicroseconds()
def ToMicroseconds()
Converts a Duration to microseconds.
ToMilliseconds()
def ToMilliseconds()
Converts a Duration to milliseconds.
ToNanoseconds()
def ToNanoseconds()
Converts a Duration to nanoseconds.
ToSeconds()
def ToSeconds()
Converts a Duration to seconds.
ToTimedelta()
def ToTimedelta()
Converts Duration to timedelta.
flytekit.clients.friendly.SynchronousFlyteClient
This is a low-level client that users can use to make direct gRPC service calls to the control plane. See the
:std:doc:service spec <idl:protos/docs/service/index>
. This is more user-friendly interface than the
:py:class:raw client <flytekit.clients.raw.RawSynchronousFlyteClient>
so users should try to use this class
first. Create a client by ::
SynchronousFlyteClient(“your.domain:port”, insecure=True)
insecure should be True if your flyteadmin deployment doesn’t have SSL enabled
def SynchronousFlyteClient(
cfg: PlatformConfig,
kwargs,
):
Initializes a gRPC channel to the given Flyte Admin service.
Parameter | Type |
---|---|
cfg |
PlatformConfig |
kwargs |
**kwargs |
Methods
Method | Description |
---|---|
create_download_link() |
None |
create_download_location() |
None |
create_execution() |
This will create an execution for the given execution spec |
create_launch_plan() |
This will create a launch plan definition in the Admin database |
create_task() |
This will create a task definition in the Admin database |
create_upload_location() |
Get a signed url to be used during fast registration |
create_workflow() |
This will create a workflow definition in the Admin database |
get_active_launch_plan() |
Retrieves the active launch plan entity given a named entity identifier (project, domain, name) |
get_control_plane_version() |
Retrieve the Control Plane version from Flyteadmin |
get_data() |
None |
get_domains() |
This returns a list of domains |
get_download_artifact_signed_url() |
Get a signed url for an artifact |
get_download_signed_url() |
None |
get_execution() |
|
get_execution_data() |
Returns signed URLs to LiteralMap blobs for an execution’s inputs and outputs (when available) |
get_execution_metrics() |
Returns metrics partitioning and categorizing the workflow execution time-series |
get_node_execution() |
|
get_node_execution_data() |
Returns signed URLs to LiteralMap blobs for a node execution’s inputs and outputs (when available) |
get_project_domain_attributes() |
Fetches the custom attributes set for a project and domain combination |
get_task_execution() |
|
get_task_execution_data() |
Returns signed URLs to LiteralMap blobs for a node execution’s inputs and outputs (when available) |
get_upload_signed_url() |
Get a signed url to be used during fast registration |
get_workflow_attributes() |
Fetches the custom attributes set for a project, domain, and workflow combination |
list_active_launch_plans_paginated() |
This returns a page of currently active launch plan meta-information for launch plans in a given project and |
list_executions_paginated() |
This returns a page of executions in a given project and domain |
list_launch_plan_ids_paginated() |
This returns a page of identifiers for the launch plans for a given project and domain |
list_launch_plans_paginated() |
This returns a page of launch plan meta-information for launch plans in a given project and domain |
list_matchable_attributes() |
Fetches all custom attributes for a resource type |
list_node_executions() |
Get node executions associated with a given workflow execution |
list_node_executions_for_task_paginated() |
This returns nodes spawned by a specific task execution |
list_node_executions_paginated() |
|
list_projects() |
This will return a list of the projects registered with the Flyte Admin Service |
list_projects_paginated() |
This returns a page of projects |
list_signals() |
This lists signals |
list_task_executions_paginated() |
|
list_task_ids_paginated() |
This returns a page of identifiers for the tasks for a given project and domain |
list_tasks_paginated() |
This returns a page of task metadata for tasks in a given project and domain |
list_workflow_ids_paginated() |
This returns a page of identifiers for the workflows for a given project and domain |
list_workflows_paginated() |
This returns a page of workflow meta-information for workflows in a given project and domain |
recover_execution() |
Recreates a previously-run workflow execution that will only start executing from the last known failure point |
register_project() |
Registers a project |
relaunch_execution() |
|
set_signal() |
This sets a signal |
terminate_execution() |
|
update_launch_plan() |
Updates a launch plan |
update_named_entity() |
Updates the metadata associated with a named entity |
update_project() |
Update an existing project specified by id |
update_project_domain_attributes() |
Sets custom attributes for a project and domain combination |
update_workflow_attributes() |
Sets custom attributes for a project, domain, and workflow combination |
with_root_certificate() |
None |
create_download_link()
def create_download_link(
create_download_link_request: _dataproxy_pb2.CreateDownloadLinkRequest,
):
Parameter | Type |
---|---|
create_download_link_request |
_dataproxy_pb2.CreateDownloadLinkRequest |
create_download_location()
def create_download_location(
create_download_location_request: _dataproxy_pb2.CreateDownloadLocationRequest,
):
Parameter | Type |
---|---|
create_download_location_request |
_dataproxy_pb2.CreateDownloadLocationRequest |
create_execution()
def create_execution(
project,
domain,
name,
execution_spec,
inputs,
):
This will create an execution for the given execution spec.
Parameter | Type |
---|---|
project |
|
domain |
|
name |
|
execution_spec |
|
inputs |
create_launch_plan()
def create_launch_plan(
launch_plan_identifer,
launch_plan_spec,
):
This will create a launch plan definition in the Admin database. Once successful, the launch plan object can be retrieved via the client or viewed via the UI or command-line interfaces.
.. note ::
Overwrites are not supported so any request for a given project, domain, name, and version that exists in the database must match the existing definition exactly. This also means that as long as the request remains identical, calling this method multiple times will result in success.
Parameter | Type |
---|---|
launch_plan_identifer |
|
launch_plan_spec |
create_task()
def create_task(
task_identifer,
task_spec,
):
This will create a task definition in the Admin database. Once successful, the task object can be retrieved via the client or viewed via the UI or command-line interfaces.
.. note ::
Overwrites are not supported so any request for a given project, domain, name, and version that exists in the database must match the existing definition exactly. Furthermore, as long as the request remains identical, calling this method multiple times will result in success.
Parameter | Type |
---|---|
task_identifer |
|
task_spec |
create_upload_location()
def create_upload_location(
create_upload_location_request: _dataproxy_pb2.CreateUploadLocationRequest,
):
Get a signed url to be used during fast registration
Parameter | Type |
---|---|
create_upload_location_request |
_dataproxy_pb2.CreateUploadLocationRequest |
create_workflow()
def create_workflow(
workflow_identifier,
workflow_spec,
):
This will create a workflow definition in the Admin database. Once successful, the workflow object can be retrieved via the client or viewed via the UI or command-line interfaces.
.. note ::
Overwrites are not supported so any request for a given project, domain, name, and version that exists in the database must match the existing definition exactly. Furthermore, as long as the request remains identical, calling this method multiple times will result in success.
Parameter | Type |
---|---|
workflow_identifier |
|
workflow_spec |
get_active_launch_plan()
def get_active_launch_plan(
identifier,
):
Retrieves the active launch plan entity given a named entity identifier (project, domain, name). Raises an error if no active launch plan exists.
Parameter | Type |
---|---|
identifier |
get_control_plane_version()
def get_control_plane_version()
Retrieve the Control Plane version from Flyteadmin.
This method calls Flyteadmin’s GetVersion API to obtain the current version information of the control plane. The retrieved version can be used to enable or disable specific features based on the Flyteadmin version.
Returns: str: The version string of the control plane.
get_data()
def get_data(
flyte_uri: str,
):
Parameter | Type |
---|---|
flyte_uri |
str |
get_domains()
def get_domains()
This returns a list of domains.
get_download_artifact_signed_url()
def get_download_artifact_signed_url(
node_id: str,
project: str,
domain: str,
name: str,
artifact_type: <google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x105ae79b0>,
expires_in: datetime.timedelta,
):
Get a signed url for an artifact.
Parameter | Type |
---|---|
node_id |
str |
project |
str |
domain |
str |
name |
str |
artifact_type |
<google.protobuf.internal.enum_type_wrapper.EnumTypeWrapper object at 0x105ae79b0> |
expires_in |
datetime.timedelta |
get_download_signed_url()
def get_download_signed_url(
native_url: str,
expires_in: datetime.timedelta,
):
Parameter | Type |
---|---|
native_url |
str |
expires_in |
datetime.timedelta |
get_execution()
def get_execution(
id,
):
Parameter | Type |
---|---|
id |
get_execution_data()
def get_execution_data(
id,
):
Returns signed URLs to LiteralMap blobs for an execution’s inputs and outputs (when available).
Parameter | Type |
---|---|
id |
get_execution_metrics()
def get_execution_metrics(
id,
depth,
):
Returns metrics partitioning and categorizing the workflow execution time-series.
Parameter | Type |
---|---|
id |
|
depth |
get_node_execution()
def get_node_execution(
node_execution_identifier,
):
Parameter | Type |
---|---|
node_execution_identifier |
get_node_execution_data()
def get_node_execution_data(
node_execution_identifier,
):
Returns signed URLs to LiteralMap blobs for a node execution’s inputs and outputs (when available).
Parameter | Type |
---|---|
node_execution_identifier |
get_project_domain_attributes()
def get_project_domain_attributes(
project,
domain,
resource_type,
):
Fetches the custom attributes set for a project and domain combination.
Parameter | Type |
---|---|
project |
|
domain |
|
resource_type |
get_task_execution()
def get_task_execution(
id,
):
Parameter | Type |
---|---|
id |
get_task_execution_data()
def get_task_execution_data(
task_execution_identifier,
):
Returns signed URLs to LiteralMap blobs for a node execution’s inputs and outputs (when available).
Parameter | Type |
---|---|
task_execution_identifier |
get_upload_signed_url()
def get_upload_signed_url(
project: str,
domain: str,
content_md5: typing.Optional[bytes],
filename: typing.Optional[str],
expires_in: typing.Optional[datetime.timedelta],
filename_root: typing.Optional[str],
add_content_md5_metadata: bool,
):
Get a signed url to be used during fast registration
Parameter | Type |
---|---|
project |
str |
domain |
str |
content_md5 |
typing.Optional[bytes] |
filename |
typing.Optional[str] |
expires_in |
typing.Optional[datetime.timedelta] |
filename_root |
typing.Optional[str] |
add_content_md5_metadata |
bool |
get_workflow_attributes()
def get_workflow_attributes(
project,
domain,
workflow,
resource_type,
):
Fetches the custom attributes set for a project, domain, and workflow combination.
Parameter | Type |
---|---|
project |
|
domain |
|
workflow |
|
resource_type |
list_active_launch_plans_paginated()
def list_active_launch_plans_paginated(
project,
domain,
limit,
token,
sort_by,
):
This returns a page of currently active launch plan meta-information for launch plans in a given project and domain.
.. note ::
This is a paginated API. Use the token field in the request to specify a page offset token. The user of the API is responsible for providing this token.
.. note ::
If entries are added to the database between requests for different pages, it is possible to receive entries on the second page that also appeared on the first.
Parameter | Type |
---|---|
project |
|
domain |
|
limit |
|
token |
|
sort_by |
list_executions_paginated()
def list_executions_paginated(
project,
domain,
limit,
token,
filters,
sort_by,
):
This returns a page of executions in a given project and domain.
.. note ::
This is a paginated API. Use the token field in the request to specify a page offset token. The user of the API is responsible for providing this token.
.. note ::
If entries are added to the database between requests for different pages, it is possible to receive entries on the second page that also appeared on the first.
Parameter | Type |
---|---|
project |
|
domain |
|
limit |
|
token |
|
filters |
|
sort_by |
list_launch_plan_ids_paginated()
def list_launch_plan_ids_paginated(
project,
domain,
limit,
token,
sort_by,
):
This returns a page of identifiers for the launch plans for a given project and domain. Filters can also be specified.
.. note ::
This is a paginated API. Use the token field in the request to specify a page offset token. The user of the API is responsible for providing this token.
.. note ::
If entries are added to the database between requests for different pages, it is possible to receive entries on the second page that also appeared on the first.
Parameter | Type |
---|---|
project |
|
domain |
|
limit |
|
token |
|
sort_by |
list_launch_plans_paginated()
def list_launch_plans_paginated(
identifier,
limit,
token,
filters,
sort_by,
):
This returns a page of launch plan meta-information for launch plans in a given project and domain. Optionally, specifying a name will limit the results to only workflows with that name in the given project and domain.
.. note ::
This is a paginated API. Use the token field in the request to specify a page offset token. The user of the API is responsible for providing this token.
.. note ::
If entries are added to the database between requests for different pages, it is possible to receive entries on the second page that also appeared on the first.
Parameter | Type |
---|---|
identifier |
|
limit |
|
token |
|
filters |
|
sort_by |
list_matchable_attributes()
def list_matchable_attributes(
resource_type,
):
Fetches all custom attributes for a resource type.
Parameter | Type |
---|---|
resource_type |
list_node_executions()
def list_node_executions(
workflow_execution_identifier,
limit: int,
token: typing.Optional[str],
filters: typing.List[flytekit.models.filters.Filter],
sort_by: flytekit.models.admin.common.Sort,
unique_parent_id: str,
):
Get node executions associated with a given workflow execution.
Parameter | Type |
---|---|
workflow_execution_identifier |
|
limit |
int |
token |
typing.Optional[str] |
filters |
typing.List[flytekit.models.filters.Filter] |
sort_by |
flytekit.models.admin.common.Sort |
unique_parent_id |
str |
list_node_executions_for_task_paginated()
def list_node_executions_for_task_paginated(
task_execution_identifier,
limit,
token,
filters,
sort_by,
):
This returns nodes spawned by a specific task execution. This is generally from things like dynamic tasks.
Parameter | Type |
---|---|
task_execution_identifier |
|
limit |
|
token |
|
filters |
|
sort_by |
list_node_executions_paginated()
def list_node_executions_paginated(
node_execution_list_request,
):
Parameter | Type |
---|---|
node_execution_list_request |
list_projects()
def list_projects(
project_list_request: typing.Optional[ProjectListRequest],
):
This will return a list of the projects registered with the Flyte Admin Service
Parameter | Type |
---|---|
project_list_request |
typing.Optional[ProjectListRequest] |
list_projects_paginated()
def list_projects_paginated(
limit,
token,
filters,
sort_by,
):
This returns a page of projects.
.. note ::
This is a paginated API. Use the token field in the request to specify a page offset token. The user of the API is responsible for providing this token.
.. note ::
If entries are added to the database between requests for different pages, it is possible to receive entries on the second page that also appeared on the first.
Parameter | Type |
---|---|
limit |
|
token |
|
filters |
|
sort_by |
list_signals()
def list_signals(
signal_list_request: SignalListRequest,
):
This lists signals
Parameter | Type |
---|---|
signal_list_request |
SignalListRequest |
list_task_executions_paginated()
def list_task_executions_paginated(
node_execution_identifier,
limit,
token,
filters,
sort_by,
):
Parameter | Type |
---|---|
node_execution_identifier |
|
limit |
|
token |
|
filters |
|
sort_by |
list_task_ids_paginated()
def list_task_ids_paginated(
project,
domain,
limit,
token,
sort_by,
):
This returns a page of identifiers for the tasks for a given project and domain. Filters can also be specified.
.. note ::
This is a paginated API. Use the token field in the request to specify a page offset token. The user of the API is responsible for providing this token.
.. note ::
If entries are added to the database between requests for different pages, it is possible to receive entries on the second page that also appeared on the first.
Parameter | Type |
---|---|
project |
|
domain |
|
limit |
|
token |
|
sort_by |
list_tasks_paginated()
def list_tasks_paginated(
identifier,
limit,
token,
filters,
sort_by,
):
This returns a page of task metadata for tasks in a given project and domain. Optionally, specifying a name will limit the results to only tasks with that name in the given project and domain.
.. note ::
This is a paginated API. Use the token field in the request to specify a page offset token. The user of the API is responsible for providing this token.
.. note ::
If entries are added to the database between requests for different pages, it is possible to receive entries on the second page that also appeared on the first.
Parameter | Type |
---|---|
identifier |
|
limit |
|
token |
|
filters |
|
sort_by |
list_workflow_ids_paginated()
def list_workflow_ids_paginated(
project,
domain,
limit,
token,
sort_by,
):
This returns a page of identifiers for the workflows for a given project and domain. Filters can also be specified.
.. note ::
This is a paginated API. Use the token field in the request to specify a page offset token. The user of the API is responsible for providing this token.
.. note ::
If entries are added to the database between requests for different pages, it is possible to receive entries on the second page that also appeared on the first.
Parameter | Type |
---|---|
project |
|
domain |
|
limit |
|
token |
|
sort_by |
list_workflows_paginated()
def list_workflows_paginated(
identifier,
limit,
token,
filters,
sort_by,
):
This returns a page of workflow meta-information for workflows in a given project and domain. Optionally, specifying a name will limit the results to only workflows with that name in the given project and domain.
.. note ::
This is a paginated API. Use the token field in the request to specify a page offset token. The user of the API is responsible for providing this token.
.. note ::
If entries are added to the database between requests for different pages, it is possible to receive entries on the second page that also appeared on the first.
Parameter | Type |
---|---|
identifier |
|
limit |
|
token |
|
filters |
|
sort_by |
recover_execution()
def recover_execution(
id,
name: str,
):
Recreates a previously-run workflow execution that will only start executing from the last known failure point.
Parameter | Type |
---|---|
id |
|
name |
str |
register_project()
def register_project(
project,
):
Registers a project.
Parameter | Type |
---|---|
project |
relaunch_execution()
def relaunch_execution(
id,
name,
):
Parameter | Type |
---|---|
id |
|
name |
set_signal()
def set_signal(
signal_set_request: SignalSetRequest,
):
This sets a signal
Parameter | Type |
---|---|
signal_set_request |
SignalSetRequest |
terminate_execution()
def terminate_execution(
id,
cause,
):
Parameter | Type |
---|---|
id |
|
cause |
update_launch_plan()
def update_launch_plan(
id,
state,
):
Updates a launch plan. Currently, this can only be used to update a given launch plan’s state (ACTIVE v. INACTIVE) for schedules. If a launch plan with a given project, domain, and name is set to ACTIVE, then any other launch plan with the same project, domain, and name that was set to ACTIVE will be switched to INACTIVE in one transaction.
Parameter | Type |
---|---|
id |
|
state |
update_named_entity()
def update_named_entity(
resource_type,
id,
metadata,
):
Updates the metadata associated with a named entity. A named entity is designated a resource, e.g. a workflow, task or launch plan specified by {project, domain, name} across all versions of the resource.
Parameter | Type |
---|---|
resource_type |
|
id |
|
metadata |
update_project()
def update_project(
project,
):
Update an existing project specified by id.
Parameter | Type |
---|---|
project |
update_project_domain_attributes()
def update_project_domain_attributes(
project,
domain,
matching_attributes,
):
Sets custom attributes for a project and domain combination.
Parameter | Type |
---|---|
project |
|
domain |
|
matching_attributes |
update_workflow_attributes()
def update_workflow_attributes(
project,
domain,
workflow,
matching_attributes,
):
Sets custom attributes for a project, domain, and workflow combination.
Parameter | Type |
---|---|
project |
|
domain |
|
workflow |
|
matching_attributes |
with_root_certificate()
def with_root_certificate(
cfg: PlatformConfig,
root_cert_file: str,
):
Parameter | Type |
---|---|
cfg |
PlatformConfig |
root_cert_file |
str |
Properties
Property | Type | Description |
---|---|---|
raw | ||
url |