aboutsummaryrefslogtreecommitdiffstats
path: root/app/test/event_based_scan/test_data/event_payload_subnet_add.py
blob: 6e1caea3ce7198e8462dc11f4c5cd103a59fa76b (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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
###############################################################################
# Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems)   #
# and others                                                                  #
#                                                                             #
# All rights reserved. This program and the accompanying materials            #
# are made available under the terms of the Apache License, Version 2.0       #
# which accompanies this distribution, and is available at                    #
# http://www.apache.org/licenses/LICENSE-2.0                                  #
###############################################################################
import datetime

from test.event_based_scan.test_data.test_config import ENV_CONFIG

NETWORK_DOC = {'port_security_enabled': True, 'status': 'ACTIVE', 'subnet_ids': [], 'parent_type': 'networks_folder',
               'parent_id': '75c0eb79ff4a42b0ae4973c8375ddf40-networks', 'parent_text': 'Networks', 'subnets': {},
               'admin_state_up': True, 'show_in_tree': True, 'project': 'calipso-project',
               'name_path': '/' + ENV_CONFIG + '/Projects/calipso-project/Networks/testsubnetadd',
               'router:external': False,
               'provider:physical_network': None,
               'id_path': '/' + ENV_CONFIG + '/' + ENV_CONFIG + '-projects/75c0eb79ff4a42b0ae4973c8375ddf40/75c0eb79ff4a42b0' +
                          'ae4973c8375ddf40-networks/1bb0ba6c-6863-4121-ac89-93f81a9da2b0',
               'object_name': 'testsubnetadd', 'provider:segmentation_id': 46, 'provider:network_type': 'vxlan',
               'tenant_id': '75c0eb79ff4a42b0ae4973c8375ddf40', 'environment': ENV_CONFIG, 'name': 'testsubnetadd',
               'last_scanned': '2016-10-13 00:20:59.280329', 'id': '1bb0ba6c-6863-4121-ac89-93f81a9da2b0', 'cidrs': [],
               'type': 'network', 'network': '1bb0ba6c-6863-4121-ac89-93f81a9da2b0', 'shared': False, 'mtu': 1400}

EVENT_PAYLOAD_SUBNET_ADD = {
    'payload': {
        'subnet': {'dns_nameservers': [], 'ipv6_address_mode': None, 'ipv6_ra_mode': None, 'gateway_ip': '172.16.10.1',
                   'allocation_pools': [{'start': '172.16.10.2', 'end': '172.16.10.126'}], 'enable_dhcp': True,
                   'id': 'e950055d-231c-4380-983c-a258ea958d58', 'network_id': '1bb0ba6c-6863-4121-ac89-93f81a9da2b0',
                   'tenant_id': '75c0eb79ff4a42b0ae4973c8375ddf40', 'ip_version': 4, 'cidr': '172.16.10.0/25',
                   'subnetpool_id': None, 'name': 'testsubnetadd', 'host_routes': []}}, '_context_domain': None,
    'timestamp': '2016-10-13 00:20:59.776358', '_context_project_domain': None, '_context_user_domain': None,
    '_context_project_id': '75c0eb79ff4a42b0ae4973c8375ddf40', 'publisher_id': 'network.node-6.cisco.com',
    '_context_user': '13baa553aae44adca6615e711fd2f6d9', '_context_user_id': '13baa553aae44adca6615e711fd2f6d9',
    'event_type': 'subnet.create.end', 'message_id': '90581321-e9c9-4112-8fe6-38ebf57d5b6b',
    '_context_tenant': '75c0eb79ff4a42b0ae4973c8375ddf40', '_context_tenant_name': 'calipso-project',
    '_context_project_name': 'calipso-project', '_context_user_name': 'admin', '_context_resource_uuid': None,
    '_unique_id': 'e8b328229a724938a6bc63f9db737f49', '_context_request_id': 'req-20cfc138-4e1a-472d-b996-7f27ac58446d',
    'priority': 'INFO', '_context_roles': ['_member_', 'admin'],
    '_context_auth_token': 'gAAAAABX_tLMEzC9KhdcD20novcuvgwmpQkwV9hOk86d4AZlsQwXSRbCwBZgUPQZco4VsuCg59_gFeM_scBVmI' +
                           'dDysNUrAhZctDzXneM0cb5nBtjJTfJPpI2_kKgAuGDBARrHZpNs-vPg-SjMtu87w2rgTKfda6idTMKWG3ipe' +
                           '-jXrgNN7p-2kkJzGhZXbMaaeBs3XU-X_ew',
    '_context_read_only': False,
    '_context_user_identity': '13baa553aae44adca6615e711fd2f6d9 75c0eb79ff4a42b0ae4973c8375ddf40 - - -',
    '_context_tenant_id': '75c0eb79ff4a42b0ae4973c8375ddf40', '_context_is_admin': True, '_context_show_deleted': False,
    '_context_timestamp': '2016-10-13 00:20:59.307917'}

EVENT_PAYLOAD_REGION = {
    'RegionOne': {
        'object_name': 'RegionOne', 'id': 'RegionOne', 'name': 'RegionOne',
        'environment': ENV_CONFIG,
                                 'last_scanned': datetime.datetime.utcnow(),
        'name_path': '/' + ENV_CONFIG + '/Regions/RegionOne',
        'parent_id': ENV_CONFIG + '-regions', 'parent_type': 'regions_folder',
        'endpoints': {'nova': {'id': '274cbbd9fd6d4311b78e78dd3a1df51f',
                               'adminURL': 'http://192.168.0.2:8774/v2/8c1751e0ce714736a63fee3c776164da',
                               'service_type': 'compute',
                               'publicURL': 'http://172.16.0.3:8774/v2/8c1751e0ce714736a63fee3c776164da',
                               'internalURL': 'http://192.168.0.2:8774/v2/8c1751e0ce714736a63fee3c776164da'},
                      'heat-cfn': {'id': '0f04ec6ed49f4940822161bf677bdfb2',
                                   'adminURL': 'http://192.168.0.2:8000/v1',
                                   'service_type': 'cloudformation',
                                   'publicURL': 'http://172.16.0.3:8000/v1',
                                   'internalURL': 'http://192.168.0.2:8000/v1'},
                      'nova_ec2': {'id': '390dddc753cc4d378b489129d06c4b7d',
                                   'adminURL': 'http://192.168.0.2:8773/services/Admin',
                                   'service_type': 'ec2',
                                   'publicURL': 'http://172.16.0.3:8773/services/Cloud',
                                   'internalURL': 'http://192.168.0.2:8773/services/Cloud'},
                      'glance': {'id': '475c6c77a94e4e63a5a0f0e767f697a8',
                                 'adminURL': 'http://192.168.0.2:9292',
                                 'service_type': 'image',
                                 'publicURL': 'http://172.16.0.3:9292',
                                 'internalURL': 'http://192.168.0.2:9292'},
                      'swift': {'id': '12e78e06595f48339baebdb5d4309c70',
                                'adminURL': 'http://192.168.0.2:8080/v1/AUTH_8c1751e0ce714736a63fee3c776164da',
                                'service_type': 'object-store',
                                'publicURL': 'http://172.16.0.3:8080/v1/AUTH_8c1751e0ce714736a63fee3c776164da',
                                'internalURL': 'http://192.168.0.2:8080/v1/AUTH_8c1751e0ce714736a63fee3c776164da'},
                      'swift_s3': {'id': '4f655c8f2bef46a0a7ba4a20bba53666',
                                   'adminURL': 'http://192.168.0.2:8080',
                                   'service_type': 's3',
                                   'publicURL': 'http://172.16.0.3:8080',
                                   'internalURL': 'http://192.168.0.2:8080'},
                      'keystone': {'id': '404cceb349614eb39857742970408301',
                                   'adminURL': 'http://192.168.0.2:35357/v2.0',
                                   'service_type': 'identity',
                                   'publicURL': 'http://172.16.0.3:5000/v2.0',
                                   'internalURL': 'http://192.168.0.2:5000/v2.0'},
                      'cinderv2': {'id': '2c30937688e944889db4a64fab6816e6',
                                   'adminURL': 'http://192.168.0.2:8776/v2/8c1751e0ce714736a63fee3c776164da',
                                   'service_type': 'volumev2',
                                   'publicURL': 'http://172.16.0.3:8776/v2/8c1751e0ce714736a63fee3c776164da',
                                   'internalURL': 'http://192.168.0.2:8776/v2/8c1751e0ce714736a63fee3c776164da'},
                      'novav3': {'id': '1df917160dfb4ce5b469764fde22b3ab',
                                 'adminURL': 'http://192.168.0.2:8774/v3',
                                 'service_type': 'computev3',
                                 'publicURL': 'http://172.16.0.3:8774/v3',
                                 'internalURL': 'http://192.168.0.2:8774/v3'},
                      'ceilometer': {'id': '617177a3dcb64560a5a79ab0a91a7225',
                                     'adminURL': 'http://192.168.0.2:8777',
                                     'service_type': 'metering',
                                     'publicURL': 'http://172.16.0.3:8777',
                                     'internalURL': 'http://192.168.0.2:8777'},
                      'neutron': {'id': '8dc28584da224c4b9671171ead3c982a',
                                  'adminURL': 'http://192.168.0.2:9696',
                                  'service_type': 'network',
                                  'publicURL': 'http://172.16.0.3:9696',
                                  'internalURL': 'http://192.168.0.2:9696'},
                      'cinder': {'id': '05643f2cf9094265b432376571851841',
                                 'adminURL': 'http://192.168.0.2:8776/v1/8c1751e0ce714736a63fee3c776164da',
                                 'service_type': 'volume',
                                 'publicURL': 'http://172.16.0.3:8776/v1/8c1751e0ce714736a63fee3c776164da',
                                 'internalURL': 'http://192.168.0.2:8776/v1/8c1751e0ce714736a63fee3c776164da'},
                      'heat': {'id': '9e60268a5aaf422d9e42f0caab0a19b4',
                               'adminURL': 'http://192.168.0.2:8004/v1/8c1751e0ce714736a63fee3c776164da',
                               'service_type': 'orchestration',
                               'publicURL': 'http://172.16.0.3:8004/v1/8c1751e0ce714736a63fee3c776164da',
                               'internalURL': 'http://192.168.0.2:8004/v1/8c1751e0ce714736a63fee3c776164da'}},
        'show_in_tree': True,
        'id_path': '/' + ENV_CONFIG + '/' + ENV_CONFIG + '-regions/RegionOne',
        'type': 'region'}}


HOST_DOC = {
    "environment": ENV_CONFIG,
    "host": "node-6.cisco.com",
    "host_type": [
        "Controller",
        "Network"
    ],
    "id": "node-6.cisco.com",
    "id_path": "/" + ENV_CONFIG + "/" + ENV_CONFIG + "-regions/RegionOne/RegionOne-availability_zones" +
               "/internal/node-6.cisco.com",
    "name": "node-6.cisco.com",
    "name_path": "/" + ENV_CONFIG + "/Regions/RegionOne/Availability Zones/internal/node-6.cisco.com",
    "object_name": "node-6.cisco.com",
    "parent_id": "internal",
    "parent_type": "availability_zone",
    "show_in_tree": True,
    "type": "host",
    "zone": "internal"
}

PORT_DOC = {
    "admin_state_up": True,
    "device_id": "c57216ca-c1c4-430d-a045-32851ca879e3",
    "device_owner": "compute:nova",
    "dns_assignment": [
        {
            "hostname": "host-172-16-10-1",
            "ip_address": "172.16.10.1",
            "fqdn": "host-172-16-10-1.openstacklocal."
        }
    ],
    "dns_name": "",
    "environment": ENV_CONFIG,
    "extra_dhcp_opts": [

    ],
    "fixed_ips": [
        {
            "ip_address": "172.16.10.1",
            "subnet_id": "6f6ef3b5-76c9-4f70-81e5-f3cc196db025"
        }
    ],
    "id": "2233445-55b6-4c05-9480-4bc648845c6f",
    "id_path": ENV_CONFIG + "/" + ENV_CONFIG + "-projects/75c0eb79ff4a42b0ae4973c8375ddf40/75c0eb79ff4a42b0ae4973c837" +
               "5ddf40-networks/1bb0ba6c-6863-4121-ac89-93f81a9da2b0/1bb0ba6c-6863-4121-ac89-93f81a9da2b0-ports" +
               "/2233445-55b6-4c05-9480-4bc648845c6f",
    "last_scanned": 0,
    "mac_address": "fa:16:3e:13:b2:aa",
    "master_parent_id": "1bb0ba6c-6863-4121-ac89-93f81a9da2b0",
    "master_parent_type": "network",
    "name": "fa:16:3e:13:b2:aa",
    "name_path": "/" + ENV_CONFIG + "/Projects/calipso-project/Networks/test_interface/Ports/" +
                 "2233445-55b6-4c05-9480-4bc648845c6f",
    "network_id": "1bb0ba6c-6863-4121-ac89-93f81a9da2b0",
    "object_name": "2233445-55b6-4c05-9480-4bc648845c6f",
    "parent_id": "1bb0ba6c-6863-4121-ac89-93f81a9da2b0-ports",
    "parent_text": "Ports",
    "parent_type": "ports_folder",
    "port_security_enabled": False,
    "project": "calipso-project",
    "security_groups": [

    ],
    "status": "DOWN",
    "tenant_id": "75c0eb79ff4a42b0ae4973c8375ddf40",
    "type": "port"
}