@@ -7,26 +7,50 @@ def __init__(self, nsxt_profile_attributes):
7
7
"""
8
8
9
9
"""
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
+
10
13
11
14
def convert (self , alb_config , nsx_lb_config , prefix ):
12
15
alb_config ['ApplicationProfile' ] = list ()
13
16
alb_config ['NetworkProfile' ] = list ()
17
+
14
18
for lb_pr in nsx_lb_config ['LbAppProfiles' ]:
15
19
name = lb_pr .get ('display_name' )
16
20
if prefix :
17
21
name = prefix + '-' + name
18
22
alb_pr = dict (
19
23
name = name ,
20
24
)
25
+
26
+ na_list = [val for val in lb_pr .keys ()
27
+ if val in self .common_na_attr ]
28
+
29
+
21
30
if lb_pr ['resource_type' ] == 'LBHttpProfile' :
22
31
self .convert_http (alb_pr ,lb_pr )
23
32
if lb_pr ['resource_type' ] == 'LBFastUdpProfile' :
24
33
self .convert_udp (alb_pr ,lb_pr )
25
34
if lb_pr ['resource_type' ] == 'LBFastTcpProfile' :
26
35
self .convert_tcp (alb_pr ,lb_pr )
27
36
37
+ indirect = []
38
+ u_ignore = []
39
+ ignore_for_defaults = {}
40
+
28
41
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
+
29
47
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 }])
30
54
else :
31
55
alb_config ['NetworkProfile' ].append (alb_pr )
32
56
@@ -40,6 +64,7 @@ def convert_http(self,alb_pr,lb_pr):
40
64
http_to_https = lb_pr .get ('httpRedirectToHttps' ,False ),
41
65
keepalive_timeout = lb_pr .get ('idle_timeout' ),
42
66
client_max_header_size = lb_pr .get ('request_header_size' ),
67
+ keepalive_header = lb_pr .get ('server_keep_alive' ),
43
68
client_max_body_size = lb_pr .get ('requestBodySize' )
44
69
)
45
70
0 commit comments