aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-create-policy.xml
blob: c6d45de28ab14912be436e82d1aacc9516076ea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<service-logic
    xmlns='http://www.onap.org/sdnc/svclogic'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
    <method rpc='policy-manager-create-policy' mode='sync'>
        <block atomic="true">
            <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
                <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.createpolicy.templatefile`" />
                <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/createPolicy'`" />
                <parameter name='format' value='json' />
                <parameter name='httpMethod' value='PUT' />
                <parameter name='convertResponse' value="false" />
                <parameter name='customHttpHeaders'
      value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
                <outcome value='success'>
                    <block atomic="true">
                        <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
                            <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.pushpolicy.templatefile`" />
                            <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/pushPolicy'`" />
                            <parameter name='format' value='json' />
                            <parameter name='httpMethod' value='PUT' />
                            <parameter name='convertResponse' value="false" />
                            <parameter name='customHttpHeaders'
      value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" />
                            <outcome value='success'>
                                <block atomic="true"></block>
                            </outcome>
                            <outcome value='Other'>
                                <return status='failure'>
                                    <parameter name='error-code' value='500' />
                                    <parameter name='error-message' value='Failed to push policy in Policy Manager' />
                                </return>
                            </outcome>
                        </execute>
                    </block>
                </outcome>
                <outcome value='Other'>
                    <return status='failure'>
                        <parameter name='error-code' value='500' />
                        <parameter name='error-message' value='Failed to create policy in Policy Manager' />
                    </return>
                </outcome>
            </execute>
            <return status='success'></return>
        </block>
    </method>
</service-logic>
{ end -}} readinessProbe: tcpSocket: port: {{ .Values.service.externalPort }} initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} periodSeconds: {{ .Values.readiness.periodSeconds }} env: - name: enableCadi value: "true" volumeMounts: - mountPath: /etc/localtime name: localtime readOnly: true - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties subPath: MsgRtrApi.properties name: appprops - mountPath: /appl/dmaapMR1/bundleconfig/etc/logback.xml subPath: logback.xml name: logback - mountPath: /appl/dmaapMR1/etc/cadi.properties subPath: cadi.properties name: cadi - mountPath: /appl/dmaapMR1/etc/keyfile subPath: mykey name: mykey resources: {{ include "common.resources" . | indent 12 }} volumes: - name: localtime hostPath: path: /etc/localtime - name: appprops configMap: name: {{ include "common.fullname" . }}-msgrtrapi-prop-configmap - name: logback configMap: name: {{ include "common.fullname" . }}-logback-xml-configmap - name: cadi configMap: name: {{ include "common.fullname" . }}-cadi-prop-configmap - name: mykey secret: secretName: {{ include "common.fullname" . }}-secret imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key"