Skip to content

Commit 67da3e6

Browse files
committed
Command Status and Reports for Http Application Profile
1 parent 94caa28 commit 67da3e6

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

python/avi/migrationtools/nsxt_converter/command_status.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,19 @@ VERSION_11:
7575
- "group_path"
7676
- "port"
7777

78+
Application_Http_Profile_supported_attr:
79+
- "x_forwarded_for"
80+
- "http_redirect_to_https"
81+
- "idle_timeout"
82+
- "request_header_size"
83+
- "request_body_size"
84+
- "description"
85+
- "display_name"
86+
- "resource_type"
87+
- "server_keep_alive"
88+
- "id"
89+
90+
7891
Common_Na_List:
7992
- "path"
8093
- "relative_path"

python/avi/migrationtools/nsxt_converter/profile_converter.py

+25
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,50 @@ def __init__(self, nsxt_profile_attributes):
77
"""
88
99
"""
10+
self.ap_http_supported_attributes = nsxt_profile_attributes['Application_Http_Profile_supported_attr']
11+
self.common_na_attr = nsxt_profile_attributes['Common_Na_List']
12+
1013

1114
def convert(self, alb_config, nsx_lb_config, prefix):
1215
alb_config['ApplicationProfile'] = list()
1316
alb_config['NetworkProfile'] = list()
17+
1418
for lb_pr in nsx_lb_config['LbAppProfiles']:
1519
name=lb_pr.get('display_name')
1620
if prefix:
1721
name=prefix+'-'+name
1822
alb_pr = dict(
1923
name=name,
2024
)
25+
26+
na_list = [val for val in lb_pr.keys()
27+
if val in self.common_na_attr]
28+
29+
2130
if lb_pr['resource_type'] == 'LBHttpProfile':
2231
self.convert_http(alb_pr,lb_pr)
2332
if lb_pr['resource_type'] == 'LBFastUdpProfile':
2433
self.convert_udp(alb_pr,lb_pr)
2534
if lb_pr['resource_type'] == 'LBFastTcpProfile':
2635
self.convert_tcp(alb_pr,lb_pr)
2736

37+
indirect = []
38+
u_ignore = []
39+
ignore_for_defaults = {}
40+
2841
if lb_pr['resource_type'] == 'LBHttpProfile':
42+
skipped = [val for val in lb_pr.keys()
43+
if val not in self.ap_http_supported_attributes]
44+
if lb_pr.get("description"):
45+
alb_pr["description"] = lb_pr['description']
46+
2947
alb_config['ApplicationProfile'].append(alb_pr)
48+
49+
conv_status = conv_utils.get_conv_status(
50+
skipped, indirect, ignore_for_defaults, nsx_lb_config['LbAppProfiles'],
51+
u_ignore, na_list)
52+
conv_utils.add_conv_status('ApplicationHttpProfile', lb_pr['resource_type'], alb_pr['name'], conv_status,
53+
[{'application_http_profile': alb_pr}])
3054
else:
3155
alb_config['NetworkProfile'].append(alb_pr)
3256

@@ -40,6 +64,7 @@ def convert_http(self,alb_pr,lb_pr):
4064
http_to_https=lb_pr.get('httpRedirectToHttps',False),
4165
keepalive_timeout=lb_pr.get('idle_timeout'),
4266
client_max_header_size=lb_pr.get('request_header_size'),
67+
keepalive_header=lb_pr.get('server_keep_alive'),
4368
client_max_body_size=lb_pr.get('requestBodySize')
4469
)
4570

0 commit comments

Comments
 (0)