2344ab9c8aac9e1006d0b3169cb49d62267d2e1f
[policy/models.git] / models-interactions / model-yaml / src / test / resources / v2.0.0 / policy_vService.yaml
1 # Copyright 2018 AT&T Intellectual Property. All rights reserved
2 # Modifications Copyright (C) 2019 Nordix Foundation.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 controlLoop:
16   version: 2.0.0
17   controlLoopName: ControlLoop-GENERIC-64cdc9fa-6601-4989-9de7-8f47134aa043
18   #
19   # Example of how someone can fine-grain this
20   # policy for a specific service and/or resources
21   # contained within the service.
22   #
23   services:
24     - serviceName: vFooService
25  
26   resources:
27     - resourceName: vVNF1
28       resourceType: VFC
29     - resourceName: vVNF2
30       resourceType: VFC
31     - resourceName: vVNF3
32       resourceType: VFC
33     - resourceName: vVNF4
34       resourceType: VFC
35  
36   trigger_policy: unique-policy-id-1-restart
37   timeout: 1200
38   #
39   # Example of case where an abatement isn't possible
40   # from DCAE to Policy. So Policy should NOT expect
41   #
42   abatement: false
43  
44 policies:
45  
46   - id: unique-policy-id-1-restart
47     name: Restart Policy
48     description:
49     actor: APPC
50     recipe: Restart
51     target:
52       type: VM
53     retry: 2
54     timeout: 300
55     success: unique-policy-id-1-healthdiagnostic
56     failure: unique-policy-id-2-rebuild
57     failure_timeout: unique-policy-id-2-rebuild
58     failure_retries: unique-policy-id-2-rebuild
59     failure_exception: final_failure_exception
60     failure_guard: unique-policy-id-2-rebuild
61    
62  
63   - id: unique-policy-id-2-rebuild
64     name: Rebuild Policy
65     description:
66     actor: APPC
67     recipe: Rebuild
68     target:
69       type: VM
70     retry: 0
71     timeout: 600
72     success: unique-policy-id-2-healthdiagnostic
73     failure: unique-policy-id-3-migrate
74     failure_timeout: unique-policy-id-3-migrate
75     failure_retries: unique-policy-id-3-migrate
76     failure_exception: final_failure_exception
77     failure_guard: unique-policy-id-3-migrate
78  
79   - id: unique-policy-id-3-migrate
80     name: Migrate Policy
81     description:
82     actor: APPC
83     recipe: Migrate
84     target:
85       type: VM
86     retry: 0
87     timeout: 600
88     success: final_success
89     failure: final_failure
90     failure_timeout: final_failure_timeout
91     failure_retries: final_failure_retries
92     failure_exception: final_failure_exception
93     failure_guard: final_failure_guard
94  
95   - id: unique-policy-id-1-healthdiagnostic
96     name: Do A Health Diagnostic
97     description:
98     actor: APPC
99     recipe: health-diagnostic
100     # Example of a payload
101     payload:
102       health-diagnostic-code: HC01234
103       health-diagnostic-code-parameters: "{\"Junk\":\"--version\",\"Junk2\":\"--help\"}"
104     target:
105       type: VM
106     retry: 0
107     timeout: 600
108     success: final_success
109     failure: unique-policy-id-2-rebuild
110     failure_timeout: unique-policy-id-2-rebuild
111     failure_retries: unique-policy-id-2-rebuild
112     failure_exception: final_failure_exception
113     failure_guard: unique-policy-id-2-rebuild
114  
115  
116   - id: unique-policy-id-2-healthdiagnostic
117     name: Do Health Diagnostic
118     description:
119     actor: APPC
120     recipe: health-diagnostic
121     payload:
122       health-diagnostic-code: HC01234
123       health-diagnostic-code-parameters: "{\"Junk\":\"--version\",\"Junk2\":\"--help\"}"
124     target:
125       type: VM
126     retry: 0
127     timeout: 600
128     success: final_success
129     failure: final_failure
130     failure_timeout: final_failure_timeout
131     failure_retries: final_failure_retries
132     failure_exception: final_failure_exception
133     failure_guard: final_failure_guard
134     
135