apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  # annotation has to be provided in order to enable cr-syncer to cloud
  annotations:
    cr-syncer.cloudrobotics.com/spec-source: cloud
    cr-syncer.cloudrobotics.com/filter-by-robot-name: "True"
  # name must match the spec fields below, and be in the form: <plural>.<group>
  name: robotconfigurations.ewm.sap.com
spec:
  group: ewm.sap.com
  # either Namespaced or Cluster
  scope: Namespaced
  names:
    # plural name to be used in the URL: /apis/<group>/<version>/<plural>
    plural: robotconfigurations
    # singular name to be used as an alias on the CLI and for display
    singular: robotconfiguration
    # kind is normally the CamelCased singular type. Your resource manifests use this.
    kind: RobotConfiguration
    # shortNames allow shorter string to match your resource on the CLI
    shortNames:
    - robcon
  # list of versions supported by this CustomResourceDefinition
  versions:
    - name: v1alpha1
      # Each version can be enabled/disabled by Served flag.
      served: true
      # One and only one version must be marked as the storage version.
      storage: true
      subresources:
        status: {}
      schema:
        openAPIV3Schema:
          type: object
          required:
            - spec
          properties:
            spec:
              type: object
              required:
                - lgnum
                - rsrctype
                - rsrcgrp
                - chargers
                - batteryMin
                - batteryOk
                - batteryIdle
                - maxIdleTime
                - recoverFromRobotError
                - mode
              properties:
                lgnum:
                  type: string
                rsrctype:
                  type: string
                rsrcgrp:
                  type: string
                chargers:
                  type: array
                  items:
                    type: string
                batteryMin:
                  type: number
                batteryOk:
                  type: number
                batteryIdle:
                  type: number
                maxIdleTime:
                  type: number
                recoverFromRobotError:
                  type: boolean
                mode:
                  type: string
                  enum:
                    - RUN
                    - IDLE
                    - CHARGE
                    - STOP
            status:
              type: object
              properties:
                lgnum:
                  type: string
                mission:
                  type: string
                statemachine:
                  type: string
                subwho:
                  type: string
                tanum:
                  type: string
                who:
                  type: string
                updateTime:
                  type: string
      additionalPrinterColumns:
      - jsonPath: .spec.lgnum
        name: EWM Warehouse
        type: string
      - jsonPath: .metadata.creationTimestamp
        description: |-
          CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.

          Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
        name: Age
        type: date
