# Module `netapp_ontap.resources.vscan`

Copyright © 2022 NetApp Inc. All rights reserved.

## Overview

Use Vscan to protect data from being compromised by viruses or other malicious code. Vscan combines best-in-class third party antivirus software with ONTAP features that give you the flexibility you need to control which files get scanned and when. Storage systems offload scanning operations to external servers hosting antivirus software from third party vendors. An Antivirus Connector on the external server handles communications between the storage system and the antivirus software.

## Examples

### Retrieving all of the Vscan configurations

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Vscan

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(list(Vscan.get_collection(fields="*", return_timeout=15)))

Try it out

    [
        Vscan(
            {
                "on_access_policies": [
                    {
                        "mandatory": True,
                        "name": "default_CIFS",
                        "scope": {
                            "scan_readonly_volumes": False,
                            "include_extensions": ["*"],
                            "max_file_size": 2147483648,
                            "only_execute_access": False,
                            "scan_without_extension": True,
                        },
                        "enabled": True,
                    },
                    {
                        "mandatory": True,
                        "name": "on-access-test1",
                        "scope": {
                            "scan_readonly_volumes": False,
                            "include_extensions": ["mp*", "txt"],
                            "max_file_size": 10000,
                            "exclude_paths": ["\\dir"],
                            "only_execute_access": False,
                            "exclude_extensions": ["mp*", "txt"],
                            "scan_without_extension": True,
                        },
                        "enabled": False,
                    },
                    {
                        "mandatory": True,
                        "name": "on-access-test2",
                        "scope": {
                            "scan_readonly_volumes": False,
                            "include_extensions": ["mp*", "txt"],
                            "max_file_size": 10000,
                            "exclude_paths": ["\\dir"],
                            "only_execute_access": False,
                            "exclude_extensions": ["mp*", "txt"],
                            "scan_without_extension": True,
                        },
                        "enabled": False,
                    },
                ],
                "on_demand_policies": [
                    {
                        "scope": {
                            "include_extensions": ["vmdk", "mp*"],
                            "max_file_size": 10000,
                            "exclude_paths": ["/vol1"],
                            "exclude_extensions": ["mp3", "mp4"],
                            "scan_without_extension": True,
                        },
                        "log_path": "/vol1",
                        "scan_paths": ["/vol1"],
                        "name": "task-1",
                    },
                    {
                        "scope": {
                            "include_extensions": ["vmdk", "mp*"],
                            "max_file_size": 10000,
                            "exclude_paths": ["/vol2"],
                            "exclude_extensions": ["mp3", "mp4"],
                            "scan_without_extension": True,
                        },
                        "log_path": "/vol2",
                        "scan_paths": ["/vol1"],
                        "name": "task-2",
                    },
                ],
                "enabled": True,
                "scanner_pools": [
                    {
                        "role": "primary",
                        "cluster": {
                            "uuid": "0228714d-f268-11e8-8851-0050568e5298",
                            "name": "Cluster1",
                        },
                        "privileged_users": ["cifs\\u1", "cifs\\u2"],
                        "servers": ["1.1.1.1", "10.72.204.27"],
                        "name": "scanner-1",
                    },
                    {
                        "role": "primary",
                        "cluster": {
                            "uuid": "0228714d-f268-11e8-8851-0050568e5298",
                            "name": "Cluster1",
                        },
                        "privileged_users": ["cifs\\u1", "cifs\\u2"],
                        "servers": ["1.1.1.1", "10.72.204.27"],
                        "name": "scanner-2",
                    },
                ],
                "svm": {"uuid": "03ce5c36-f269-11e8-8852-0050568e5298", "name": "vs1"},
            }
        ),
        Vscan(
            {
                "on_access_policies": [
                    {
                        "mandatory": True,
                        "name": "default_CIFS",
                        "scope": {
                            "scan_readonly_volumes": False,
                            "include_extensions": ["*"],
                            "max_file_size": 2147483648,
                            "only_execute_access": False,
                            "scan_without_extension": True,
                        },
                        "enabled": True,
                    },
                    {
                        "mandatory": True,
                        "name": "ap1",
                        "scope": {
                            "scan_readonly_volumes": False,
                            "include_extensions": ["*"],
                            "max_file_size": 2147483648,
                            "only_execute_access": False,
                            "scan_without_extension": True,
                        },
                        "enabled": False,
                    },
                ],
                "on_demand_policies": [
                    {
                        "scope": {
                            "include_extensions": ["*"],
                            "max_file_size": 10737418240,
                            "scan_without_extension": True,
                        },
                        "log_path": "/vol1",
                        "scan_paths": ["/vol1"],
                        "name": "t1",
                    }
                ],
                "enabled": False,
                "scanner_pools": [
                    {
                        "role": "idle",
                        "privileged_users": ["cifs\\u1"],
                        "servers": ["1.1.1.1"],
                        "name": "sp2",
                    }
                ],
                "svm": {"uuid": "24c2567a-f269-11e8-8852-0050568e5298", "name": "vs2"},
            }
        ),
    ]

