datastore.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package models
  2. import (
  3. "github.com/google/uuid"
  4. "gorm.io/gorm"
  5. )
  6. // DatastoreStatus is the status of an app revision
  7. type DatastoreStatus string
  8. const (
  9. // DatastoreStatus_Creating is the status for a datastore that is being created
  10. DatastoreStatus_Creating DatastoreStatus = "CREATING"
  11. // DatastoreStatus_Available is the status for a datastore that is available
  12. DatastoreStatus_Available DatastoreStatus = "AVAILABLE"
  13. )
  14. // Datastore is a database model that represents a Porter-provisioned datastore
  15. type Datastore struct {
  16. gorm.Model
  17. // ID is a uuid that references the datastore
  18. ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
  19. // ProjectID is the ID of the project that the datastore belongs to
  20. ProjectID uint `json:"project_id"`
  21. // Name is the name of the datastore
  22. Name string `json:"name"`
  23. // CloudProvider is the cloud provider that hosts the Kubernetes Cluster. Accepted values: [AWS, GCP, AZURE]
  24. CloudProvider string `json:"cloud_provider"`
  25. // CloudProviderCredentialIdentifier is a reference to find the credentials required for access the cluster's API.
  26. // This was likely the credential that was used to create the cluster.
  27. // For AWS EKS clusters, this will be an ARN for the final target role in the assume role chain.
  28. CloudProviderCredentialIdentifier string `json:"cloud_provider_credential_identifier"`
  29. // Type is the type of datastore. Accepted values: [RDS, ELASTICACHE]
  30. Type string `json:"type"`
  31. // Engine is the engine of the datastore. Accepted values: [POSTGRES, AURORA-POSTGRES, REDIS]
  32. Engine string `json:"engine"`
  33. // Status describes the status of a datastore
  34. Status DatastoreStatus `json:"status"`
  35. }