@@ -841,6 +841,37 @@ def get_model_attribute_name_and_value(self, location, wlst_attribute_name, wlst
841
841
result = {model_attribute_name : model_attribute_value })
842
842
return model_attribute_name , model_attribute_value
843
843
844
+ def get_model_attribute_name (self , location , wlst_attribute_name ):
845
+ """
846
+ Returns the model attribute name for the specified WLST attribute name and value.
847
+
848
+ model_attribute_value will be set to None, if value assigned to wlst_attribute_value arg
849
+ is the default value for model_attribute_name.
850
+ :param location: the location
851
+ :param wlst_attribute_name: the WLST attribute name
852
+ :return: the name and value
853
+ :raises: AliasException: if an error occurs
854
+ """
855
+ _method_name = 'get_model_attribute_name'
856
+
857
+ self ._logger .entering (str (location ), wlst_attribute_name ,
858
+ class_name = self ._class_name , method_name = _method_name )
859
+ model_attribute_name = None
860
+
861
+ attribute_info = self ._alias_entries .get_alias_attribute_entry_by_wlst_name (location , wlst_attribute_name )
862
+ if attribute_info is not None :
863
+ model_attribute_name = attribute_info [MODEL_NAME ]
864
+
865
+ if wlst_attribute_name not in ('Id' , 'Tag' , 'Name' ) and model_attribute_name is None :
866
+ ex = exception_helper .create_alias_exception ('WLSDPLY-08406' , wlst_attribute_name ,
867
+ location .get_folder_path ())
868
+ self ._logger .throwing (ex , class_name = self ._class_name , method_name = _method_name )
869
+ raise ex
870
+
871
+ self ._logger .exiting (class_name = self ._class_name , method_name = _method_name ,
872
+ result = model_attribute_name )
873
+ return model_attribute_name
874
+
844
875
def get_model_attribute_names (self , location ):
845
876
"""
846
877
Returns the model attribute names for the specified location.
0 commit comments