// @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 all services."
// @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 the total count of all services."
// @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 all services for a namespace."
log.Error().Err(err).Str("context","GetKubernetesServicesByNamespace").Str("namespace",namespace).Msg("Unable to retrieve services from the Kubernetes for a namespace level user")
returnhttperror.InternalServerError("unable to retrieve services from the Kubernetes for a namespace level user. Error: ",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 create a service."
log.Error().Err(httpError).Str("context","CreateKubernetesService").Str("namespace",namespace).Str("service",serviceName).Msg("Unable to get a Kubernetes client for the user")
returnhttperror.InternalServerError("unable to get a Kubernetes client for the user. Error: ",httpError)
log.Error().Err(err).Str("context","CreateKubernetesService").Str("namespace",namespace).Str("service",serviceName).Msg("Unauthorized access to the Kubernetes API")
returnhttperror.Forbidden("unauthorized access to the Kubernetes API. Error: ",err)
}
ifk8serrors.IsAlreadyExists(err){
log.Error().Err(err).Str("context","CreateKubernetesService").Str("namespace",namespace).Str("service",serviceName).Msg("A service with the same name already exists in the namespace")
returnhttperror.Conflict("a service with the same name already exists in the namespace. Error: ",err)
}
log.Error().Err(err).Str("context","CreateKubernetesService").Str("namespace",namespace).Str("service",serviceName).Msg("Unable to create a service")
returnhttperror.InternalServerError("unable to create a service. Error: ",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 a specific service."
// @failure 500 "Server error occurred while attempting to delete services."
// @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 service to update."
// @failure 500 "Server error occurred while attempting to update a service."
log.Error().Err(httpError).Str("context","UpdateKubernetesService").Str("namespace",namespace).Str("service",serviceName).Msg("Unable to get a Kubernetes client for the user")
returnhttperror.InternalServerError("unable to get a Kubernetes client for the user. Error: ",httpError)
log.Error().Err(err).Str("context","UpdateKubernetesService").Str("namespace",namespace).Str("service",serviceName).Msg("Unauthorized access to the Kubernetes API")
returnhttperror.Forbidden("unauthorized access to the Kubernetes API. Error: ",err)
}
ifk8serrors.IsNotFound(err){
log.Error().Err(err).Str("context","UpdateKubernetesService").Str("namespace",namespace).Str("service",serviceName).Msg("Unable to find the service to update")
returnhttperror.NotFound("unable to find the service to update. Error: ",err)
}
log.Error().Err(err).Str("context","UpdateKubernetesService").Str("namespace",namespace).Str("service",serviceName).Msg("Unable to update a service")
returnhttperror.InternalServerError("unable to update a service. Error: ",err)