Browse Source

Create entry with a list of plain string as group

Change-Id: Ib1a7ebdf6977b78dfbf25606b1f455869c254f2d
changes/97/749297/1
lxiaopei 2 years ago
parent
commit
0d263ec65e
  1. 15
      vmware_nsxlib/v3/policy/core_resources.py

15
vmware_nsxlib/v3/policy/core_resources.py

@ -3417,12 +3417,22 @@ class NsxPolicySecurityPolicyBaseApi(NsxPolicyResourceBase):
direction=nsx_constants.IN_OUT,
logged=False, tag=None,
service_entries=IGNORE,
tenant=constants.POLICY_INFRA_TENANT):
tenant=constants.POLICY_INFRA_TENANT,
plain_groups=False):
"""Create CommunicationMap Entry.
source_groups/dest_groups should be a list of group ids belonging
to the domain.
plain_groups should be True if source_groups/dest_groups is a list
of group paths and IP addresses. IP address support from NSX 3.0.0.
"""
if (version.LooseVersion(self.version) <
version.LooseVersion(nsx_constants.NSX_VERSION_3_0_0) and
plain_groups):
err_msg = _("plain_groups support is from NSX 3.0.0")
raise exceptions.NsxLibInvalidInput(error_message=err_msg)
# get the next available sequence number
if not sequence_number:
last_sequence = self._get_last_seq_num(domain_id, map_id,
@ -3447,7 +3457,8 @@ class NsxPolicySecurityPolicyBaseApi(NsxPolicyResourceBase):
logged=logged,
tag=tag,
service_entries=service_entries,
tenant=tenant)
tenant=tenant,
plain_groups=plain_groups)
self._create_or_store(entry_def)
return entry_id

Loading…
Cancel
Save