Skip to content

update_service_template_version async

update_service_template_version(
    template_name: ResourceName,
    major_version: TemplateVersionPart,
    minor_version: TemplateVersionPart,
    *,
    config_overrides: Optional[AsyncProtonClientConfig] = None,
    description: Optional[Description] = None,
    status: Optional[TemplateVersionStatus] = None,
    compatible_environment_templates: Optional[
        CompatibleEnvironmentTemplateInputList
    ] = None,
    supported_component_sources: Optional[
        ServiceTemplateSupportedComponentSourceInputList
    ] = None,
) -> UpdateServiceTemplateVersionOutput

Update a major or minor version of a service template.

Parameters:

  • template_name (ResourceName) –

    The name of the service template.

  • major_version (TemplateVersionPart) –

    To update a major version of a service template, include major Version.

  • minor_version (TemplateVersionPart) –

    To update a minor version of a service template, include minorVersion.

  • description (Optional[Description], default: None ) –

    A description of a service template version to update.

  • status (Optional[TemplateVersionStatus], default: None ) –

    The status of the service template minor version to update.

  • compatible_environment_templates (Optional[CompatibleEnvironmentTemplateInputList], default: None ) –

    An array of environment template objects that are compatible with this service template version. A service instance based on this service template version can run in environments based on compatible templates.

  • supported_component_sources (Optional[ServiceTemplateSupportedComponentSourceInputList], default: None ) –

    An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.

    A change to supportedComponentSources doesn't impact existing component attachments to instances based on this template version. A change only affects later associations.

    For more information about components, see Proton components in the Proton User Guide.

Raises:

Source code in docs_src/capo_proton/_services/async_proton.py
async def update_service_template_version(
    self,
    template_name: "capo_proton.types.resource_name.ResourceName",
    major_version: "capo_proton.types.template_version_part.TemplateVersionPart",
    minor_version: "capo_proton.types.template_version_part.TemplateVersionPart",
    *,
    config_overrides: Optional[AsyncProtonClientConfig] = None,
    description: Optional["capo_proton.types.description.Description"] = None,
    status: Optional[
        "capo_proton.types.template_version_status.TemplateVersionStatus"
    ] = None,
    compatible_environment_templates: Optional[
        "capo_proton.types.compatible_environment_template_input_list.CompatibleEnvironmentTemplateInputList"
    ] = None,
    supported_component_sources: Optional[
        "capo_proton.types.service_template_supported_component_source_input_list.ServiceTemplateSupportedComponentSourceInputList"
    ] = None,
) -> "capo_proton.types.update_service_template_version_output.UpdateServiceTemplateVersionOutput":
    """<p>Update a major or minor version of a service template.</p>

    Args:
        template_name: <p>The name of the service template.</p>
        major_version: <p>To update a major version of a service template, include <code>major Version</code>.</p>
        minor_version: <p>To update a minor version of a service template, include <code>minorVersion</code>.</p>
        description: <p>A description of a service template version to update.</p>
        status: <p>The status of the service template minor version to update.</p>
        compatible_environment_templates: <p>An array of environment template objects that are compatible with this service template version. A service instance based on this service template version can run in environments based on compatible templates.</p>
        supported_component_sources: <p>An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.</p> <note> <p>A change to <code>supportedComponentSources</code> doesn't impact existing component attachments to instances based on this template version. A change only affects later associations.</p> </note> <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>

    Raises:
        capo_proton.errors.access_denied_exception.AccessDeniedException: <p>There <i>isn't</i> sufficient access for performing this action.</p>
        capo_proton.errors.conflict_exception.ConflictException: <p>The request <i>couldn't</i> be made due to a conflicting operation or resource.</p>
        capo_proton.errors.internal_server_exception.InternalServerException: <p>The request failed to register with the service.</p>
        capo_proton.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource <i>wasn't</i> found.</p>
        capo_proton.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_proton.errors.validation_exception.ValidationException: <p>The input is invalid or an out-of-range value was supplied for the input parameter.</p>
        capo_proton.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_proton.types.update_service_template_version_input.UpdateServiceTemplateVersionInput]",
    ) -> AsyncOperationResponse[
        "capo_proton.types.update_service_template_version_output.UpdateServiceTemplateVersionOutput"
    ]:
        import capo_proton._operations.aws_proton20200720.update_service_template_version

        (
            output,
            http_response,
        ) = await capo_proton._operations.aws_proton20200720.update_service_template_version.async_update_service_template_version(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_proton.types.update_service_template_version_input.UpdateServiceTemplateVersionInput",
    ) -> dict[str, Any]:
        import capo_proton.types.update_service_template_version_input

        return capo_proton.types.update_service_template_version_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_proton.types.update_service_template_version_output.UpdateServiceTemplateVersionOutput",
    ) -> dict[str, Any]:
        import capo_proton.types.update_service_template_version_output

        return capo_proton.types.update_service_template_version_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateServiceTemplateVersion",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_proton.types.update_service_template_version_input.UpdateServiceTemplateVersionInput = {
        "template_name": template_name,
        "major_version": major_version,
        "minor_version": minor_version,
    }
    if description is not None:
        input_["description"] = description
    if status is not None:
        input_["status"] = status
    if compatible_environment_templates is not None:
        input_["compatible_environment_templates"] = (
            compatible_environment_templates
        )
    if supported_component_sources is not None:
        input_["supported_component_sources"] = supported_component_sources

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output