Skip to content

create_pipeline

create_pipeline(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    pipeline_name: Optional[PipelineName] = None,
    pipeline_display_name: Optional[PipelineName] = None,
    pipeline_definition: Optional[PipelineDefinition] = None,
    pipeline_definition_s3_location: Optional[PipelineDefinitionS3Location] = None,
    pipeline_description: Optional[PipelineDescription] = None,
    client_request_token: Optional[IdempotencyToken] = None,
    role_arn: Optional[RoleArn] = None,
    tags: Optional[TagList] = None,
    parallelism_configuration: Optional[ParallelismConfiguration] = None,
) -> CreatePipelineResponse

Creates a pipeline using a JSON pipeline definition.

Parameters:

  • pipeline_name (Optional[PipelineName], default: None ) –

    The name of the pipeline.

  • pipeline_display_name (Optional[PipelineName], default: None ) –

    The display name of the pipeline.

  • pipeline_definition (Optional[PipelineDefinition], default: None ) –

    The JSON pipeline definition of the pipeline.

  • pipeline_definition_s3_location (Optional[PipelineDefinitionS3Location], default: None ) –

    The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location.

  • pipeline_description (Optional[PipelineDescription], default: None ) –

    A description of the pipeline.

  • client_request_token (Optional[IdempotencyToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time.

  • role_arn (Optional[RoleArn], default: None ) –

    The Amazon Resource Name (ARN) of the role used by the pipeline to access and create resources.

  • tags (Optional[TagList], default: None ) –

    A list of tags to apply to the created pipeline.

  • parallelism_configuration (Optional[ParallelismConfiguration], default: None ) –

    This is the configuration that controls the parallelism of the pipeline. If specified, it applies to all runs of this pipeline by default.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def create_pipeline(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    pipeline_name: Optional[
        "capo_sagemaker.types.pipeline_name.PipelineName"
    ] = None,
    pipeline_display_name: Optional[
        "capo_sagemaker.types.pipeline_name.PipelineName"
    ] = None,
    pipeline_definition: Optional[
        "capo_sagemaker.types.pipeline_definition.PipelineDefinition"
    ] = None,
    pipeline_definition_s3_location: Optional[
        "capo_sagemaker.types.pipeline_definition_s3_location.PipelineDefinitionS3Location"
    ] = None,
    pipeline_description: Optional[
        "capo_sagemaker.types.pipeline_description.PipelineDescription"
    ] = None,
    client_request_token: Optional[
        "capo_sagemaker.types.idempotency_token.IdempotencyToken"
    ] = None,
    role_arn: Optional["capo_sagemaker.types.role_arn.RoleArn"] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
    parallelism_configuration: Optional[
        "capo_sagemaker.types.parallelism_configuration.ParallelismConfiguration"
    ] = None,
) -> "capo_sagemaker.types.create_pipeline_response.CreatePipelineResponse":
    """<p>Creates a pipeline using a JSON pipeline definition.</p>

    Args:
        pipeline_name: <p>The name of the pipeline.</p>
        pipeline_display_name: <p>The display name of the pipeline.</p>
        pipeline_definition: <p>The <a href="https://aws-sagemaker-mlops.github.io/sagemaker-model-building-pipeline-definition-JSON-schema/">JSON pipeline definition</a> of the pipeline.</p>
        pipeline_definition_s3_location: <p>The location of the pipeline definition stored in Amazon S3. If specified, SageMaker will retrieve the pipeline definition from this location.</p>
        pipeline_description: <p>A description of the pipeline.</p>
        client_request_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time.</p>
        role_arn: <p>The Amazon Resource Name (ARN) of the role used by the pipeline to access and create resources.</p>
        tags: <p>A list of tags to apply to the created pipeline.</p>
        parallelism_configuration: <p>This is the configuration that controls the parallelism of the pipeline. If specified, it applies to all runs of this pipeline by default.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.create_pipeline_request.CreatePipelineRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.create_pipeline_response.CreatePipelineResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_pipeline

        output, http_response = (
            capo_sagemaker._operations.sage_maker.create_pipeline.create_pipeline(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePipeline")
    )
    input_: capo_sagemaker.types.create_pipeline_request.CreatePipelineRequest = {}
    if pipeline_name is not None:
        input_["pipeline_name"] = pipeline_name
    if pipeline_display_name is not None:
        input_["pipeline_display_name"] = pipeline_display_name
    if pipeline_definition is not None:
        input_["pipeline_definition"] = pipeline_definition
    if pipeline_definition_s3_location is not None:
        input_["pipeline_definition_s3_location"] = pipeline_definition_s3_location
    if pipeline_description is not None:
        input_["pipeline_description"] = pipeline_description
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if tags is not None:
        input_["tags"] = tags
    if parallelism_configuration is not None:
        input_["parallelism_configuration"] = parallelism_configuration

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output