aboutsummaryrefslogtreecommitdiffstats
path: root/applications/common/src/test/resources/matchable/onap.policies.Test-1.0.0.yaml
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-02-19 16:59:01 -0500
committerPamela Dragosh <pdragosh@research.att.com>2020-02-19 19:59:33 -0500
commit3f4d4125093ca000c735adc1d6430c39e31de38c (patch)
tree5386fae347d6445bdba7599d0f42aefc85d867df /applications/common/src/test/resources/matchable/onap.policies.Test-1.0.0.yaml
parent56038a31a23e468f51c0b2ab349f748eafe4b6d2 (diff)
Use datatype in matchable translator
With the new changes to models/api, the full policy template will be retrieved along with inherited policy types and datatypes. Changed api caller to return tosca template instead of individual policy type so all policy types and data types are available. Changed stdmatchabletranslator to be able to flexibly go deep with list/map of datatypes of attributes. NOTE: This should be re-factored at a later date as its a bit messy. The naming application was used to test this code, but it was determined by the CCSDK team that they will not do filtering this release. Instead, switched to combined results policy type to return the full policy type. Issue-ID: POLICY-1740 Change-Id: Ieb4e46e7fb2c639a1155be3bc07f5587c4f7b09a Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/common/src/test/resources/matchable/onap.policies.Test-1.0.0.yaml')
-rw-r--r--applications/common/src/test/resources/matchable/onap.policies.Test-1.0.0.yaml35
1 files changed, 30 insertions, 5 deletions
diff --git a/applications/common/src/test/resources/matchable/onap.policies.Test-1.0.0.yaml b/applications/common/src/test/resources/matchable/onap.policies.Test-1.0.0.yaml
index f44a3061..7179c310 100644
--- a/applications/common/src/test/resources/matchable/onap.policies.Test-1.0.0.yaml
+++ b/applications/common/src/test/resources/matchable/onap.policies.Test-1.0.0.yaml
@@ -1,9 +1,30 @@
tosca_definitions_version: tosca_simple_yaml_1_0_0
policy_types:
- onap.policies.Test:
+ onap.policies.Base:
derived_from: tosca.policies.Root
version: 1.0.0
properties:
+ baseNoMatch:
+ type: string
+ baseMatch:
+ type: string
+ metadata:
+ matchable: true
+ onap.policies.base.Middle:
+ derived_from: onap.policies.Base
+ version: 1.0.0
+ properties:
+ middleNoMatch:
+ type: string
+ middleMatch:
+ type: string
+ metadata:
+ matchable: true
+ onap.policies.base.middle.Test:
+ derived_from: onap.policies.base.Middle
+ type_version: 1.0.0
+ version: 1.0.0
+ properties:
nonmatachableString:
type: string
matchableString:
@@ -30,6 +51,10 @@ policy_types:
type: boolean
metadata:
matchable: true
+ nonmatchableListInteger:
+ type: list
+ entry_schema:
+ type: integer
matchableListString:
type: list
metadata:
@@ -39,7 +64,7 @@ policy_types:
propertyOneMap:
type: map
entry_schema:
- type: onap.datatype.level1
+ type: onap.datatype.one
data_types:
onap.datatype.one:
derived_from: tosca.datatypes.Root
@@ -49,7 +74,7 @@ data_types:
oneStringMatchable:
type: string
metadata:
- matachable: true
+ matchable: true
propertyTwoList:
type: list
entry_schema:
@@ -62,7 +87,7 @@ data_types:
twoStringMatchable:
type: string
metadata:
- matachable: true
+ matchable: true
propertyThreeMap:
type: map
entry_schema:
@@ -75,4 +100,4 @@ data_types:
threeStringMatchable:
type: string
metadata:
- matachable: true \ No newline at end of file
+ matchable: true \ No newline at end of file
.sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
# Copyright © 2017 Amdocs, Bell Canada
# Modifications Copyright © 2018 AT&T
#
# 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: apps/v1
kind: Deployment
metadata:
  name: {{ include "common.fullname" . }}
  namespace: {{ include "common.namespace" . }}
  labels:
    app: {{ include "common.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ include "common.release" . }}
    heritage: {{ .Release.Service }}
spec:
  selector:
    matchLabels:
      app: {{ include "common.name" . }}
  replicas: {{ .Values.replicaCount }}
  template:
    metadata:
      labels:
        app: {{ include "common.name" . }}
        release: {{ include "common.release" . }}
    spec:
      containers:
      - name: {{ include "common.name" . }}
        image: "{{ include "common.repository" . }}/{{ .Values.image }}"
        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
        ports:
        - containerPort: {{ .Values.service.internalPort }}
        - containerPort: {{ .Values.service.internalPort2 }}
        - containerPort: {{ .Values.service.internalPort3 }}
        - containerPort: {{ .Values.service.internalPort4 }}
        - containerPort: {{ .Values.service.internalPort5 }}
        {{ if eq .Values.liveness.enabled true }}
        livenessProbe:
          exec:
            command:
            - /bin/bash
            - -c
            - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
          initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
          periodSeconds: {{ .Values.liveness.periodSeconds }}
        {{ end }}
        readinessProbe:
          exec:
            command:
            - /bin/bash
            - -c
            - nodetool status | grep $POD_IP | awk '$1!="UN" { exit 1; }'
          initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
          periodSeconds: {{ .Values.readiness.periodSeconds }}
        env:
          - name: CASSUSER
            {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-creds" "key" "login") | indent 12}}
          - name: CASSPASS
            {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-creds" "key" "password") | indent 12}}
          - name: JVM_OPTS
            value: "{{ .Values.config.cassandraJvmOpts }}"
          - name: POD_IP
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
        volumeMounts:
        - mountPath: /etc/localtime
          name: localtime
          readOnly: true
        - name: cassandra-docker-entrypoint-initdb
          mountPath: /docker-entrypoint-initdb.d/aaa_portal_single.cql
          subPath: portal_single.cql
        - name: {{ include "common.fullname" . }}-data
          mountPath: /var/lib/cassandra/data
        resources:
{{ include "common.resources" . | indent 12 }}
      {{- if .Values.nodeSelector }}
      nodeSelector:
{{ toYaml .Values.nodeSelector | indent 10 }}
      {{- end -}}
      {{- if .Values.affinity }}
      affinity:
{{ toYaml .Values.affinity | indent 10 }}
      {{- end }}
      volumes:
        - name: cassandra-docker-entrypoint-initdb
          configMap:
            name: {{ include "common.fullname" . }}-docker-entry-initd
        - name: localtime
          hostPath:
            path: /etc/localtime
      {{- if .Values.persistence.enabled }}
        - name: {{ include "common.fullname" . }}-data
          persistentVolumeClaim:
            claimName: {{ include "common.fullname" . }}
      {{- else }}
          emptyDir: {}
      {{- end }}
      imagePullSecrets:
      - name: "{{ include "common.namespace" . }}-docker-registry-key"