delete_mail_server¶
- ManagementApi.delete_mail_server(role_id, server_id, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)¶
Delete a mail server
Deletes a mail server from DynamoDB and its SSM credentials. Requires system-settings.fullaccess. Unknown ids are not rejected with 400; SSM delete or audit then fails as 500. Service users are rejected (GE-1014).
- Parameters:
role_id (str) – Amorphic role ID the request is authorized against. Must be a role the user belongs to. Also recorded in audit logs. (required)
server_id (str) – Mail server id (server-<uuid>). (required)
_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 /mailservers/{server_id}
Success (HTTP 200)¶
Server and SSM parameter were deleted.
Request / response example
{
"Message": "Successfully deleted the mail server configuration"
}
Errors¶
Documented error codes: AUTH-1001, AUTH-1003, AUTH-1030, IPV-1002, GE-1014, DB-1003, GE-1012, GE-1008.
HTTP 400
Authorization failure. Body is {“Message”: “<CODE> - <text>”}. Codes: AUTH-1001, AUTH-1003, AUTH-1030 (missing system-settings.fullaccess), IPV-1002 (role_id not found), GE-1014 (service user).
Caller lacks system-settings.fullaccess
{
"Message": "AUTH-1030 - User is not authorized to delete the mail server due to the following missing permission(s) - {'System Settings': ['fullaccess']}"
}
Service user is not allowed
{
"Message": "GE-1014 - MailServer related operations are not supported for service users"
}
HTTP 500
DynamoDB delete failure uses DB-1003. SSM delete status other than 200 uses GE-1012. Missing SSM parameter and other uncaught errors use {“Message”: “GE-1008 - Could not complete the request. Please try again.”}.
Failed to delete DynamoDB item
{
"Message": "DB-1003 - Failed to delete entry in dynamoDB table, please check for errors"
}
Uncaught handler failure
{
"Message": "GE-1008 - Could not complete the request. Please try again."
}