Skip to content

update_code_repository async

update_code_repository(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    code_repository_name: Optional[EntityName] = None,
    git_config: Optional[GitConfigForUpdate] = None,
) -> UpdateCodeRepositoryOutput

Updates the specified Git repository with the specified values.

Parameters:

  • code_repository_name (Optional[EntityName], default: None ) –

    The name of the Git repository to update.

  • git_config (Optional[GitConfigForUpdate], default: None ) –

    The configuration of the git repository, including the URL and the Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret that contains the credentials used to access the repository. The secret must have a staging label of AWSCURRENT and must be in the following format:

    {"username": UserName, "password": Password}

Raises:

  • ConflictException –

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

  • UnknownServiceError –

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

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def update_code_repository(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    code_repository_name: Optional[
        "capo_sagemaker.types.entity_name.EntityName"
    ] = None,
    git_config: Optional[
        "capo_sagemaker.types.git_config_for_update.GitConfigForUpdate"
    ] = None,
) -> (
    "capo_sagemaker.types.update_code_repository_output.UpdateCodeRepositoryOutput"
):
    """<p>Updates the specified Git repository with the specified values.</p>

    Args:
        code_repository_name: <p>The name of the Git repository to update.</p>
        git_config: <p>The configuration of the git repository, including the URL and the Amazon Resource Name (ARN) of the Amazon Web Services Secrets Manager secret that contains the credentials used to access the repository. The secret must have a staging label of <code>AWSCURRENT</code> and must be in the following format:</p> <p> <code>{"username": <i>UserName</i>, "password": <i>Password</i>}</code> </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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.update_code_repository_input.UpdateCodeRepositoryInput]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.update_code_repository_output.UpdateCodeRepositoryOutput"
    ]:
        import capo_sagemaker._operations.sage_maker.update_code_repository

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.update_code_repository.async_update_code_repository(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateCodeRepository")
    )
    input_: capo_sagemaker.types.update_code_repository_input.UpdateCodeRepositoryInput = {}
    if code_repository_name is not None:
        input_["code_repository_name"] = code_repository_name
    if git_config is not None:
        input_["git_config"] = git_config

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