func getAllDeployClusterApplication(request *restful.Request, response *restful.Response) {
	deployClusterApplicationSlice, err := deploy.GetAllDeployClusterApplication()
	if err != nil {
		jsonMap := make(map[string]interface{})
		jsonMap["Error"] = "Get all cluster application deployment"
		jsonMap["ErrorMessage"] = err.Error()
		errorMessageByteSlice, _ := json.Marshal(jsonMap)
		log.Error(jsonMap)
		response.WriteErrorString(404, string(errorMessageByteSlice))
		return
	}

	response.WriteJson(deployClusterApplicationSlice, "[]DeployClusterApplication")
}
func deleteClusterApplication(request *restful.Request, response *restful.Response) {
	name := request.PathParameter("clusterapplication")

	deployClusterApplicationSlice, err := deploy.GetAllDeployClusterApplication()
	if err != nil {
		jsonMap := make(map[string]interface{})
		jsonMap["Error"] = "Get all cluster application deployment failure"
		jsonMap["ErrorMessage"] = err.Error()
		jsonMap["name"] = name
		errorMessageByteSlice, _ := json.Marshal(jsonMap)
		log.Error(jsonMap)
		response.WriteErrorString(404, string(errorMessageByteSlice))
		return
	}

	for _, deployClusterApplication := range deployClusterApplicationSlice {
		if deployClusterApplication.Name == name {
			jsonMap := make(map[string]interface{})
			jsonMap["Error"] = "Used template"
			jsonMap["ErrorMessage"] = "There is at least one deployment using this template"
			jsonMap["name"] = name
			errorMessageByteSlice, _ := json.Marshal(jsonMap)
			log.Error(jsonMap)
			response.WriteErrorString(403, string(errorMessageByteSlice))
			return
		}
	}

	err = application.GetStorage().DeleteClusterApplication(name)
	if err != nil {
		jsonMap := make(map[string]interface{})
		jsonMap["Error"] = "Delete cluster application failure"
		jsonMap["ErrorMessage"] = err.Error()
		jsonMap["name"] = name
		errorMessageByteSlice, _ := json.Marshal(jsonMap)
		log.Error(jsonMap)
		response.WriteErrorString(404, string(errorMessageByteSlice))
		return
	}
}