I wrote this code to generate an export policy but each time i run it i get this 400 error saying "clientmatch is a required filed".
I dont know what exactly is missing and in what format do I add it so please offer me some guideance, as the client list of dicts apparently is incorect for ontap 9.11 which is what im running
def create_export_policy(svm_uuid, name, hostname=None, ip=None):
resource = ExportPolicy()
resource.name = name
resource.rules = [
{
# "client": [{"match": f"{hostname}"}, {"match": f"{ip}"}],
"clientmatch": [f"{ip}/22"],
"ro_rule": ["sys"],
"rw_rule": ["sys"],
"su_rule": ["sys"],
},
]
resource.svm = {"uuid": svm_uuid}
resource.protocols = ["nfs"]
try:
resource.post()
except Exception as e:
print(e)