{
  "description": "StorageAnywhereCache is the Schema for the StorageAnywhereCache API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More 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. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "StorageAnywhereCacheSpec defines the desired state of StorageAnywhereCache",
      "properties": {
        "admissionPolicy": {
          "default": "admit-on-first-miss",
          "description": "Cache admission policy. Valid values include: `admit-on-first-miss` and `admit-on-second-miss`. Defaults to `admit-on-first-miss`.",
          "enum": [
            "admit-on-first-miss",
            "admit-on-second-miss"
          ],
          "type": "string"
        },
        "bucketRef": {
          "description": "Immutable. The reference to bucket where cache needs to be created.",
          "oneOf": [
            {
              "not": {
                "required": [
                  "external"
                ]
              },
              "required": [
                "name"
              ]
            },
            {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "name"
                    ]
                  },
                  {
                    "required": [
                      "namespace"
                    ]
                  }
                ]
              },
              "required": [
                "external"
              ]
            }
          ],
          "properties": {
            "external": {
              "description": "A reference to an externally-managed StorageBucket resource.",
              "type": "string"
            },
            "name": {
              "description": "The name of a StorageBucket resource.",
              "type": "string"
            },
            "namespace": {
              "description": "The namespace of a StorageBucket resource.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "desiredState": {
          "default": "running",
          "description": "The desired state of the cache. Possible values include \"running\", \"disabled\", and \"paused\". If not specified, the default value is \"running\". This field controls the runtime behavior of the cache. Please note that changes to the `desiredState` are prioritized over any other updates. For instance, if both the `desiredState` and `ttl` are updated simultaneously, the state would be updated first, followed by `ttl`.",
          "enum": [
            "running",
            "paused",
            "disabled"
          ],
          "type": "string"
        },
        "resourceID": {
          "description": "The AnywhereCacheID generated via backend. It can be used by users to manage an existing cache.",
          "type": "string"
        },
        "ttl": {
          "default": "86400s",
          "description": "Cache entry TTL (ranges between 1h to 7d). This is a cache-level config that defines how long a cache entry can live. Defaults to \"86400s\". TTL must be in whole seconds.",
          "type": "string"
        },
        "zone": {
          "description": "Immutable. The zone in which the cache instance needs to be created. For example, us-central1-a.",
          "type": "string"
        }
      },
      "required": [
        "bucketRef",
        "zone"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "StorageAnywhereCacheStatus defines the config connector machine state of StorageAnywhereCache",
      "properties": {
        "conditions": {
          "description": "Conditions represent the latest available observations of the object's current state.",
          "items": {
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "type": "string"
              },
              "message": {
                "description": "Human-readable message indicating details about last transition.",
                "type": "string"
              },
              "reason": {
                "description": "Unique, one-word, CamelCase reason for the condition's last transition.",
                "type": "string"
              },
              "status": {
                "description": "Status is the status of the condition. Can be True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type is the type of the condition.",
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "externalRef": {
          "description": "A unique specifier for the StorageAnywhereCache resource in GCP.",
          "type": "string"
        },
        "observedGeneration": {
          "description": "ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.",
          "format": "int64",
          "type": "integer"
        },
        "observedState": {
          "description": "ObservedState is the state of the resource as most recently observed in GCP.",
          "properties": {
            "createTime": {
              "description": "Output only. Time when Anywhere cache instance is allocated.",
              "type": "string"
            },
            "pendingUpdate": {
              "description": "Output only. True if there is an active update operation against this cache instance. Subsequential update requests will be rejected if this field is true. Output only.",
              "type": "boolean"
            },
            "state": {
              "description": "Output only. Cache state including \"running\", \"creating\", \"disabled\" and \"paused\".",
              "type": "string"
            },
            "updateTime": {
              "description": "Output only. Time when Anywhere cache instance is last updated, including creation.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
