PipelineEndpoint Class
Represents a Pipeline workflow that can be triggered from a unique endpoint URL.
PipelineEndpoints can be used to create new versions of a PublishedPipeline while maintaining the same endpoint. PipelineEndpoints are uniquely named within a workspace.
Using the endpoint attribute of a PipelineEndpoint object, you can trigger new pipeline runs from external applications with REST calls. For information about how to authenticate when calling REST endpoints, see https://aka.ms/pl-restep-auth.
For more information about creating and running machine learning pipelines, see https://aka.ms/pl-first-pipeline.
Initialize PipelineEndpoint.
- Inheritance
-
builtins.objectPipelineEndpoint
Constructor
PipelineEndpoint(workspace, id, name, description, status, default_version, endpoint, pipeline_version_list, _pipeline_endpoint_provider=None, _published_pipeline_provider=None, _swaggerurl=None)
Parameters
Name | Description |
---|---|
workspace
Required
|
The workspace the PipelineEndpoint is defined in. |
id
Required
|
The ID of the PipelineEndpoint. |
name
Required
|
The name of the PipelineEndpoint. |
description
Required
|
The description of the PipelineEndpoint. |
status
Required
|
The new status of the PipelineEndpoint: 'Active' or 'Disabled'. |
default_version
Required
|
The default version of pipeline in PipelineEndpoint, auto-increments, starts with "0". |
endpoint
Required
|
The REST endpoint URL for the PipelineEndpoint, which can be used to submit pipeline runs. |
pipeline_version_list
Required
|
The list of PipelineIdVersion objects. |
_pipeline_endpoint_provider
Required
|
<xref:azureml.pipeline.core._aeva_provider._AevaPublishedPipelineProvider>
The PipelineEndpoint provider. |
_pipeline_endpoint_provider
Required
|
The PublishedPipeline provider. |
workspace
Required
|
The workspace object this PipelineEndpoint will belong to. |
id
Required
|
The ID of the PipelineEndpoint. |
name
Required
|
The name of the PipelineEndpoint. |
description
Required
|
The description of the PipelineEndpoint. |
status
Required
|
The new status of the PipelineEndpoint: 'Active' or 'Disabled'. |
default_version
Required
|
The default version of pipeline in PipelineEndpoint, auto-increments, starts with "0" |
endpoint
Required
|
The REST endpoint URL for PipelineEndpoint to submit pipeline runs. |
pipeline_version_list
Required
|
The list of PipelineIdVersion |
_pipeline_endpoint_provider
Required
|
<xref:azureml.pipeline.core._aeva_provider._AevaPublishedPipelineProvider>
The PipelineEndpoint provider. |
_pipeline_endpoint_provider
Required
|
The PublishedPipeline provider. |
swaggerendpoint
Required
|
The Swagger REST endpoint URL for PipelineEndpoint to submit pipeline runs. |
Remarks
A PipelineEndpoint can be created from either a Pipeline or a PublishedPipeline.
An example to publish from a Pipeline or PublishedPipeline is as follows:
from azureml.pipeline.core import PipelineEndpoint
# The pipeline argument can be either a Pipeline or a PublishedPipeline
pipeline_endpoint = PipelineEndpoint.publish(workspace=ws,
name="PipelineEndpointName",
pipeline=pipeline,
description="New Pipeline Endpoint")
Submit a PipelineEndpoint using submit. When submit is called, a PipelineRun is created which in turn creates StepRun objects for each step in the workflow.
An example of how to submit a PipelineEndpoint is as follows:
from azureml.pipeline.core import PipelineEndpoint
pipeline_endpoint = PipelineEndpoint.get(workspace=ws, name="PipelineEndpointName")
pipeline_run = experiment.submit(pipeline_endpoint)
There are a number of optional settings that can be specified when submitting a PipelineEndpoint. These include:
pipeline_parameters: Parameters to pipeline execution, dictionary of {name: value}. See PipelineParameter for more details.
parent_run_id: You can supply a run ID to set the parent run of this pipeline run, which is reflected in RunHistory. The parent run must belong to the same experiment as the one this pipeline is being submitted to.
pipeline_version: The pipeline version to run.
An example to submit a PipelineEndpoint using these settings is as follows:
from azureml.pipeline.core import PipelineEndpoint
pipeline_endpoint = PipelineEndpoint.get(workspace=ws, name="PipelineEndpointName")
pipeline_run = experiment.submit(pipeline_endpoint,
pipeline_parameters={"param1": "value1"},
parent_run_id="<run_id>",
pipeline_version="0")
To add a new version of a PipelineEndpoint use:
from azureml.pipeline.core import PipelineEndpoint
pipeline_endpoint = PipelineEndpoint.get(workspace=ws, name="PipelineEndpointName")
pipeline_endpoint.add(published_pipeline)
See the following notebook for additional information on creating and using PipelineEndpoints: https://aka.ms/pl-ver-endpoint.
Methods
add |
Add the specified pipeline to PipelineEndpoint. |
add_default |
Add the specified pipeline to PipelineEndpoint and set default version to added pipeline version. |
archive |
Archive the PipelineEndpoint. |
disable |
Set the PipelineEndpoint to 'Disabled' and unavailable to run. |
enable |
Set the PipelineEndpoint to 'Active' and available to run. |
get |
Get the PipelineEndpoint by name or ID, throws exception if either is not provided. |
get_all |
Get all active PipelineEndpoints in the current workspace. Get all active PipelineEndpoints. NOTE: This method is being deprecated in favor of PipelineEndpoint.list(). |
get_all_pipelines |
Get list of pipelines in PipelineEndpoint. NOTE: This method is being deprecated in favor of list_pipelines() |
get_all_versions |
Get list of pipelines and corresponding versions in PipelineEndpoint. NOTE: This method is being deprecated in favor of list_versions() |
get_default_version |
Get the default version of PipelineEndpoint. |
get_pipeline |
Get the pipeline of a specified version or the default; throws an exception if the version is not found. |
list |
List active PipelineEndpoints in the current workspace. |
list_pipelines |
Get a list of pipelines associated with the PipelineEndpoint. |
list_versions |
Get a list of pipelines and corresponding versions of the PipelineEndpoint. |
publish |
Create a PipelineEndpoint with the specified name and pipeline/published pipeline. The pipeline endpoint is a REST API that can be used from external applications. For information about how to authenticate when calling REST endpoints, see https://aka.ms/pl-restep-auth. For more information about working with pipeline endpoints, see https://aka.ms/pl-first-pipeline. Throws Exception if a PipelineEndpoint with the given name already exists. |
reactivate |
Reactivate a PipelineEndpoint that was archived. |
set_default |
Set the default version of PipelineEndpoint, throws an exception if the specified pipeline is not found. |
set_default_version |
Set the default version of PipelineEndpoint, throws an exception if the specified version is not found. |
set_name |
Set the name of PipelineEndpoint. |
submit |
Submit a pipeline experiment of given version; if version is none triggers default version of the pipeline. |
add
Add the specified pipeline to PipelineEndpoint.
add(pipeline)
Parameters
Name | Description |
---|---|
pipeline
Required
|
A published pipeline to add. |
add_default
Add the specified pipeline to PipelineEndpoint and set default version to added pipeline version.
add_default(pipeline)
Parameters
Name | Description |
---|---|
pipeline
Required
|
A published pipeline to add as the default version. |
archive
Archive the PipelineEndpoint.
archive()
disable
Set the PipelineEndpoint to 'Disabled' and unavailable to run.
disable()
enable
Set the PipelineEndpoint to 'Active' and available to run.
enable()
get
Get the PipelineEndpoint by name or ID, throws exception if either is not provided.
static get(workspace, id=None, name=None, _workflow_provider=None, _service_endpoint=None)
Parameters
Name | Description |
---|---|
workspace
Required
|
The workspace the PipelineEndpoint was created in. |
id
|
The ID of the PipelineEndpoint. Default value: None
|
name
|
The name of the PipelineEndpoint. Default value: None
|
_workflow_provider
|
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>
The workflow provider. Default value: None
|
_service_endpoint
|
The service endpoint. Default value: None
|
Returns
Type | Description |
---|---|
The PipelineEndpoint object. |
get_all
Get all active PipelineEndpoints in the current workspace.
Get all active PipelineEndpoints. NOTE: This method is being deprecated in favor of PipelineEndpoint.list().
static get_all(workspace, active_only=True, _workflow_provider=None, _service_endpoint=None)
Parameters
Name | Description |
---|---|
workspace
Required
|
The workspace. |
active_only
|
If true, only return PipelineEndpoints which are currently active. Default value: True
|
_workflow_provider
|
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>
The workflow provider. Default value: None
|
_service_endpoint
|
The service endpoint. Default value: None
|
Returns
Type | Description |
---|---|
The list of PipelineEndpoint objects. |
get_all_pipelines
Get list of pipelines in PipelineEndpoint.
NOTE: This method is being deprecated in favor of list_pipelines()
get_all_pipelines(active_only=True, _workflow_provider=None, _service_endpoint=None)
Parameters
Name | Description |
---|---|
active_only
|
Flag to return active only pipelines. Default value: True
|
_workflow_provider
|
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>
The workflow provider. Default value: None
|
_service_endpoint
|
The service endpoint. Default value: None
|
Returns
Type | Description |
---|---|
The list of PublishedPipeline objects. |
get_all_versions
Get list of pipelines and corresponding versions in PipelineEndpoint.
NOTE: This method is being deprecated in favor of list_versions()
get_all_versions(_workflow_provider=None, _service_endpoint=None)
Parameters
Name | Description |
---|---|
_workflow_provider
|
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>
The workflow provider. Default value: None
|
_service_endpoint
|
The service endpoint. Default value: None
|
Returns
Type | Description |
---|---|
The list of PipelineVersion objects. |
get_default_version
Get the default version of PipelineEndpoint.
get_default_version()
Returns
Type | Description |
---|---|
The default version of the pipeline endpoint. |
get_pipeline
Get the pipeline of a specified version or the default; throws an exception if the version is not found.
get_pipeline(version=None)
Parameters
Name | Description |
---|---|
version
|
The version of the pipeline to return. Default value: None
|
Returns
Type | Description |
---|---|
A published pipeline. |
list
List active PipelineEndpoints in the current workspace.
static list(workspace, active_only=True, max_results=100, _workflow_provider=None, _service_endpoint=None)
Parameters
Name | Description |
---|---|
workspace
Required
|
The workspace. |
active_only
|
If true, only return PipelineEndpoints which are currently active. Default value: True
|
max_results
|
max lines of returned PipelineEndpoints Default value: 100
|
_workflow_provider
|
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>
The workflow provider. Default value: None
|
_service_endpoint
|
The service endpoint. Default value: None
|
Returns
Type | Description |
---|---|
The list of PipelineEndpoint objects. |
list_pipelines
Get a list of pipelines associated with the PipelineEndpoint.
list_pipelines(active_only=True, _workflow_provider=None, _service_endpoint=None)
Parameters
Name | Description |
---|---|
active_only
|
Indicates whether to return only active pipelines. Default value: True
|
_workflow_provider
|
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>
The workflow provider. Default value: None
|
_service_endpoint
|
The service endpoint. Default value: None
|
Returns
Type | Description |
---|---|
The list of PublishedPipeline objects. |
list_versions
Get a list of pipelines and corresponding versions of the PipelineEndpoint.
list_versions(_workflow_provider=None, _service_endpoint=None)
Parameters
Name | Description |
---|---|
_workflow_provider
|
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>
The workflow provider. Default value: None
|
_service_endpoint
|
The service endpoint. Default value: None
|
Returns
Type | Description |
---|---|
The list of PipelineVersion objects. |
publish
Create a PipelineEndpoint with the specified name and pipeline/published pipeline.
The pipeline endpoint is a REST API that can be used from external applications. For information about how to authenticate when calling REST endpoints, see https://aka.ms/pl-restep-auth.
For more information about working with pipeline endpoints, see https://aka.ms/pl-first-pipeline.
Throws Exception if a PipelineEndpoint with the given name already exists.
static publish(workspace, name, description, pipeline, _workflow_provider=None, _service_endpoint=None)
Parameters
Name | Description |
---|---|
workspace
Required
|
The workspace to create the PipelineEndpoint in. |
name
Required
|
The name of the PipelineEndpoint. |
description
Required
|
The description of the PipelineEndpoint. |
pipeline
Required
|
The published pipeline or pipeline. |
_service_endpoint
|
The service endpoint. Default value: None
|
_workflow_provider
|
<xref:azureml.pipeline.core._aeva_provider._AevaWorkflowProvider>
The workflow provider. Default value: None
|
Returns
Type | Description |
---|---|
A new PipelineEndpoint. |
Exceptions
Type | Description |
---|---|
reactivate
Reactivate a PipelineEndpoint that was archived.
reactivate(name)
Parameters
Name | Description |
---|---|
name
Required
|
The name to set. |
Returns
Type | Description |
---|---|
A PipelineEndpoint object. |
set_default
Set the default version of PipelineEndpoint, throws an exception if the specified pipeline is not found.
set_default(pipeline)
Parameters
Name | Description |
---|---|
pipeline
Required
|
The published pipeline to set as the default. |
Exceptions
Type | Description |
---|---|
set_default_version
Set the default version of PipelineEndpoint, throws an exception if the specified version is not found.
set_default_version(version)
Parameters
Name | Description |
---|---|
version
Required
|
The version to set as the default version in PipelineEndpoint. |
Exceptions
Type | Description |
---|---|
set_name
Set the name of PipelineEndpoint.
set_name(name)
Parameters
Name | Description |
---|---|
name
Required
|
The name to set. |
submit
Submit a pipeline experiment of given version; if version is none triggers default version of the pipeline.
submit(experiment_name, pipeline_parameters=None, parent_run_id=None, pipeline_version=None)
Parameters
Name | Description |
---|---|
experiment_name
Required
|
The name of the experiment to submit the pipeline in. |
pipeline_parameters
|
Parameters to use in pipeline execution, passed as a dictionary of {name: value}. See PipelineParameter for more details. Default value: None
|
parent_run_id
|
You can supply a run ID to set the parent run of this pipeline run, which is reflected in RunHistory. The parent run must belong to the same experiment as this pipeline is being submitted to. Default value: None
|
pipeline_version
|
The version of pipeline to run. Default value: None
|
Returns
Type | Description |
---|---|
The submitted pipeline run. |
Exceptions
Type | Description |
---|---|
Attributes
default_version
description
endpoint
Get the REST endpoint URL of the PipelineEndpoint.
The endpoint can be used to trigger runs of the pipeline.
Returns
Type | Description |
---|---|
REST endpoint for PipelineEndpoint to run pipeline. |
id
name
pipeline_version_list
status
swaggerurl
Get the REST Swagger URL of the PipelineEndpoint.
The Swagger url can be view schema of the pipeline endpoint.
Returns
Type | Description |
---|---|
REST Swagger for PipelineEndpoint to run pipeline. |