blob: c6453bd1d954f0bcd2c8a63c971a4775377cfec3 (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
#
# 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.
LB_TEMPLATE = '''
heat_template_version: 2016-04-08
description: Create a loadbalancer
resources:
lb:
type: OS::Octavia::LoadBalancer
properties:
name: my_lb
description: my loadbalancer
vip_address: 10.0.0.4
vip_subnet: sub123
provider: octavia
tenant_id: 1234
admin_state_up: True
flavor: f123
'''
LISTENER_TEMPLATE = '''
heat_template_version: 2016-04-08
description: Create a listener
resources:
listener:
type: OS::Octavia::Listener
properties:
protocol_port: 80
protocol: TCP
loadbalancer: 123
default_pool: my_pool
name: my_listener
description: my listener
admin_state_up: True
default_tls_container_ref: ref
sni_container_refs:
- ref1
- ref2
connection_limit: -1
tenant_id: 1234
allowed_cidrs:
- 10.10.0.0/16
- 192.168.0.0/16
'''
POOL_TEMPLATE = '''
heat_template_version: 2016-04-08
description: Create a pool
resources:
pool:
type: OS::Octavia::Pool
properties:
name: my_pool
description: my pool
session_persistence:
type: HTTP_COOKIE
lb_algorithm: ROUND_ROBIN
loadbalancer: my_lb
listener: 123
protocol: HTTP
admin_state_up: True
'''
MEMBER_TEMPLATE = '''
heat_template_version: 2016-04-08
description: Create a pool member
resources:
member:
type: OS::Octavia::PoolMember
properties:
pool: 123
address: 1.2.3.4
protocol_port: 80
weight: 1
subnet: sub123
admin_state_up: True
tags: ['tag1', 'tag2']
'''
MONITOR_TEMPLATE = '''
heat_template_version: 2016-04-08
description: Create a health monitor
resources:
monitor:
type: OS::Octavia::HealthMonitor
properties:
admin_state_up: True
delay: 3
expected_codes: 200-202
http_method: HEAD
max_retries: 5
pool: 123
timeout: 10
type: HTTP
url_path: /health
'''
L7POLICY_TEMPLATE = '''
heat_template_version: 2016-04-08
description: Template to test L7Policy Neutron resource
resources:
l7policy:
type: OS::Octavia::L7Policy
properties:
admin_state_up: True
name: test_l7policy
description: test l7policy resource
action: REDIRECT_TO_URL
redirect_url: http://www.mirantis.com
listener: 123
position: 1
'''
L7RULE_TEMPLATE = '''
heat_template_version: 2016-04-08
description: Template to test L7Rule Neutron resource
resources:
l7rule:
type: OS::Octavia::L7Rule
properties:
admin_state_up: True
l7policy: 123
type: HEADER
compare_type: ENDS_WITH
key: test_key
value: test_value
invert: False
'''
FLAVORPROFILE_TEMPLATE = '''
heat_template_version: 2016-10-14
description: Template to test FlavorProfile Octavia resource
resources:
flavor_profile:
type: OS::Octavia::FlavorProfile
properties:
name: test_flavor_profile
provider_name: test_provider
flavor_data: |
{"flavor_data_key": "flavor_data_value"}
'''
FLAVOR_TEMPLATE = '''
heat_template_version: 2016-10-14
description: Template to test Flavor Octavia resource
resources:
flavor:
type: OS::Octavia::Flavor
properties:
flavor_profile: test_flavor_profile_id
name: test_name
description: test_description
enabled: True
'''
|