delete_code_repository¶
- CodeRepositoriesApi.delete_code_repository(name, role_id, should_retain_repository=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Delete a code repository
Deletes the SageMaker repository, metadata, and ACL. Owner access is required. Blocked when datalabs still attach the repository as default or additional. For CodeCommit created in Amorphic, the AWS repo is deleted unless should_retain_repository is truthy.
- Parameters:
name (str) – RepositoryName of the code repository to delete. (required)
role_id (str) – Amorphic role ID sent for authorization. Missing this header returns AUTH-1001. (required)
should_retain_repository (bool) – When truthy, keeps the underlying CodeCommit repository after Amorphic metadata is deleted. Applies only when the repository was created in Amorphic (CreateRepository=true). Omit to delete CodeCommit as well.
_request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.
_request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.
_content_type (str, Optional) – force content-type for the request.
_headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.
_host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.
- Return type:
- Returns:
Returns the result object.
Request and Response Examples¶
HTTP: DELETE /code-repositories/{name}
Success (HTTP 200)¶
Repository deleted. Message is “Successfully deleted the code repository with name - {name}”.
Request / response example
{
"Message": "Successfully deleted the code repository with name - feature-store-utils"
}
Errors¶
Documented error codes: AUTH-1012, GE-1044.
HTTP 400
Datalabs still attached, not owner, repository not found, or CodeCommit/SageMaker delete failure. Dependent failures include DependentResources as a list of datalab names.
Attached as a default datalab repository
{
"Message": "There are datalabs to which the code repository is attached as default repository, remove the dependency to delete the code repository",
"DependentResources": [
"lab-analytics"
]
}
Attached as an additional datalab repository
{
"Message": "There are datalabs to which the code repository is attached as additional repository, remove the dependency to delete the code repository",
"DependentResources": [
"lab-ml"
]
}
Caller is not owner
{
"Message": "AUTH-1012 - User: jdoe requires at least owner access on the resource to perform this action."
}
HTTP 500
Uncaught backend failure. Typical Message is “GE-1044 - Unexpected error - {ex}.”
Request / response example
{
"Message": "GE-1044 - Unexpected error - Could not complete the request. Please try again."
}