Added seed code for caas-danm.
[ta/caas-danm.git] / ansible / roles / danm_setup / templates / danmnet_crd_schema.yaml
diff --git a/ansible/roles/danm_setup/templates/danmnet_crd_schema.yaml b/ansible/roles/danm_setup/templates/danmnet_crd_schema.yaml
new file mode 100644 (file)
index 0000000..9c07dbe
--- /dev/null
@@ -0,0 +1,83 @@
+{#
+Copyright 2019 Nokia
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+#}
+---
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: danmnets.danm.k8s.io
+spec:
+  scope: Namespaced
+  group: danm.k8s.io
+  version: v1
+  names:
+    kind: DanmNet
+    plural: danmnets
+    singular: danmnet
+    shortNames:
+    - dn
+    - dnet
+  validation:
+    openAPIV3Schema:
+      properties:
+        spec:
+          required:
+          - NetworkID
+          properties:
+            NetworkID:
+              type: string
+            NetworkType:
+              type: string
+            Options:
+              properties:
+                cidr:
+                  type: string
+                  pattern: '^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))$'
+                allocation_pool:
+                  properties:
+                    start:
+                      type: string
+                      pattern: '(^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$)?'
+                    end:
+                      type: string
+                      pattern: '(^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$)?'
+                container_prefix:
+                  type: string
+                host_device:
+                  type: string
+                device_pool:
+                  type: string
+                vxlan:
+                  type: integer
+                  format: int32
+                  minimum: 1
+                  maximum: 16777214
+                vlan:
+                  type: integer
+                  format: int32
+                  minimum: 1
+                  maximum: 4094
+                rt_tables:
+                  type: integer
+                  format: int32
+                net6:
+                  type: string
+                  pattern: '^s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]d|1dd|[1-9]?d)(.(25[0-5]|2[0-4]d|1dd|[1-9]?d)){3}))|:)))(%.+)?s*(\/([0-9]|[1-9][0-9]|1[0-1][0-9]|12[0-8]))$'
+                routes:
+                  type: object
+                  additionalProperties:
+                routes6:
+                  type: object
+                  additionalProperties: