Skip to content

update_repository_name

update_repository_name(
    old_name: RepositoryName,
    new_name: RepositoryName,
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
) -> None

Renames a repository. The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix .git is prohibited. For more information about the limits on repository names, see Quotas in the CodeCommit User Guide.

Parameters:

Raises:

Source code in docs_src/capo_codecommit/_services/code_commit.py
def update_repository_name(
    self,
    old_name: "capo_codecommit.types.repository_name.RepositoryName",
    new_name: "capo_codecommit.types.repository_name.RepositoryName",
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
) -> None:
    """<p>Renames a repository. The repository name must be unique across the calling Amazon Web Services account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix .git is prohibited. For more information about the limits on repository names, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">Quotas</a> in the CodeCommit User Guide.</p>

    Args:
        old_name: <p>The current name of the repository.</p>
        new_name: <p>The new name for the repository.</p>

    Raises:
        capo_codecommit.errors.invalid_repository_name_exception.InvalidRepositoryNameException: <p>A specified repository name is not valid.</p> <note> <p>This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist.</p> </note>
        capo_codecommit.errors.repository_does_not_exist_exception.RepositoryDoesNotExistException: <p>The specified repository does not exist.</p>
        capo_codecommit.errors.repository_name_exists_exception.RepositoryNameExistsException: <p>The specified repository name already exists.</p>
        capo_codecommit.errors.repository_name_required_exception.RepositoryNameRequiredException: <p>A repository name is required, but was not specified.</p>
        capo_codecommit.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codecommit.types.update_repository_name_input.UpdateRepositoryNameInput]",
    ) -> OperationResponse[None]:
        import capo_codecommit._operations.code_commit_20150413.update_repository_name

        output, http_response = (
            capo_codecommit._operations.code_commit_20150413.update_repository_name.update_repository_name(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateRepositoryName")
    )
    input_: capo_codecommit.types.update_repository_name_input.UpdateRepositoryNameInput = {
        "old_name": old_name,
        "new_name": new_name,
    }

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