### Retrieving all Vscan configurations for a particular SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Vscan

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Vscan(**{"svm.uuid": "24c2567a-f269-11e8-8852-0050568e5298"})
        resource.get(fields="*")
        print(resource)

Try it out

    Vscan(
        {
            "on_access_policies": [
                {
                    "mandatory": True,
                    "name": "default_CIFS",
                    "scope": {
                        "scan_readonly_volumes": False,
                        "include_extensions": ["*"],
                        "max_file_size": 2147483648,
                        "only_execute_access": False,
                        "scan_without_extension": True,
                    },
                    "enabled": True,
                },
                {
                    "mandatory": True,
                    "name": "ap1",
                    "scope": {
                        "scan_readonly_volumes": False,
                        "include_extensions": ["*"],
                        "max_file_size": 2147483648,
                        "only_execute_access": False,
                        "scan_without_extension": True,
                    },
                    "enabled": False,
                },
            ],
            "on_demand_policies": [
                {
                    "scope": {
                        "include_extensions": ["*"],
                        "max_file_size": 10737418240,
                        "scan_without_extension": True,
                    },
                    "log_path": "/vol1",
                    "scan_paths": ["/vol1"],
                    "name": "t1",
                }
            ],
            "enabled": False,
            "scanner_pools": [
                {
                    "role": "idle",
                    "privileged_users": ["cifs\\u1"],
                    "servers": ["1.1.1.1"],
                    "name": "sp2",
                }
            ],
            "svm": {"uuid": "24c2567a-f269-11e8-8852-0050568e5298", "name": "vs2"},
        }
    )

### Creating a Vscan configuration

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Vscan

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Vscan()
        resource.enabled = True
        resource.on_access_policies = [
            {
                "enabled": True,
                "mandatory": True,
                "name": "on-access-test",
                "scope": {
                    "exclude_extensions": ["mp*", "txt"],
                    "exclude_paths": ["\\vol"],
                    "include_extensions": ["mp*", "txt"],
                    "max_file_size": 21474,
                    "only_execute_access": False,
                    "scan_readonly_volumes": False,
                    "scan_without_extension": True,
                },
            }
        ]
        resource.on_demand_policies = [
            {
                "log_path": "/vol",
                "name": "task-1",
                "scan_paths": ["/vol"],
                "schedule": {
                    "name": "daily",
                    "uuid": "d4984822-17b7-11e9-b450-0050568ecd85",
                },
                "scope": {
                    "exclude_extensions": ["mp3", "mp4"],
                    "exclude_paths": ["/vol"],
                    "include_extensions": ["vmdk", "mp*"],
                    "max_file_size": 10737,
                    "scan_without_extension": True,
                },
            }
        ]
        resource.scanner_pools = [
            {
                "cluster": {
                    "name": "Cluster1",
                    "uuid": "ab746d77-17b7-11e9-b450-0050568ecd85",
                },
                "name": "scanner-1",
                "privileged_users": ["cifs\\u1", "cifs\\u2"],
                "role": "primary",
                "servers": ["1.1.1.1", "10.72.204.27"],
            }
        ]
        resource.svm = {"name": "vs1", "uuid": "b103be27-17b8-11e9-b451-0050568ecd85"}
        resource.post(hydrate=True)
        print(resource)

