{
  "description": "CrunchyBridgeCluster is the Schema for the crunchybridgeclusters API\nThis Custom Resource requires enabling CrunchyBridgeClusters feature gate",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "CrunchyBridgeClusterSpec defines the desired state of CrunchyBridgeCluster\nto be managed by Crunchy Data Bridge",
      "properties": {
        "clusterName": {
          "description": "The name of the cluster\n---\nAccording to Bridge API/GUI errors,\n\"Field name should be between 5 and 50 characters in length, containing only unicode characters, unicode numbers, hyphens, spaces, or underscores, and starting with a character\", and ending with a character or number.",
          "maxLength": 50,
          "minLength": 5,
          "pattern": "^[A-Za-z][A-Za-z0-9\\-_ ]*[A-Za-z0-9]$",
          "type": "string"
        },
        "isHa": {
          "description": "Whether the cluster is high availability,\nmeaning that it has a secondary it can fail over to quickly\nin case the primary becomes unavailable.",
          "type": "boolean"
        },
        "majorVersion": {
          "description": "The ID of the cluster's major Postgres version.\nCurrently Bridge offers 13-16",
          "maximum": 16,
          "minimum": 13,
          "type": "integer"
        },
        "metadata": {
          "description": "Metadata contains metadata for custom resources",
          "properties": {
            "annotations": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            },
            "labels": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "plan": {
          "description": "The ID of the cluster's plan. Determines instance, CPU, and memory.",
          "type": "string"
        },
        "provider": {
          "description": "The cloud provider where the cluster is located.\nCurrently Bridge offers aws, azure, and gcp only",
          "enum": [
            "aws",
            "azure",
            "gcp"
          ],
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "immutable",
              "rule": "self == oldSelf"
            }
          ]
        },
        "region": {
          "description": "The provider region where the cluster is located.",
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "immutable",
              "rule": "self == oldSelf"
            }
          ]
        },
        "roles": {
          "description": "Roles for which to create Secrets that contain their credentials which\nare retrieved from the Bridge API. An empty list creates no role secrets.\nRemoving a role from this list does NOT drop the role nor revoke their\naccess, but it will delete that role's secret from the kube cluster.",
          "items": {
            "properties": {
              "name": {
                "description": "Name of the role within Crunchy Bridge.\nMore info: https://docs.crunchybridge.com/concepts/users",
                "type": "string"
              },
              "secretName": {
                "description": "The name of the Secret that will hold the role credentials.",
                "maxLength": 253,
                "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
                "type": "string"
              }
            },
            "required": [
              "name",
              "secretName"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array",
          "x-kubernetes-list-map-keys": [
            "name"
          ],
          "x-kubernetes-list-type": "map"
        },
        "secret": {
          "description": "The name of the secret containing the API key and team id",
          "type": "string"
        },
        "storage": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            }
          ],
          "description": "The amount of storage available to the cluster in gigabytes.\nThe amount must be an integer, followed by Gi (gibibytes) or G (gigabytes) to match Kubernetes conventions.\nIf the amount is given in Gi, we round to the nearest G value.\nThe minimum value allowed by Bridge is 10 GB.\nThe maximum value allowed by Bridge is 65535 GB.",
          "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
          "x-kubernetes-int-or-string": true
        }
      },
      "required": [
        "clusterName",
        "isHa",
        "majorVersion",
        "plan",
        "provider",
        "region",
        "storage"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "CrunchyBridgeClusterStatus defines the observed state of CrunchyBridgeCluster",
      "properties": {
        "conditions": {
          "description": "conditions represent the observations of postgres cluster's current state.",
          "items": {
            "description": "Condition contains details for one aspect of the current state of this API Resource.\n---\nThis struct is intended for direct use as an array at the field path .status.conditions.  For example,\n\n\n\ttype FooStatus struct{\n\t    // Represents the observations of a foo's current state.\n\t    // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\"\n\t    // +patchMergeKey=type\n\t    // +patchStrategy=merge\n\t    // +listType=map\n\t    // +listMapKey=type\n\t    Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t    // other fields\n\t}",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.\n---\nMany .condition.type values are consistent across resources like Available, but because arbitrary conditions can be\nuseful (see .node.status.conditions), the ability to deconflict is important.\nThe regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)",
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array",
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "host": {
          "description": "The Hostname of the postgres cluster in Bridge, provided by Bridge API and null until then.",
          "type": "string"
        },
        "id": {
          "description": "The ID of the postgres cluster in Bridge, provided by Bridge API and null until then.",
          "type": "string"
        },
        "isHa": {
          "description": "Whether the cluster is high availability, meaning that it has a secondary it can fail\nover to quickly in case the primary becomes unavailable.",
          "type": "boolean"
        },
        "isProtected": {
          "description": "Whether the cluster is protected. Protected clusters can't be destroyed until\ntheir protected flag is removed",
          "type": "boolean"
        },
        "majorVersion": {
          "description": "The cluster's major Postgres version.",
          "type": "integer"
        },
        "name": {
          "description": "The name of the cluster in Bridge.",
          "type": "string"
        },
        "observedGeneration": {
          "description": "observedGeneration represents the .metadata.generation on which the status was based.",
          "format": "int64",
          "minimum": 0,
          "type": "integer"
        },
        "ongoingUpgrade": {
          "description": "The cluster upgrade as represented by Bridge",
          "items": {
            "properties": {
              "flavor": {
                "type": "string"
              },
              "starting_from": {
                "type": "string"
              },
              "state": {
                "type": "string"
              }
            },
            "required": [
              "flavor",
              "starting_from",
              "state"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "plan": {
          "description": "The ID of the cluster's plan. Determines instance, CPU, and memory.",
          "type": "string"
        },
        "responses": {
          "description": "Most recent, raw responses from Bridge API",
          "type": "object",
          "x-kubernetes-preserve-unknown-fields": true
        },
        "state": {
          "description": "State of cluster in Bridge.",
          "type": "string"
        },
        "storage": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "string"
            }
          ],
          "description": "The amount of storage available to the cluster.",
          "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
          "x-kubernetes-int-or-string": true
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
