@@ -657,6 +657,22 @@ def _build_query_params(
657
657
elif parent == "virtual_chassis" :
658
658
query_dict = {"q" : self .module .params ["data" ].get ("master" )}
659
659
660
+ elif parent == "rear_port" and self .endpoint == "front_ports" :
661
+ if isinstance (module_data .get ("rear_port" ), str ):
662
+ rear_port = {
663
+ "device_id" : module_data .get ("device" ),
664
+ "name" : module_data .get ("rear_port" ),
665
+ }
666
+ query_dict .update (rear_port )
667
+
668
+ elif parent == "rear_port_template" and self .endpoint == "front_port_templates" :
669
+ if isinstance (module_data .get ("rear_port_template" ), str ):
670
+ rear_port_template = {
671
+ "devicetype_id" : module_data .get ("device_type" ),
672
+ "name" : module_data .get ("rear_port_template" ),
673
+ }
674
+ query_dict .update (rear_port_template )
675
+
660
676
query_dict = self ._convert_identical_keys (query_dict )
661
677
return query_dict
662
678
@@ -747,7 +763,7 @@ def _find_ids(self, data, user_query_params):
747
763
else :
748
764
self ._handle_errors (msg = "%s not found" % (list_item ))
749
765
else :
750
- if k in ["lag" ]:
766
+ if k in ["lag" , "rear_port" , "rear_port_template" ]:
751
767
query_params = self ._build_query_params (
752
768
k , data , user_query_params
753
769
)
0 commit comments