"Fossies" - the Fresh Open Source Software Archive

Member "openstack-heat-13.0.0/heat/tests/openstack/octavia/inline_templates.py" (16 Oct 2019, 3201 Bytes) of package /linux/misc/openstack/openstack-heat-13.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "inline_templates.py": 12.0.0_vs_13.0.0.

    1 #
    2 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    3 #    not use this file except in compliance with the License. You may obtain
    4 #    a copy of the License at
    5 #
    6 #         http://www.apache.org/licenses/LICENSE-2.0
    7 #
    8 #    Unless required by applicable law or agreed to in writing, software
    9 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   10 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   11 #    License for the specific language governing permissions and limitations
   12 #    under the License.
   13 
   14 LB_TEMPLATE = '''
   15 heat_template_version: 2016-04-08
   16 description: Create a loadbalancer
   17 resources:
   18   lb:
   19     type: OS::Octavia::LoadBalancer
   20     properties:
   21       name: my_lb
   22       description: my loadbalancer
   23       vip_address: 10.0.0.4
   24       vip_subnet: sub123
   25       provider: octavia
   26       tenant_id: 1234
   27       admin_state_up: True
   28 '''
   29 
   30 LISTENER_TEMPLATE = '''
   31 heat_template_version: 2016-04-08
   32 description: Create a listener
   33 resources:
   34   listener:
   35     type: OS::Octavia::Listener
   36     properties:
   37       protocol_port: 80
   38       protocol: TCP
   39       loadbalancer: 123
   40       default_pool: my_pool
   41       name: my_listener
   42       description: my listener
   43       admin_state_up: True
   44       default_tls_container_ref: ref
   45       sni_container_refs:
   46         - ref1
   47         - ref2
   48       connection_limit: -1
   49       tenant_id: 1234
   50 '''
   51 
   52 POOL_TEMPLATE = '''
   53 heat_template_version: 2016-04-08
   54 description: Create a pool
   55 resources:
   56   pool:
   57     type: OS::Octavia::Pool
   58     properties:
   59       name: my_pool
   60       description: my pool
   61       session_persistence:
   62         type: HTTP_COOKIE
   63       lb_algorithm: ROUND_ROBIN
   64       loadbalancer: my_lb
   65       listener: 123
   66       protocol: HTTP
   67       admin_state_up: True
   68 '''
   69 
   70 MEMBER_TEMPLATE = '''
   71 heat_template_version: 2016-04-08
   72 description: Create a pool member
   73 resources:
   74   member:
   75     type: OS::Octavia::PoolMember
   76     properties:
   77       pool: 123
   78       address: 1.2.3.4
   79       protocol_port: 80
   80       weight: 1
   81       subnet: sub123
   82       admin_state_up: True
   83       tags: ['tag1', 'tag2']
   84 '''
   85 
   86 MONITOR_TEMPLATE = '''
   87 heat_template_version: 2016-04-08
   88 description: Create a health monitor
   89 resources:
   90   monitor:
   91     type: OS::Octavia::HealthMonitor
   92     properties:
   93       admin_state_up: True
   94       delay: 3
   95       expected_codes: 200-202
   96       http_method: HEAD
   97       max_retries: 5
   98       pool: 123
   99       timeout: 10
  100       type: HTTP
  101       url_path: /health
  102 '''
  103 
  104 L7POLICY_TEMPLATE = '''
  105 heat_template_version: 2016-04-08
  106 description: Template to test L7Policy Neutron resource
  107 resources:
  108   l7policy:
  109     type: OS::Octavia::L7Policy
  110     properties:
  111       admin_state_up: True
  112       name: test_l7policy
  113       description: test l7policy resource
  114       action: REDIRECT_TO_URL
  115       redirect_url: http://www.mirantis.com
  116       listener: 123
  117       position: 1
  118 '''
  119 
  120 L7RULE_TEMPLATE = '''
  121 heat_template_version: 2016-04-08
  122 description: Template to test L7Rule Neutron resource
  123 resources:
  124   l7rule:
  125     type: OS::Octavia::L7Rule
  126     properties:
  127       admin_state_up: True
  128       l7policy: 123
  129       type: HEADER
  130       compare_type: ENDS_WITH
  131       key: test_key
  132       value: test_value
  133       invert: False
  134 '''