Try it out

    Vscan(
        {
            "on_access_policies": [
                {
                    "mandatory": True,
                    "name": "on-access-test",
                    "scope": {
                        "scan_readonly_volumes": False,
                        "include_extensions": ["mp*", "txt"],
                        "max_file_size": 21474,
                        "exclude_paths": ["\\vol"],
                        "only_execute_access": False,
                        "exclude_extensions": ["mp*", "txt"],
                        "scan_without_extension": True,
                    },
                    "enabled": True,
                }
            ],
            "on_demand_policies": [
                {
                    "schedule": {
                        "uuid": "d4984822-17b7-11e9-b450-0050568ecd85",
                        "name": "daily",
                    },
                    "scope": {
                        "include_extensions": ["vmdk", "mp*"],
                        "max_file_size": 10737,
                        "exclude_paths": ["//"],
                        "exclude_extensions": ["mp3", "mp4"],
                        "scan_without_extension": True,
                    },
                    "log_path": "/vol",
                    "scan_paths": ["/vol"],
                    "name": "task-1",
                }
            ],
            "enabled": True,
            "scanner_pools": [
                {
                    "role": "primary",
                    "cluster": {
                        "uuid": "ab746d77-17b7-11e9-b450-0050568ecd85",
                        "name": "Cluster1",
                    },
                    "privileged_users": ["cifs\\u1", "cifs\\u2"],
                    "servers": ["1.1.1.1", "10.72.204.27"],
                    "name": "scanner-1",
                }
            ],
            "svm": {"uuid": "b103be27-17b8-11e9-b451-0050568ecd85", "name": "vs1"},
        }
    )

### Creating multiple Vscan scanner-pools for the specified SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Vscan

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Vscan()
        resource.scanner_pools = [
            {
                "cluster": {
                    "name": "Cluster1",
                    "uuid": "ab746d77-17b7-11e9-b450-0050568ecd85",
                },
                "name": "scanner-1",
                "privileged_users": ["cifs\\u1", "cifs\\u2"],
                "role": "primary",
                "servers": ["1.1.1.1", "10.72.204.27"],
            },
            {
                "cluster": {
                    "name": "Cluster1",
                    "uuid": "ab746d77-17b7-11e9-b450-0050568ecd85",
                },
                "name": "scanner-2",
                "privileged_users": ["cifs\\u3", "cifs\\u4"],
                "role": "primary",
                "servers": ["1.1.1.5", "10.72.3.27"],
            },
        ]
        resource.svm = {"name": "vs1", "uuid": "b103be27-17b8-11e9-b451-0050568ecd85"}
        resource.post(hydrate=True)
        print(resource)

Try it out

    Vscan(
        {
            "scanner_pools": [
                {
                    "role": "primary",
                    "cluster": {
                        "uuid": "ab746d77-17b7-11e9-b450-0050568ecd85",
                        "name": "Cluster1",
                    },
                    "privileged_users": ["cifs\\u1", "cifs\\u2"],
                    "servers": ["1.1.1.1", "10.72.204.27"],
                    "name": "scanner-1",
                },
                {
                    "role": "primary",
                    "cluster": {
                        "uuid": "ab746d77-17b7-11e9-b450-0050568ecd85",
                        "name": "Cluster1",
                    },
                    "privileged_users": ["cifs\\u3", "cifs\\u4"],
                    "servers": ["1.1.1.5", "10.72.3.27"],
                    "name": "scanner-2",
                },
            ],
            "svm": {"uuid": "b103be27-17b8-11e9-b451-0050568ecd85", "name": "vs1"},
        }
    )

### Creating multiple Vscan On-access policies for a specified SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Vscan

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Vscan()
        resource.on_access_policies = [
            {
                "enabled": False,
                "mandatory": True,
                "name": "on-access-test11",
                "scope": {
                    "exclude_extensions": ["mp*", "txt"],
                    "exclude_paths": ["\\vol"],
                    "include_extensions": ["mp*", "txt"],
                    "max_file_size": 214748,
                    "only_execute_access": False,
                    "scan_readonly_volumes": False,
                    "scan_without_extension": True,
                },
            },
            {
                "enabled": False,
                "mandatory": True,
                "name": "on-access-test10",
                "scope": {
                    "exclude_extensions": ["mp*", "txt"],
                    "exclude_paths": ["\\vol"],
                    "include_extensions": ["mp*", "txt"],
                    "max_file_size": 21474,
                    "only_execute_access": False,
                    "scan_readonly_volumes": False,
                    "scan_without_extension": True,
                },
            },
        ]
        resource.svm = {"name": "vs1", "uuid": "b103be27-17b8-11e9-b451-0050568ecd85"}
        resource.post(hydrate=True)
        print(resource)

