apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: localdisks.hwameistor.io
spec:
  group: hwameistor.io
  names:
    kind: LocalDisk
    listKind: LocalDiskList
    plural: localdisks
    shortNames:
    - ld
    singular: localdisk
  scope: Cluster
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.nodeName
      name: NodeMatch
      type: string
    - jsonPath: .spec.claimRef.name
      name: Claim
      type: string
    - jsonPath: .status.claimState
      name: Phase
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: LocalDisk is the Schema for the localdisks 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: LocalDiskSpec defines the desired state of LocalDisk
            properties:
              capacity:
                description: Capacity of the disk in bytes
                format: int64
                type: integer
              claimRef:
                description: ClaimRef is the reference to the LDC which has claimed
                  this LD
                properties:
                  apiVersion:
                    description: API version of the referent.
                    type: string
                  fieldPath:
                    description: 'If referring to a piece of an object instead of
                      an entire object, this string should contain a valid JSON/Go
                      field access statement, such as desiredState.manifest.containers[2].
                      For example, if the object reference is to a container within
                      a pod, this would take on a value like: "spec.containers{name}"
                      (where "name" refers to the name of the container that triggered
                      the event) or if no container name is specified "spec.containers[2]"
                      (container with index 2 in this pod). This syntax is chosen
                      only to have some well-defined way of referencing a part of
                      an object. TODO: this design is not final and this field is
                      subject to change in the future.'
                    type: string
                  kind:
                    description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
                    type: string
                  name:
                    description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
                    type: string
                  namespace:
                    description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
                    type: string
                  resourceVersion:
                    description: 'Specific resourceVersion to which this reference
                      is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
                    type: string
                  uid:
                    description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
                    type: string
                type: object
              devicePath:
                description: DevicePath is the disk path in the OS
                type: string
              diskAttributes:
                description: DiskAttributes has hardware/static attributes of the
                  disk
                properties:
                  devType:
                    description: DeviceType represents the type of device like sparse,
                      disk, partition, lvm, crypt
                    type: string
                  formFactor:
                    description: FormFactor is the disk size, like 2.5 inches
                    type: string
                  modelName:
                    description: ModelName is the name of disk model
                    type: string
                  pciVendorID:
                    description: PCIVendorID is the ID of the PCI vendor, for NVMe
                      disk only
                    type: string
                  product:
                    description: Product is a class of disks the vendor produces
                    type: string
                  protocol:
                    description: Protocol is for data transport, such as ATA, SCSI,
                      NVMe
                    type: string
                  rotationRate:
                    description: RotationRate is the rate of the disk rotation
                    format: int64
                    type: integer
                  serialNumber:
                    description: SerialNumber is a unique number assigned to a disk
                    type: string
                  type:
                    description: Type is the disk type, such as ata, scsi, nvme, megaraid,N,
                      ...
                    type: string
                  vendor:
                    description: Vendor is who provides the disk
                    type: string
                type: object
              isRaid:
                description: HasRAID identifies if the disk is a raid disk or not
                type: boolean
              nodeName:
                description: NodeName represents the node where the disk is attached
                type: string
              partitionInfo:
                description: PartitionInfo contains partition information
                items:
                  description: PartitionInfo contains partition information(e.g. FileSystem)
                  properties:
                    filesystem:
                      description: FileSystem contains mount point and filesystem
                        type
                      properties:
                        fsType:
                          description: Type represents the FileSystem type of the
                            disk
                          type: string
                        mountPoint:
                          description: MountPoint represents the mountpoint of the
                            disk
                          type: string
                      type: object
                    hasFileSystem:
                      description: HasFileSystem represents whether the filesystem
                        is included
                      type: boolean
                    path:
                      description: Path represents the partition path in the OS
                      type: string
                  required:
                  - hasFileSystem
                  - path
                  type: object
                type: array
              partitioned:
                description: HasPartition represents if the disk has partitions or
                  not
                type: boolean
              raidInfo:
                description: RAIDInfo contains RAID information
                properties:
                  raidMaster:
                    description: RAIDMaster is the master of the RAID disk, it works
                      for only RAID slave disk, e.g. /dev/bus/0
                    type: string
                type: object
              smartInfo:
                description: SmartInfo contains infos collected by smartctl
                properties:
                  overallHealth:
                    description: OverallHealth identifies if the disk is healthy or
                      not
                    type: string
                required:
                - overallHealth
                type: object
              state:
                description: State is the current state of the disk (Active/Inactive/Unknown)
                enum:
                - Active
                - Inactive
                - Unknown
                type: string
              supportSmart:
                description: HasSmartInfo identified if the disk supports SMART or
                  not
                type: boolean
              uuid:
                description: UUID global unique identifier of the disk
                type: string
            required:
            - nodeName
            type: object
          status:
            description: LocalDiskStatus defines the observed state of LocalDisk
            properties:
              claimState:
                description: State represents the claim state of the disk
                enum:
                - Claimed
                - Unclaimed
                - Released
                type: string
            type: object
        type: object
    served: true
    storage: true
    subresources: {}
