apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: proxmoxvms.proxmox.sankofa.nexus
spec:
  group: proxmox.sankofa.nexus
  names:
    kind: ProxmoxVM
    listKind: ProxmoxVMList
    plural: proxmoxvms
    singular: proxmoxvm
  scope: Namespaced
  versions:
  - name: v1alpha1
    served: true
    storage: true
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              forProvider:
                type: object
                properties:
                  node:
                    type: string
                  name:
                    type: string
                  cpu:
                    type: integer
                    minimum: 1
                    default: 2
                  memory:
                    type: string
                  disk:
                    type: string
                  storage:
                    type: string
                    default: local-lvm
                  network:
                    type: string
                    default: vmbr0
                  image:
                    type: string
                  site:
                    type: string
                  userData:
                    type: string
                  sshKeys:
                    type: array
                    items:
                      type: string
                required:
                - node
                - name
                - memory
                - disk
                - image
                - site
              providerConfigRef:
                type: object
                properties:
                  name:
                    type: string
                required:
                - name
            required:
            - forProvider
            - providerConfigRef
          status:
            type: object
            properties:
              vmId:
                type: integer
              state:
                type: string
              ipAddress:
                type: string
              conditions:
                type: array
                items:
                  type: object
    subresources:
      status: {}
    additionalPrinterColumns:
    - name: VMID
      type: integer
      description: Proxmox VM ID
      jsonPath: .status.vmId
    - name: STATE
      type: string
      description: VM state
      jsonPath: .status.state
    - name: IP
      type: string
      description: VM IP address
      jsonPath: .status.ipAddress
    - name: AGE
      type: date
      jsonPath: .metadata.creationTimestamp

