{
  "description": "ResourceSupervisor is the Schema for the resourcesupervisors 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": "ResourceSupervisorSpec defines the desired state of ResourceSupervisor",
      "properties": {
        "argocd": {
          "description": "ArgoCD contains details about ArgoCD to which the Hibernation schedule will be applied",
          "properties": {
            "appProjects": {
              "description": "AppProjects is a list of the ArgoCD AppProject names that will follow the Hibernation schedule",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "namespace": {
              "description": "Namespace is the name of the namespace where the AppProjects are residing",
              "type": "string"
            }
          },
          "required": [
            "appProjects",
            "namespace"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "hibernation": {
          "description": "Hibernation contains the schedule during which the tenant will be hibernating",
          "properties": {
            "sleepSchedule": {
              "description": "SleepSchedule contains the schedule during which the resources within the tenant's namespaces will be put to sleep",
              "type": "string"
            },
            "wakeSchedule": {
              "description": "WakeSchedule contains the schedule during which the resources within the tenant's namespaces will be awoken",
              "type": "string"
            }
          },
          "required": [
            "sleepSchedule",
            "wakeSchedule"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "namespaces": {
          "description": "Namespaces is a list of namespaces to which the Hibernation schedule will be applied",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "hibernation"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "ResourceSupervisorStatus defines the observed state of ResourceSupervisor",
      "properties": {
        "currentStatus": {
          "description": "CurrentStatus shows the state the tenant's resources",
          "enum": [
            "sleeping",
            "running",
            "error"
          ],
          "type": "string"
        },
        "nextReconcileTime": {
          "description": "NextReconcileTime contains the next time at which the namespace resources will sleep or wake up",
          "format": "date-time",
          "type": "string"
        },
        "sleepingApplications": {
          "description": "SleepingApplications contains the previous states for each of the deployments currently scaled down",
          "items": {
            "description": "SleepingApplication contains the previous states for the Deployments or StatefulSets currently scaled down",
            "properties": {
              "Namespace": {
                "description": "Namespace is the namespace that contains the application",
                "type": "string"
              },
              "kind": {
                "description": "Kind stores the application's kind (Deployment or StatefulSet)",
                "enum": [
                  "Deployment",
                  "StatefulSet"
                ],
                "type": "string"
              },
              "name": {
                "description": "Name is the name of the sleeping application",
                "type": "string"
              },
              "replicas": {
                "description": "Replicas are the number of desired pods for the Deployment, stored at the time of sleep",
                "format": "int32",
                "type": "integer"
              }
            },
            "required": [
              "Namespace",
              "kind",
              "name",
              "replicas"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