Try it out

    Vscan(
        {
            "on_access_policies": [
                {
                    "mandatory": True,
                    "name": "on-access-test11",
                    "scope": {
                        "scan_readonly_volumes": False,
                        "include_extensions": ["mp*", "txt"],
                        "max_file_size": 214748,
                        "exclude_paths": ["\\vol"],
                        "only_execute_access": False,
                        "exclude_extensions": ["mp*", "txt"],
                        "scan_without_extension": True,
                    },
                    "enabled": False,
                },
                {
                    "mandatory": True,
                    "name": "on-access-test10",
                    "scope": {
                        "scan_readonly_volumes": False,
                        "include_extensions": ["mp*", "txt"],
                        "max_file_size": 21474,
                        "exclude_paths": ["\\vol"],
                        "only_execute_access": False,
                        "exclude_extensions": ["mp*", "txt"],
                        "scan_without_extension": True,
                    },
                    "enabled": False,
                },
            ],
            "svm": {"uuid": "b103be27-17b8-11e9-b451-0050568ecd85", "name": "vs1"},
        }
    )

### Creating multiple Vscan On-demand policies for a specified SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Vscan

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Vscan()
        resource.on_demand_policies = [
            {
                "log_path": "/vol",
                "name": "task-1",
                "scan_paths": ["/vol"],
                "schedule": {
                    "name": "daily",
                    "uuid": "d4984822-17b7-11e9-b450-0050568ecd85",
                },
                "scope": {
                    "exclude_extensions": ["mp3", "mp4"],
                    "exclude_paths": ["/vol1"],
                    "include_extensions": ["vmdk", "mp*"],
                    "max_file_size": 107374,
                    "scan_without_extension": True,
                },
            },
            {
                "log_path": "/vol",
                "name": "task-2",
                "scan_paths": ["/vol"],
                "scope": {
                    "exclude_extensions": ["mp3", "mp4"],
                    "exclude_paths": ["/vol1"],
                    "include_extensions": ["vmdk", "mp*"],
                    "max_file_size": 107374,
                    "scan_without_extension": True,
                },
            },
        ]
        resource.svm = {"name": "vs1", "uuid": "b103be27-17b8-11e9-b451-0050568ecd85"}
        resource.post(hydrate=True)
        print(resource)

Try it out

    Vscan(
        {
            "on_demand_policies": [
                {
                    "schedule": {
                        "uuid": "d4984822-17b7-11e9-b450-0050568ecd85",
                        "name": "daily",
                    },
                    "scope": {
                        "include_extensions": ["vmdk", "mp*"],
                        "max_file_size": 107374,
                        "exclude_paths": ["/vol1"],
                        "exclude_extensions": ["mp3", "mp4"],
                        "scan_without_extension": True,
                    },
                    "log_path": "/vol",
                    "scan_paths": ["/vol"],
                    "name": "task-1",
                },
                {
                    "scope": {
                        "include_extensions": ["vmdk", "mp*"],
                        "max_file_size": 107374,
                        "exclude_paths": ["/vol1"],
                        "exclude_extensions": ["mp3", "mp4"],
                        "scan_without_extension": True,
                    },
                    "log_path": "/vol",
                    "scan_paths": ["/vol"],
                    "name": "task-2",
                },
            ],
            "svm": {"uuid": "b103be27-17b8-11e9-b451-0050568ecd85", "name": "vs1"},
        }
    )

### Enabling Vscan for a specified SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Vscan

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Vscan(**{"svm.uuid": "03ce5c36-f269-11e8-8852-0050568e5298"})
        resource.enabled = True
        resource.patch()

### Clearing the Vscan cache for the specified SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Vscan

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Vscan(**{"svm.uuid": "03ce5c36-f269-11e8-8852-0050568e5298"})
        resource.cache_clear = True
        resource.patch()

