apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: acicontracts.rmlab.cisco.com
spec:
  group: rmlab.cisco.com
  names:
    kind: AciContract
    listKind: AciContractList
    plural: acicontracts
    singular: acicontract
  scope: Cluster
  versions:
  - name: v1alpha2
    served: true
    storage: true
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              ethertype:
                type: string
                enum:
                  - "arp"
                  - "fcoe"
                  - "ip"
                  - "mac_security"
                  - "mpls_ucast"
                  - "trill"
                  - "unspecified"
                default: "unspecified"
              arpflag:
                type: string
                enum:
                  - "arp_reply"
                  - "arp_request"
                  - "unspecified"
                default: "unspecified"
              ipprotocol:
                type: string
                enum:
                  - "eigrp"
                  - "egp"
                  - "icmp"
                  - "icmpv6"
                  - "igmp"
                  - "igp"
                  - "l2tp"
                  - "ospfigp"
                  - "pim"        
                  - "tcp"       
                  - "udp"
                  - "unspecified"
                default: "unspecified"
              portranges:
                type: object
                properties:
                  start:
                    format: int64
                    maximum: 65535
                    minimum: 1
                    type: integer
                  end:
                    format: int64
                    maximum: 65535
                    minimum: 1
                    type: integer
              destportstart:
                type: integer
                minimum: 0
                maximum: 65535
              destportend:
                type: integer
                minimum: 0
                maximum: 65535
    additionalPrinterColumns:
      - name: ETHER_TYPE 
        type: string
        description: The ether_type of the entry created
        jsonPath: .spec.ethertype
      - name: ARP_FLAG
        type: string
        description: The arp_flag of the entry created
        jsonPath: .spec.arpflag
      - name: IP_PROTOCOL
        type: string
        description: The ip_protocol of the entry created
        jsonPath: .spec.ipprotocol
      - name: DEST_PORT_START
        type: string
        description: The beginning of the destination port range for the entry created
        jsonPath: .spec.destportstart
      - name: DEST_PORT_END
        type: string
        description: The end of the destination port range for the entry created
        jsonPath: .spec.destportend
