update deletion docs

pull/12297/head
testA113 2024-10-08 12:05:29 +13:00
parent ee180ed08f
commit 9384f8f32f
5 changed files with 35 additions and 15 deletions

View File

@ -56,8 +56,12 @@ func (handler *Handler) getAllKubernetesClusterRoleBindings(w http.ResponseWrite
// @produce text/plain
// @param id path int true "Environment(Endpoint) identifier"
// @param payload body kubernetes.K8sClusterRoleBindingDeleteRequests true "Cluster role bindings to delete"
// @success 200 "Success"
// @failure 500 "Server error"
// @success 204 "Success"
// @failure 400 "Invalid request payload, such as missing required fields or fields not meeting validation criteria."
// @failure 401 "Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions."
// @failure 403 "Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions."
// @failure 404 "Unable to find an environment with the specified identifier or unable to find a specific service."
// @failure 500 "Server error occurred while attempting to delete services."
// @router /kubernetes/{id}/cluster_role_bindings/delete [POST]
func (handler *Handler) deleteClusterRoleBindings(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
var payload models.K8sClusterRoleBindingDeleteRequests
@ -76,5 +80,5 @@ func (handler *Handler) deleteClusterRoleBindings(w http.ResponseWriter, r *http
return httperror.InternalServerError("Failed to delete cluster role bindings", err)
}
return nil
return response.Empty(w)
}

View File

@ -56,8 +56,12 @@ func (handler *Handler) getAllKubernetesClusterRoles(w http.ResponseWriter, r *h
// @produce text/plain
// @param id path int true "Environment(Endpoint) identifier"
// @param payload body kubernetes.K8sClusterRoleDeleteRequests true "Cluster roles to delete"
// @success 200 "Success"
// @failure 500 "Server error"
// @success 204 "Success"
// @failure 400 "Invalid request payload, such as missing required fields or fields not meeting validation criteria."
// @failure 401 "Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions."
// @failure 403 "Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions."
// @failure 404 "Unable to find an environment with the specified identifier or unable to find a specific service."
// @failure 500 "Server error occurred while attempting to delete services."
// @router /kubernetes/{id}/cluster_roles/delete [POST]
func (handler *Handler) deleteClusterRoles(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
var payload models.K8sClusterRoleDeleteRequests
@ -76,5 +80,5 @@ func (handler *Handler) deleteClusterRoles(w http.ResponseWriter, r *http.Reques
return httperror.InternalServerError("Failed to delete cluster roles", err)
}
return nil
return response.Empty(w)
}

View File

@ -51,8 +51,12 @@ func (handler *Handler) getAllKubernetesRoleBindings(w http.ResponseWriter, r *h
// @produce text/plain
// @param id path int true "Environment(Endpoint) identifier"
// @param payload body models.K8sRoleDeleteRequests true "Role bindings to delete"
// @success 200 "Success"
// @failure 500 "Server error"
// @success 204 "Success"
// @failure 400 "Invalid request payload, such as missing required fields or fields not meeting validation criteria."
// @failure 401 "Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions."
// @failure 403 "Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions."
// @failure 404 "Unable to find an environment with the specified identifier or unable to find a specific service."
// @failure 500 "Server error occurred while attempting to delete services."
// @router /kubernetes/{id}/role_bindings/delete [POST]
func (h *Handler) deleteRoleBindings(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
var payload models.K8sRoleBindingDeleteRequests
@ -70,5 +74,5 @@ func (h *Handler) deleteRoleBindings(w http.ResponseWriter, r *http.Request) *ht
return httperror.InternalServerError("Failed to delete role bindings", err)
}
return nil
return response.Empty(w)
}

View File

@ -51,8 +51,12 @@ func (handler *Handler) getAllKubernetesRoles(w http.ResponseWriter, r *http.Req
// @produce text/plain
// @param id path int true "Environment(Endpoint) identifier"
// @param payload body kubernetes.K8sRoleDeleteRequests true "Roles to delete "
// @success 200 "Success"
// @failure 500 "Server error"
// @success 204 "Success"
// @failure 400 "Invalid request payload, such as missing required fields or fields not meeting validation criteria."
// @failure 401 "Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions."
// @failure 403 "Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions."
// @failure 404 "Unable to find an environment with the specified identifier or unable to find a specific service."
// @failure 500 "Server error occurred while attempting to delete services."
// @router /kubernetes/{id}/roles/delete [POST]
func (h *Handler) deleteRoles(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
var payload models.K8sRoleDeleteRequests
@ -71,5 +75,5 @@ func (h *Handler) deleteRoles(w http.ResponseWriter, r *http.Request) *httperror
return httperror.InternalServerError("Failed to delete roles", err)
}
return nil
return response.Empty(w)
}

View File

@ -51,8 +51,12 @@ func (handler *Handler) getAllKubernetesServiceAccounts(w http.ResponseWriter, r
// @produce text/plain
// @param id path int true "Environment(Endpoint) identifier"
// @param payload body kubernetes.K8sServiceAccountDeleteRequests true "Service accounts to delete "
// @success 200 "Success"
// @failure 500 "Server error"
// @success 204 "Success"
// @failure 400 "Invalid request payload, such as missing required fields or fields not meeting validation criteria."
// @failure 401 "Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions."
// @failure 403 "Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions."
// @failure 404 "Unable to find an environment with the specified identifier or unable to find a specific service."
// @failure 500 "Server error occurred while attempting to delete services."
// @router /kubernetes/{id}/service_accounts/delete [POST]
func (handler *Handler) deleteKubernetesServiceAccounts(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
var payload models.K8sServiceAccountDeleteRequests
@ -71,5 +75,5 @@ func (handler *Handler) deleteKubernetesServiceAccounts(w http.ResponseWriter, r
return httperror.InternalServerError("Unable to delete service accounts", err)
}
return nil
return response.Empty(w)
}