update_code_repository¶
- CodeRepositoriesApi.update_code_repository(name, role_id, content_type=None, code_repository_update=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Update code repository description, keywords, or credentials
Updates Description and Keywords (editor+). Omit Credentials while the repository has an AccessKeyStore to remove credentials (set to “N/A”). Provide Credentials.CredentialsName to attach an existing parameter or create new credentials with Username and Password.
- Parameters:
name (str) – RepositoryName of the code repository to update. (required)
role_id (str) – Amorphic role ID sent for authorization. Missing this header returns AUTH-1001. (required)
content_type (str)
code_repository_update (CodeRepositoryUpdate)
_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: PUT /code-repositories/{name}
Request¶
Update description and keywords
{
"Description": "Updated ML utilities repo",
"Keywords": [
"ml",
"utils"
]
}
Attach an existing parameter as credentials
{
"Credentials": {
"CredentialsName": "/adp/amorphic/pstore/user/amp-github-creds"
}
}
Create new git credentials
{
"Credentials": {
"CredentialsName": "new-creds",
"Username": "gituser",
"Password": "ghp_exampletoken",
"CredentialsDescription": "new PAT"
}
}
Success (HTTP 200)¶
Repository updated. Message is “Successfully updated the code repository details”.
Request / response example
{
"Message": "Successfully updated the code repository details"
}
Errors¶
Documented error codes: IPV-1002, AUTH-1012, GE-1034, DB-1002.
HTTP 400
Repository not found, less than editor access, missing CredentialsName, unsupported parameter type, or SageMaker update failure.
Repository does not exist
{
"Message": "IPV-1002 - Invalid RepositoryName - missing-repo, resource not found."
}
Caller is read-only
{
"Message": "AUTH-1012 - User: jdoe requires at least editor access on the resource to perform this action."
}
New credentials without Username/Password
{
"Message": "GE-1034 - Username and Password are required to create the credentials"
}
HTTP 500
DynamoDB update failure. Typical Message is “DB-1002 - Failed to update entry in the dynamoDB table, please check for errors”.
Request / response example
{
"Message": "DB-1002 - Failed to update entry in the dynamoDB table, please check for errors"
}