File: SoftLayer_Network_Vlan_Firewall.py

package info (click to toggle)
python-softlayer 5.8.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,888 kB
  • sloc: python: 41,631; makefile: 289; sh: 43
file content (84 lines) | stat: -rw-r--r-- 2,495 bytes parent folder | download | duplicates (4)
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
createCancelServerTicket = {'id': 1234, 'title': 'Server Cancellation Request'}
getObject = {
    "administrativeBypassFlag": "",
    "customerManagedFlag": False,
    "billingItem": {
        "id": 21370815
    },
    "id": 3130,
    "primaryIpAddress": "192.155.239.146",
    "networkVlan": {
        "accountId": 307608,
        "id": 371028,
        "primarySubnetId": 536252,
        "vlanNumber": 1489,
        "firewallInterfaces": [
            {
                "id": 6254,
                "name": "inside",
                "firewallContextAccessControlLists": [
                    {
                        "direction": "out",
                        "firewallContextInterfaceId": 6257,
                        "id": 3143
                    }
                ]
            },
            {
                "id": 6256,
                "name": "outside",
                "firewallContextAccessControlLists": [
                    {
                        "direction": "out",
                        "firewallContextInterfaceId": 6257,
                        "id": 3143
                    },
                    {
                        "direction": "in",
                        "firewallContextInterfaceId": 6256,
                        "id": 3142
                    }
                ]
            }
        ]
    }
}

getRules = [
    {
        'destinationIpAddress': 'any on server',
        'protocol': 'tcp',
        'orderValue': 1,
        'destinationIpSubnetMask': '255.255.255.255',
        'destinationPortRangeStart': 80,
        'sourceIpSubnetMask': '0.0.0.0',
        'destinationPortRangeEnd': 80,
        'version': 4,
        'action': 'permit',
        'sourceIpAddress': '0.0.0.0'
    },
    {
        'destinationIpAddress': 'any on server',
        'protocol': 'tcp',
        'orderValue': 2,
        'destinationIpSubnetMask': '255.255.255.255',
        'destinationPortRangeStart': 1,
        'sourceIpSubnetMask': '255.255.255.255',
        'destinationPortRangeEnd': 65535,
        'version': 4,
        'action': 'permit',
        'sourceIpAddress': '193.212.1.10'
    },
    {
        'destinationIpAddress': 'any on server',
        'protocol': 'tcp',
        'orderValue': 3,
        'destinationIpSubnetMask': '255.255.255.255',
        'destinationPortRangeStart': 80,
        'sourceIpSubnetMask': '0.0.0.0',
        'destinationPortRangeEnd': 800,
        'version': 4,
        'action': 'permit',
        'sourceIpAddress': '0.0.0.0'
    }
]