// @description Get a list of ingress controllers for the given environment. If the allowedOnly query parameter is set, only ingress controllers that are allowed by the environment's ingress configuration will be returned.
// @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."
// @failure 500 "Server error occurred while attempting to retrieve ingress controllers"
log.Error().Err(err).Str("context","getAllKubernetesIngressControllers").Msg("Unable to find an environment with the specified identifier inside the database")
returnhttperror.NotFound("Unable to find an environment with the specified identifier inside the database",err)
}
log.Error().Err(err).Str("context","getAllKubernetesIngressControllers").Msg("Unable to find an environment with the specified identifier inside the database")
returnhttperror.InternalServerError("Unable to find an environment with the specified identifier inside the database",err)
// @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 a namespace with the specified name."
// @failure 500 "Server error occurred while attempting to retrieve ingress controllers by a namespace"
log.Error().Err(err).Str("context","getKubernetesIngressControllersByNamespace").Msg("Unable to find an environment with the specified identifier inside the database")
returnhttperror.NotFound("Unable to find an environment with the specified identifier inside the database",err)
}
log.Error().Err(err).Str("context","getKubernetesIngressControllersByNamespace").Msg("Unable to find an environment with the specified identifier inside the database")
returnhttperror.InternalServerError("Unable to find an environment with the specified identifier inside the database",err)
log.Error().Err(err).Str("context","getKubernetesIngressControllersByNamespace").Str("namespace",namespace).Msg("Unauthorized access to the Kubernetes API")
returnhttperror.Forbidden("Unauthorized access to the Kubernetes API",err)
}
log.Error().Err(err).Str("context","getKubernetesIngressControllersByNamespace").Str("namespace",namespace).Msg("Unable to retrieve ingress controllers from the Kubernetes")
returnhttperror.InternalServerError("Unable to retrieve ingress controllers from the Kubernetes",err)
// @param id path int true "Environment identifier"
// @param body body models.K8sIngressControllers true "Ingress controllers"
// @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 the ingress controllers to update."
// @failure 500 "Server error occurred while attempting to update ingress controllers."
log.Error().Err(err).Str("context","updateKubernetesIngressControllers").Msg("Unable to find an environment with the specified identifier inside the database")
returnhttperror.NotFound("Unable to find an environment with the specified identifier inside the database",err)
}
log.Error().Err(err).Str("context","updateKubernetesIngressControllers").Msg("Unable to find an environment with the specified identifier inside the database")
returnhttperror.InternalServerError("Unable to find an environment with the specified identifier inside the database",err)
// @param body body models.K8sIngressControllers true "Ingress controllers"
// @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."
// @failure 500 "Server error occurred while attempting to update ingress controllers by namespace."
log.Error().Err(err).Str("context","updateKubernetesIngressControllersByNamespace").Str("namespace",namespace).Msg("Unable to decode and validate the request payload")
returnhttperror.BadRequest("Unable to decode and validate the request payload",err)
log.Error().Err(err).Str("context","updateKubernetesIngressControllersByNamespace").Str("namespace",namespace).Msg("Unable to store BlockedIngressClasses inside the database")
returnhttperror.InternalServerError("Unable to store BlockedIngressClasses inside the database",err)
// @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."
// @failure 500 "Server error occurred while attempting to retrieve ingresses."
// @param id path int true "Environment identifier"
// @success 200 {integer} integer "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."
// @failure 500 "Server error occurred while attempting to retrieve ingresses count."
// @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."
// @failure 500 "Server error occurred while attempting to retrieve ingresses"
log.Error().Err(err).Str("context","getKubernetesIngresses").Str("namespace",namespace).Msg("Unauthorized access to the Kubernetes API")
returnhttperror.Forbidden("Unauthorized access to the Kubernetes API",err)
}
log.Error().Err(err).Str("context","getKubernetesIngresses").Str("namespace",namespace).Msg("Unable to retrieve ingresses from the Kubernetes for a namespace level user")
returnhttperror.InternalServerError("Unable to retrieve ingresses from the Kubernetes for a namespace level user",err)
// @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 an ingress with the specified name."
// @failure 500 "Server error occurred while attempting to retrieve an ingress."
log.Error().Err(err).Str("context","getKubernetesIngress").Str("namespace",namespace).Str("ingress",ingressName).Msg("Unauthorized access to the Kubernetes API")
returnhttperror.Forbidden("Unauthorized access to the Kubernetes API",err)
}
ifk8serrors.IsNotFound(err){
log.Error().Err(err).Str("context","getKubernetesIngress").Str("namespace",namespace).Str("ingress",ingressName).Msg("Unable to retrieve ingress from the Kubernetes for a namespace level user")
returnhttperror.NotFound("Unable to retrieve ingress from the Kubernetes for a namespace level user",err)
}
log.Error().Err(err).Str("context","getKubernetesIngress").Str("namespace",namespace).Str("ingress",ingressName).Msg("Unable to retrieve ingress from the Kubernetes for a namespace level user")
returnhttperror.InternalServerError("Unable to retrieve ingress from the Kubernetes for a namespace level user",err)
}
returnresponse.JSON(w,ingress)
}
// @id CreateKubernetesIngress
// @summary Create an Ingress
// @description Create an Ingress for the provided environment.
// @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."
// @failure 409 "Conflict - an ingress with the same name already exists in the specified namespace."
// @failure 500 "Server error occurred while attempting to create an ingress."
// @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 ingress."
// @failure 500 "Server error occurred while attempting to delete specified ingresses."
// @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 the specified ingress."
// @failure 500 "Server error occurred while attempting to update the specified ingress."
log.Error().Err(err).Str("context","updateKubernetesIngress").Str("namespace",namespace).Msg("Unauthorized access to the Kubernetes API")
returnhttperror.Forbidden("Unauthorized access to the Kubernetes API",err)
}
ifk8serrors.IsNotFound(err){
log.Error().Err(err).Str("context","updateKubernetesIngress").Str("namespace",namespace).Msg("Unable to retrieve ingresses from the K ubernetes for a namespace level user")
returnhttperror.NotFound("Unable to retrieve ingresses from the Kubernetes for a namespace level user",err)
}
log.Error().Err(err).Str("context","updateKubernetesIngress").Str("namespace",namespace).Msg("Unable to update ingress in a namespace")
returnhttperror.InternalServerError("Unable to update ingress in a namespace",err)