### Deleting the Vscan configuration for a specified SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import Vscan

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = Vscan(**{"svm.uuid": "03ce5c36-f269-11e8-8852-0050568e5298"})
        resource.delete()

## Classes

`class Vscan (*args, **kwargs)`

  Vscan can be used to protect data from being compromised by viruses or other malicious code. This combines best-in-class third-party antivirus software with ONTAP features that give you the flexibility you need to control which files get scanned and when. Storage systems offload scanning operations to external servers hosting antivirus software from thirdparty vendors. An Antivirus Connector on the external server handles communications between the storage system and the antivirus software.

  Initialize the instance of the resource.

  Any keyword arguments are set on the instance as properties. For example, if the class was named 'MyResource', then this statement would be true:

      MyResource(name='foo').name == 'foo'

  ## Args

  `*args`
    Each positional argument represents a parent key as used in the URL of the object. That is, each value will be used to fill in a segment of the URL which refers to some parent object. The order of these arguments must match the order they are specified in the URL, from left to right.
  `**kwargs`
    each entry will have its key set as an attribute name on the instance and its value will be the value of that attribute.

  ### Ancestors

  - Resource

  ### Static methods

  `def count_collection(*args, connection: HostConnection = None, **kwargs) -> int`

    Fetch a count of all objects of this type from the host.

    This calls GET on the object to determine the number of records. It is more efficient than calling get_collection() because it will not construct any objects. Query parameters can be passed in as kwargs to determine a count of objects that match some filtered criteria.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the count of bars for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. These query parameters can affect the count. A return_records query param will be ignored.

    ## Returns

    On success, returns an integer count of the objects of this type. On failure, returns -1.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400, or if there is no connection available to use either passed in or on the library.

  `def delete_collection(*args, records: Iterable[_ForwardRef('Vscan')] = None, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Deletes a Vscan configuration.
    Important notes: * The Vscan DELETE endpoint deletes all of the Vscan configuration of an SVM. It first disables the Vscan and then deletes all of the SVM scanner-pools, On-Access policies, and On-Demand policies. * Disable the active Vscan On-Access policy on an SVM before performing the Vscan delete operation on that SVM.

    ### Related ONTAP commands

    - `vserver vscan scanner-pool delete`
    - `vserver vscan on-access-policy delete`
    - `vserver vscan on-demand-policy delete`

    ### Learn more

    - `DOC /protocols/vscan`
    - `DOC /protocols/vscan/{svm.uuid}/scanner-pools`

    Delete all objects in a collection which match the given query.

    All records on the host which match the query will be deleted.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to delete the collection of bars for a particular foo, the foo.name value should be passed.
    `records`
      Can be provided in place of a query. If so, this list of objects will be deleted from the host.
    `body`
      The body of the delete request. This could be a Resource instance or a dictionary object.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be deleted.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def find(*args, connection: HostConnection = None, **kwargs) -> Resource`

    Retrieves the Vscan configuration. This includes scanner-pools, On-Access policies, On-Demand policies, and information about whether a Vscan is enabled or disabled on an SVM.
    Important notes: * You can enable only one Vscan configuration at a time for an SVM. * You can only query using `svm.uuid` or `svm.name`.

    ### Related ONTAP commands

    - `vserver vscan show`
    - `vserver vscan scanner-pool show`
    - `vserver vscan scanner-pool servers show`
    - `vserver vscan scanner-pool privileged-users show`
    - `vserver vscan on-access-policy show`
    - `vserver vscan on-access-policy file-ext-to-exclude show`
    - `vserver vscan on-access-policy file-ext-to-include show`
    - `vserver vscan on-access-policy paths-to-exclude show`
    - `vserver vscan on-demand-task show`

    ### Learn more

    - `DOC /protocols/vscan`
    - `DOC /protocols/vscan/{svm.uuid}/scanner-pools`

    Find an instance of an object on the host given a query.

    The host will be queried with the provided key/value pairs to find a matching resource. If 0 are found, None will be returned. If more than 1 is found, an error will be raised or returned. If there is exactly 1 matching record, then it will be returned.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to find a bar for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A `Resource` object containing the details of the object or None if no matches were found.

    ## Raises

    `NetAppRestError`: If the API call returned more than 1 matching resource.

  `def get_collection(*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[Resource]`

    Retrieves the Vscan configuration. This includes scanner-pools, On-Access policies, On-Demand policies, and information about whether a Vscan is enabled or disabled on an SVM.
    Important notes: * You can enable only one Vscan configuration at a time for an SVM. * You can only query using `svm.uuid` or `svm.name`.

    ### Related ONTAP commands

    - `vserver vscan show`
    - `vserver vscan scanner-pool show`
    - `vserver vscan scanner-pool servers show`
    - `vserver vscan scanner-pool privileged-users show`
    - `vserver vscan on-access-policy show`
    - `vserver vscan on-access-policy file-ext-to-exclude show`
    - `vserver vscan on-access-policy file-ext-to-include show`
    - `vserver vscan on-access-policy paths-to-exclude show`
    - `vserver vscan on-demand-task show`

    ### Learn more

    - `DOC /protocols/vscan`
    - `DOC /protocols/vscan/{svm.uuid}/scanner-pools`

    Fetch a list of all objects of this type from the host.

    This is a lazy fetch, making API calls only as necessary when the result of this call is iterated over. For instance, if max_records is set to 5, then iterating over the collection causes an API call to be sent to the server once for every 5 records. If the client stops iterating before getting to the 6th record, then no additional API calls are made.

    ## Args

    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to get the collection of bars for a particular foo, the foo.name value should be passed.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `max_records`
      The maximum number of records to return per call
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A list of `Resource` objects

    ## Raises

    `NetAppRestError`: If there is no connection available to use either passed in or on the library. This would be not be raised when get_collection() is called, but rather when the result is iterated.

  `def patch_collection(body: dict, *args, records: Iterable[_ForwardRef('Vscan')] = None, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Updates the Vscan configuration of an SVM. Allows you to either enable or disable a Vscan, and allows you to clear the Vscan cache that stores the past scanning data for an SVM.
    Important note: * The Vscan PATCH endpoint does not allow you to modify scanner-pools, On-Demand policies or On-Access policies. Those modifications can only be done through their respective endpoints.

    ### Related ONTAP commands

    - `vserver vscan enable`
    - `vserver vscan disable`
    - `vserver vscan reset`

    ### Learn more

    - `DOC /protocols/vscan`
    - `DOC /protocols/vscan/{svm.uuid}/scanner-pools`

    Patch all objects in a collection which match the given query.

    All records on the host which match the query will be patched with the provided body.

    ## Args

    `body`
      A dictionary of name/value pairs to set on all matching members of the collection. The body argument will be ignored if records is provided.
    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to patch the collection of bars for a particular foo, the foo.name value should be passed.
    `records`
      Can be provided in place of a query. If so, this list of objects will be patched on the host.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def post_collection(records: Iterable[_ForwardRef('Vscan')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, connection: HostConnection = None, **kwargs) -> Union[List[Vscan], NetAppResponse]`

    Creates a Vscan configuration, which includes a list of scanner-pools, Vscan On-Access policies and Vscan On-Demand policies. Defines whether the Vscan configuration you create is enabled or disabled for a specified SVM.
    Important notes: * You can enable only one Vscan configuration at a time for an SVM. * There needs to be at least one active scanner-pool and one enabled On-Access policy to enable Vscan successfully. * By default, a Vscan is enabled when it’s created. * By default, the Vscan On-Access policies created from this endpoint are in the disabled state. You can use the On-Access policy PATCH endpoint to enable a particular On-Access policy. In ONTAP 9.6, only one Vscan On-Access policy can be enabled and only one Vscan On-Demand policy can be scheduled on an SVM.

    ### Required properties

    - `svm.uuid` or `svm.name` - Existing SVM in which to create the Vscan configuration.

    ### Recommended optional properties

    - `scanner_pools` - There must be at least one active scanner-pool for Vscan configuration. Created either through Vscan POST operation or scanner-pools POST operation.

    ### Default property values

    If not specified in POST, the following default property value is assigned: * `enabled` - true

    ### Related ONTAP commands

    - `vserver vscan enable`
    - `vserver vscan scanner-pool create`
    - `vserver vscan scanner-pool apply-policy`
    - `vserver vscan scanner-pool servers add`
    - `vserver vscan scanner-pool privileged-users add`
    - `vserver vscan on-access-policy create`
    - `vserver vscan on-access-policy file-ext-to-exclude add`
    - `vserver vscan on-access-policy file-ext-to-include add`
    - `vserver vscan on-access-policy paths-to-exclude add`
    - `vserver vscan on-demand-task create`

    ### Learn more

    - `DOC /protocols/vscan`
    - `DOC /protocols/vscan/{svm.uuid}/scanner-pools`

    Send this collection of objects to the host as a creation request.

    ## Args

    `records`
      A list of `Resource` objects to send to the server to be created.
    `*args`
      Each entry represents a parent key which is used to build the path to the child object. If the URL definition were /api/foos/{foo.name}/bars, then to create a bar for a particular foo, the foo.name value should be passed.
    `hydrate`
      If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of each object. When hydrate is set to True, poll must also be set to True.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `connection`
      The `HostConnection` object to use for this API call. If unset, tries to use the connection which is set globally for the library or from the current context.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host. Only resources matching this query will be patched.

    ## Returns

    A list of `Resource` objects matching the provided
    `type` `which` `have` `been` `created` `by` `the` `host` `and` `returned.` `This` `is` `_not_`
    `the` `same` `list` `that` `was` `provided`, `so` `to` `continue` `using` `the` `object`, `you`

    should save this list. If poll is set to False, then a `NetAppResponse` object is returned instead.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  ### Methods

  `def delete(self, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, **kwargs) -> NetAppResponse`

    Deletes a Vscan configuration.
    Important notes: * The Vscan DELETE endpoint deletes all of the Vscan configuration of an SVM. It first disables the Vscan and then deletes all of the SVM scanner-pools, On-Access policies, and On-Demand policies. * Disable the active Vscan On-Access policy on an SVM before performing the Vscan delete operation on that SVM.

    ### Related ONTAP commands

    - `vserver vscan scanner-pool delete`
    - `vserver vscan on-access-policy delete`
    - `vserver vscan on-demand-policy delete`

    ### Learn more

    - `DOC /protocols/vscan`
    - `DOC /protocols/vscan/{svm.uuid}/scanner-pools`

    Send a deletion request to the host for this object.

    ## Args

    `body`
      The body of the delete request. This could be a Resource instance or a dictionary object.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `**kwargs`
      Any key/value pairs passed will be sent as query parameters to the host.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def get(self, **kwargs) -> NetAppResponse`

    Retrieves the Vscan configuration for a specified SVM. This includes scanner-pools, On-Access policies, On-Demand policies, and information about whether a Vscan is enabled or disabled on an SVM.
    Important note: * You can enable only one Vscan configuration at a time for an SVM.

    ### Related ONTAP commands

    - `vserver vscan show`
    - `vserver vscan scanner-pool show`
    - `vserver vscan scanner-pool servers show`
    - `vserver vscan scanner-pool privileged-users show`
    - `vserver vscan on-access-policy show`
    - `vserver vscan on-access-policy file-ext-to-exclude show`
    - `vserver vscan on-access-policy file-ext-to-include show`
    - `vserver vscan on-access-policy paths-to-exclude show`
    - `vserver vscan on-demand-task show`

    ### Learn more

    - `DOC /protocols/vscan`
    - `DOC /protocols/vscan/{svm.uuid}/scanner-pools`

    Fetch the details of the object from the host.

    Requires the keys to be set (if any). After returning, new or changed properties from the host will be set on the instance.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def patch(self, hydrate: bool = False, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, **kwargs) -> NetAppResponse`

    Updates the Vscan configuration of an SVM. Allows you to either enable or disable a Vscan, and allows you to clear the Vscan cache that stores the past scanning data for an SVM.
    Important note: * The Vscan PATCH endpoint does not allow you to modify scanner-pools, On-Demand policies or On-Access policies. Those modifications can only be done through their respective endpoints.

    ### Related ONTAP commands

    - `vserver vscan enable`
    - `vserver vscan disable`
    - `vserver vscan reset`

    ### Learn more

    - `DOC /protocols/vscan`
    - `DOC /protocols/vscan/{svm.uuid}/scanner-pools`

    Send the difference in the object's state to the host as a modification request.

    Calculates the difference in the object's state since the last time we interacted with the host and sends this in the request body.

    ## Args

    `hydrate`
      If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `**kwargs`
      Any key/value pairs passed will normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  `def post(self, hydrate: bool = False, poll: bool = True, poll_interval: Union[int, NoneType] = None, poll_timeout: Union[int, NoneType] = None, **kwargs) -> NetAppResponse`

    Creates a Vscan configuration, which includes a list of scanner-pools, Vscan On-Access policies and Vscan On-Demand policies. Defines whether the Vscan configuration you create is enabled or disabled for a specified SVM.
    Important notes: * You can enable only one Vscan configuration at a time for an SVM. * There needs to be at least one active scanner-pool and one enabled On-Access policy to enable Vscan successfully. * By default, a Vscan is enabled when it’s created. * By default, the Vscan On-Access policies created from this endpoint are in the disabled state. You can use the On-Access policy PATCH endpoint to enable a particular On-Access policy. In ONTAP 9.6, only one Vscan On-Access policy can be enabled and only one Vscan On-Demand policy can be scheduled on an SVM.

    ### Required properties

    - `svm.uuid` or `svm.name` - Existing SVM in which to create the Vscan configuration.

    ### Recommended optional properties

    - `scanner_pools` - There must be at least one active scanner-pool for Vscan configuration. Created either through Vscan POST operation or scanner-pools POST operation.

    ### Default property values

    If not specified in POST, the following default property value is assigned: * `enabled` - true

    ### Related ONTAP commands

    - `vserver vscan enable`
    - `vserver vscan scanner-pool create`
    - `vserver vscan scanner-pool apply-policy`
    - `vserver vscan scanner-pool servers add`
    - `vserver vscan scanner-pool privileged-users add`
    - `vserver vscan on-access-policy create`
    - `vserver vscan on-access-policy file-ext-to-exclude add`
    - `vserver vscan on-access-policy file-ext-to-include add`
    - `vserver vscan on-access-policy paths-to-exclude add`
    - `vserver vscan on-demand-task create`

    ### Learn more

    - `DOC /protocols/vscan`
    - `DOC /protocols/vscan/{svm.uuid}/scanner-pools`

    Send this object to the host as a creation request.

    ## Args

    `hydrate`
      If set to True, after the response is received from the call, a a GET call will be made to refresh all fields of the object.
    `poll`
      If set to True, the call will not return until the asynchronous job on the host has completed. Has no effect if the host did not return a job response.
    `poll_interval`
      If the operation returns a job, this specifies how often to query the job for updates.
    `poll_timeout`
      If the operation returns a job, this specifies how long to continue monitoring the job's status for completion.
    `**kwargs`
      Any key/value pairs passed will normally be sent as query parameters to the host. If any of these pairs are parameters that are sent as formdata then only parameters of that type will be accepted and all others will be discarded.

    ## Returns

    A `NetAppResponse` object containing the details of the HTTP response.

    ## Raises

    `NetAppRestError`: If the API call returned a status code >= 400

  ### Inherited members

  - `Resource`:
    - `from_dict`
    - `get_collection_url`
    - `get_connection`
    - `instance_location`
    - `path_keys`
    - `poll`
    - `set_connection`
    - `to_dict`
`class VscanSchema (*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)`

  The fields of the Vscan object

  ### Ancestors

  - netapp_ontap.resource.ResourceSchema
  - marshmallow.schema.Schema
  - marshmallow.base.SchemaABC

  ### Class variables

  `cache_clear PATCH`

    Discards the cached information of the files that have been successfully scanned. Once the cache is cleared, files are scanned again when they are accessed. PATCH only

  `enabled GET POST PATCH`

    Specifies whether or not Vscan is enabled on the SVM.

  `links GET`

    The links field of the vscan.

  `on_access_policies GET POST`

    The on_access_policies field of the vscan.

  `on_demand_policies GET POST`

    The on_demand_policies field of the vscan.

  `scanner_pools GET POST`

    The scanner_pools field of the vscan.

  `svm GET POST`

    The svm field of the vscan.