Hi,
That's an interesting use case, honestly i'm not sure if that's possible? Assuming your intention is to avoid duplicate IP's (clientmatch) in your export policy rules??? Perhaps one way to go about it would be to apply conditional logic to the command that adds the export rule (IE if the clientmatch is found within a list of existing clientmatches then disable the command). This way only clientmatches that dont exist in the export policy rules would be processed.
I haven't tested it yet but my an initial thought was to add a search command before you add the export policy rule using a variable named "clientmatch". If clientmatch is found based on the user input IP address then disable the command to add the export policy rule otherwise add it. EG:
SELECT
vserver.name AS 'policy.vserver.name',
cluster.primary_address AS 'policy.vserver.cluster.primary_address',
export_rule.clientmatch AS 'clientmatch',
export_rule.rule_index AS 'rule_index',
export_policy.name AS 'policy.name'
FROM
cm_storage.export_policy,
cm_storage.export_rule,
cm_storage.volume,
cm_storage.vserver,
cm_storage.cluster
WHERE
vserver.cluster_id = cluster.id
AND
volume.vserver_id = vserver.id
AND
export_policy.vserver_id = vserver.id
AND
volume.export_policy_id = export_policy.id
AND
export_rule.policy_id = export_policy.id
AND
export_rule.clientmatch = '${ClientMatch}'
AND
volume.name = '${VolumeName}'
AND
vserver.name = '${VserverName}'
AND (
cluster.primary_address = '${Cluster}' OR
cluster.name = '${Cluster}'
)
Please let me know if you think might meet your requirement?
/Matt
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.