apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: firewallrules.virtualrouter.tmax.hypercloud.com
spec:
  group: virtualrouter.tmax.hypercloud.com
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              description: 'FirewallRuleSpec contains multiple firewallrules'
              properties:
                rules:
                  type: array
                  items:
                    type: object
                    properties:
                      match:
                        type: object
                        properties:
                          srcIP:
                            type: string
                          dstIP:
                            type: string
                          srcPort:
                            type: integer
                          dstPort:
                            type: integer  
                          protocol:
                            type: string
                            pattern: ^(all|udp|tcp)
                      action:
                        type: object
                        properties:
                          policy:
                            type: string
                            pattern: ^(ACCEPT|DROP)
                        required:
                        - policy
            status:
              type: object
      subresources:
        status: {}
  names:
    kind: FireWallRule
    listKind: FireWallRuleList
    plural: firewallrules
    singular: firewallrule
    shortNames:
    - fw
  scope: Namespaced