cluster.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package types
  2. import v1 "k8s.io/api/core/v1"
  3. type Cluster struct {
  4. ID uint `json:"id"`
  5. // The project that this integration belongs to
  6. ProjectID uint `json:"project_id"`
  7. // Name of the cluster
  8. Name string `json:"name"`
  9. // Server endpoint for the cluster
  10. Server string `json:"server"`
  11. // The integration service for this cluster
  12. Service ClusterService `json:"service"`
  13. // The infra id, if cluster was provisioned with Porter
  14. InfraID uint `json:"infra_id"`
  15. // (optional) The aws integration id, if available
  16. AWSIntegrationID uint `json:"aws_integration_id"`
  17. }
  18. type ClusterGetResponse struct {
  19. *Cluster
  20. // The NGINX Ingress IP to access the cluster
  21. IngressIP string `json:"ingress_ip"`
  22. // Error displayed in case couldn't get the IP
  23. IngressError error `json:"ingress_error"`
  24. }
  25. type ClusterService string
  26. const (
  27. EKS ClusterService = "eks"
  28. DOKS ClusterService = "doks"
  29. GKE ClusterService = "gke"
  30. Kube ClusterService = "kube"
  31. )
  32. type ClusterListNamespacesResponse struct {
  33. *v1.NamespaceList
  34. }
  35. type CreateNamespaceRequest struct {
  36. Name string `json:"name" form:"required"`
  37. }
  38. type CreateNamespaceResponse struct {
  39. *v1.Namespace
  40. }
  41. type DeleteNamespaceRequest struct {
  42. Name string `json:"name" form:"required"`
  43. }
  44. type GetTemporaryKubeconfigResponse struct {
  45. Kubeconfig []byte `json:"kubeconfig"`
  46. }