NetApp ONTAP with Python netapp-ontap - create vault policy

65 Views Asked by At

I am trying to create a custom policy using netapp-ontap python library, version 9.11.1. I can do the same using the CLI snapmirror policy create as show here where I can specify -type vault. I don't seem to see the way to do this using the Python library. I am assuming I should be using SnapmirrorPolicy resource to do this but that does not allow me to specify type and just creates mirror-vault type.

Any ideas how could I get the custom vault policy created?

1

There are 1 best solutions below

0
On

This might not be the most elegant way to do this but for now I have done:

    cli = CLI()
    cli.set_connection(connection)
    response = cli.execute(
        'snapmirror policy create',
        body={
            'vserver': SVM_NAME,
            'policy': POLICY_NAME,
            'type': 'vault'
        }
    )
    response.poll()

still seeking for a better answer using the built in Python resource so if you know of a better way please post.