Module netapp_ontap.resources.fpolicy_event
Copyright © 2023 NetApp Inc. All rights reserved.
This file has been automatically generated based on the ONTAP REST API documentation.
Overview
FPolicy events configurations allow you to specify which file access is monitored. As part of an FPolicy event, you can configure the SVM for which the events are generated, the name of the event configuration, the protocol (cifs, nfsv3/nfsv4) for which the events are generated, the file operations which are monitored, and filters that can be used to filter the unwanted notification generation for a specified protocol and file operation. Each protocol has a set of supported file operations and filters. An SVM can have multiple events. A single FPolicy policy can have multiple FPolicy events. FPolicy events can also be configured to monitor file operations which fail due to lack of permissions. You can specify which file operation to monitor for failure. However, filters can not be used to filter failed file operations.
Examples
Creating an FPolicy event for a CIFS protocol with all the supported file operations and filters
from netapp_ontap import HostConnection
from netapp_ontap.resources import FpolicyEvent
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = FpolicyEvent("4f643fb4-fd21-11e8-ae49-0050568e2c1e")
resource.file_operations = {
"close": True,
"create": True,
"create_dir": True,
"delete": True,
"delete_dir": True,
"getattr": True,
"open": True,
"read": True,
"rename": True,
"rename_dir": True,
"setattr": True,
"write": True,
}
resource.filters = {
"close_with_modification": True,
"close_with_read": True,
"close_without_modification": True,
"first_read": True,
"first_write": True,
"monitor_ads": True,
"offline_bit": True,
"open_with_delete_intent": True,
"open_with_write_intent": True,
"write_with_size_change": True,
}
resource.name = "event_cifs"
resource.protocol = "cifs"
resource.volume_monitoring = True
resource.post(hydrate=True)
print(resource)
FpolicyEvent(
{
"monitor_fileop_failure": False,
"filters": {
"first_write": True,
"offline_bit": True,
"close_with_read": True,
"open_with_write_intent": True,
"monitor_ads": True,
"close_with_modification": True,
"write_with_size_change": True,
"first_read": True,
"open_with_delete_intent": True,
"close_without_modification": True,
},
"volume_monitoring": True,
"name": "event_cifs",
"protocol": "cifs",
"file_operations": {
"close": True,
"getattr": True,
"rename": True,
"delete": True,
"setattr": True,
"create_dir": True,
"read": True,
"create": True,
"rename_dir": True,
"open": True,
"write": True,
"delete_dir": True,
},
}
)
Creating an FPolicy event for an NFS protocol with all the supported file operations and filters
from netapp_ontap import HostConnection
from netapp_ontap.resources import FpolicyEvent
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = FpolicyEvent("4f643fb4-fd21-11e8-ae49-0050568e2c1e")
resource.file_operations = {
"create": True,
"create_dir": True,
"delete": True,
"delete_dir": True,
"link": True,
"lookup": True,
"read": True,
"rename": True,
"rename_dir": True,
"setattr": True,
"symlink": True,
"write": True,
}
resource.filters = {"offline_bit": True, "write_with_size_change": True}
resource.name = "event_nfsv3"
resource.protocol = "nfsv3"
resource.volume_monitoring = False
resource.post(hydrate=True)
print(resource)
FpolicyEvent(
{
"monitor_fileop_failure": False,
"filters": {"offline_bit": True, "write_with_size_change": True},
"volume_monitoring": False,
"name": "event_nfsv3",
"protocol": "nfsv3",
"file_operations": {
"link": True,
"symlink": True,
"lookup": True,
"rename": True,
"delete": True,
"setattr": True,
"create_dir": True,
"read": True,
"create": True,
"rename_dir": True,
"write": True,
"delete_dir": True,
},
}
)
Creating an FPolicy event to monitor failed file operations for an NFS protocol with all the supported file operations
from netapp_ontap import HostConnection
from netapp_ontap.resources import FpolicyEvent
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = FpolicyEvent("b5087518-40b3-11ed-b3eb-005056bbe901")
resource.file_operations = {
"create": True,
"create_dir": True,
"delete": True,
"delete_dir": True,
"link": True,
"read": True,
"rename": True,
"rename_dir": True,
"write": True,
}
resource.name = "nfs_failed_op"
resource.protocol = "nfsv3"
resource.monitor_fileop_failure = True
resource.volume_monitoring = False
resource.post(hydrate=True, return_records=False)
print(resource)
FpolicyEvent(
{
"monitor_fileop_failure": True,
"volume_monitoring": False,
"name": "nfs_failed_op",
"protocol": "nfsv3",
"file_operations": {
"link": True,
"rename": True,
"delete": True,
"create_dir": True,
"read": True,
"create": True,
"rename_dir": True,
"write": True,
"delete_dir": True,
},
}
)
Retrieving all of the FPolicy event configurations configured to monitor failed file operations for a specified SVM
from netapp_ontap import HostConnection
from netapp_ontap.resources import FpolicyEvent
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
print(
list(
FpolicyEvent.get_collection(
"b5087518-40b3-11ed-b3eb-005056bbe901",
monitor_fileop_failure=True,
fields="*",
return_timeout=15,
)
)
)
[
FpolicyEvent(
{
"monitor_fileop_failure": True,
"svm": {"uuid": "b5087518-40b3-11ed-b3eb-005056bbe901"},
"volume_monitoring": False,
"name": "fo_event",
"protocol": "cifs",
"file_operations": {
"link": False,
"symlink": False,
"lookup": False,
"close": False,
"getattr": False,
"rename": False,
"delete": False,
"setattr": False,
"create_dir": False,
"read": False,
"create": False,
"rename_dir": False,
"open": True,
"write": False,
"delete_dir": False,
},
}
)
]
Retrieving all of the FPolicy event configurations for a specified SVM
from netapp_ontap import HostConnection
from netapp_ontap.resources import FpolicyEvent
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
print(
list(
FpolicyEvent.get_collection(
"4f643fb4-fd21-11e8-ae49-0050568e2c1e", fields="*", return_timeout=15
)
)
)
[
FpolicyEvent(
{
"monitor_fileop_failure": False,
"filters": {
"exclude_directory": False,
"first_write": False,
"setattr_with_size_change": False,
"setattr_with_access_time_change": False,
"setattr_with_sacl_change": False,
"offline_bit": False,
"close_with_read": True,
"setattr_with_mode_change": False,
"open_with_write_intent": False,
"monitor_ads": False,
"close_with_modification": False,
"setattr_with_modify_time_change": False,
"setattr_with_creation_time_change": False,
"write_with_size_change": False,
"setattr_with_allocation_size_change": False,
"setattr_with_group_change": False,
"setattr_with_dacl_change": False,
"first_read": False,
"setattr_with_owner_change": False,
"open_with_delete_intent": False,
"close_without_modification": False,
},
"svm": {"uuid": "4f643fb4-fd21-11e8-ae49-0050568e2c1e"},
"volume_monitoring": False,
"name": "cluster",
"protocol": "cifs",
"file_operations": {
"link": False,
"symlink": False,
"lookup": False,
"close": True,
"getattr": False,
"rename": False,
"delete": False,
"setattr": False,
"create_dir": False,
"read": False,
"create": False,
"rename_dir": False,
"open": False,
"write": False,
"delete_dir": False,
},
}
),
FpolicyEvent(
{
"monitor_fileop_failure": False,
"filters": {
"exclude_directory": False,
"first_write": True,
"setattr_with_size_change": False,
"setattr_with_access_time_change": False,
"setattr_with_sacl_change": False,
"offline_bit": True,
"close_with_read": True,
"setattr_with_mode_change": False,
"open_with_write_intent": True,
"monitor_ads": True,
"close_with_modification": True,
"setattr_with_modify_time_change": False,
"setattr_with_creation_time_change": False,
"write_with_size_change": True,
"setattr_with_allocation_size_change": False,
"setattr_with_group_change": False,
"setattr_with_dacl_change": False,
"first_read": True,
"setattr_with_owner_change": False,
"open_with_delete_intent": True,
"close_without_modification": True,
},
"svm": {"uuid": "4f643fb4-fd21-11e8-ae49-0050568e2c1e"},
"volume_monitoring": True,
"name": "event_cifs",
"protocol": "cifs",
"file_operations": {
"link": False,
"symlink": False,
"lookup": False,
"close": True,
"getattr": True,
"rename": True,
"delete": True,
"setattr": True,
"create_dir": True,
"read": True,
"create": True,
"rename_dir": True,
"open": True,
"write": True,
"delete_dir": True,
},
}
),
]
Retrieving a specific FPolicy event configuration for an SVM
from netapp_ontap import HostConnection
from netapp_ontap.resources import FpolicyEvent
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = FpolicyEvent("4f643fb4-fd21-11e8-ae49-0050568e2c1e", name="event_cifs")
resource.get(fields="*", return_timeout=15)
print(resource)
FpolicyEvent(
{
"monitor_fileop_failure": False,
"filters": {
"exclude_directory": False,
"first_write": True,
"setattr_with_size_change": False,
"setattr_with_access_time_change": False,
"setattr_with_sacl_change": False,
"offline_bit": True,
"close_with_read": True,
"setattr_with_mode_change": False,
"open_with_write_intent": True,
"monitor_ads": True,
"close_with_modification": True,
"setattr_with_modify_time_change": False,
"setattr_with_creation_time_change": False,
"write_with_size_change": True,
"setattr_with_allocation_size_change": False,
"setattr_with_group_change": False,
"setattr_with_dacl_change": False,
"first_read": True,
"setattr_with_owner_change": False,
"open_with_delete_intent": True,
"close_without_modification": True,
},
"svm": {"uuid": "4f643fb4-fd21-11e8-ae49-0050568e2c1e"},
"volume_monitoring": True,
"name": "event_cifs",
"protocol": "cifs",
"file_operations": {
"link": False,
"symlink": False,
"lookup": False,
"close": True,
"getattr": True,
"rename": True,
"delete": True,
"setattr": True,
"create_dir": True,
"read": True,
"create": True,
"rename_dir": True,
"open": True,
"write": True,
"delete_dir": True,
},
}
)
Updating a specific FPolicy event configuration for a specified SVM
from netapp_ontap import HostConnection
from netapp_ontap.resources import FpolicyEvent
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = FpolicyEvent("4f643fb4-fd21-11e8-ae49-0050568e2c1e", name="event_cifs")
resource.file_operations = {"close": False, "create": False, "read": True}
resource.filters = {
"close_with_modification": False,
"close_with_read": False,
"close_without_modification": False,
}
resource.protocol = "cifs"
resource.volume_monitoring = False
resource.patch()
Deleting a specific FPolicy event configuration for a specific SVM
from netapp_ontap import HostConnection
from netapp_ontap.resources import FpolicyEvent
with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
resource = FpolicyEvent("4f643fb4-fd21-11e8-ae49-0050568e2c1e", name="event_cifs")
resource.delete()
Classes
class FpolicyEvent (*args, **kwargs)
-
The information that a FPolicy process needs to determine what file access operations to monitor and for which of the monitored events notifications should be sent to the external FPolicy server.
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
Static methods
def count_collection (*args, connection: HostConnection = None, **kwargs) -> int
-
Returns a count of all FpolicyEvent resources that match the provided query
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('FpolicyEvent')] = None, body: Union[Resource, dict] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Deletes a specific FPolicy event configuration for an SVM. A cluster-level FPolicy event configuration cannot be modified for a data SVM through REST. An FPolicy event that is attached to an FPolicy policy cannot be deleted.
Related ONTAP commands
fpolicy policy event delete
Learn more
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 FPolicy event configurations for all events for a specified SVM. ONTAP allows the creation of cluster-level FPolicy events that act as a template for all the data SVMs belonging to the cluster. These cluster-level FPolicy events are also retrieved for the specified SVM.
Related ONTAP commands
fpolicy policy event show
Learn more
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 FPolicy event configurations for all events for a specified SVM. ONTAP allows the creation of cluster-level FPolicy events that act as a template for all the data SVMs belonging to the cluster. These cluster-level FPolicy events are also retrieved for the specified SVM.
Related ONTAP commands
fpolicy policy event show
Learn more
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
objectsRaises
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('FpolicyEvent')] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse
-
Updates a specific FPolicy event configuration for an SVM. A cluster-level FPolicy event configuration cannot be modified for a data SVM through REST. When the file operations and filters fields are modified, the previous values are retained and new values are added to the list of previous values. To remove a particular file operation or filter, set its value to false in the request.
Related ONTAP commands
fpolicy policy event modify
Learn more
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('FpolicyEvent')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> Union[List[FpolicyEvent], NetAppResponse]
-
Creates an FPolicy event configuration for a specified SVM. FPolicy event creation is allowed only on data SVMs. When a protocol is specified, you must specify a file operation or a file operation and filters. When FPolicy event is configured to monitor failed file operations, you must specify protocol and file operations. Filters are not supported when failed file operations are monitored.
Required properties
svm.uuid
- Existing SVM in which to create the FPolicy event.name
- Name of the FPolicy event.
Recommended optional properties
file-operations
- List of file operations to monitor.protocol
- Protocol for which the file operations should be monitored.filters
- List of filters for the specified file operations.monitor-fileop-failure
- Enabled monitoring of failed file operations.
Default property values
If not specified in POST, the following default property values are assigned: *
file_operations.*
- false *filters.*
- false *volume-monitoring
- false *monitor-fileop-failure
- falseRelated ONTAP commands
fpolicy policy event create
Learn more
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 aNetAppResponse
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: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse
-
Deletes a specific FPolicy event configuration for an SVM. A cluster-level FPolicy event configuration cannot be modified for a data SVM through REST. An FPolicy event that is attached to an FPolicy policy cannot be deleted.
Related ONTAP commands
fpolicy policy event delete
Learn more
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.
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
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 a specific FPolicy event configuration for an SVM. A cluster-level FPolicy event configuration cannot be retrieved for a data SVM through a REST API.
Related ONTAP commands
fpolicy policy event show
Learn more
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: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse
-
Updates a specific FPolicy event configuration for an SVM. A cluster-level FPolicy event configuration cannot be modified for a data SVM through REST. When the file operations and filters fields are modified, the previous values are retained and new values are added to the list of previous values. To remove a particular file operation or filter, set its value to false in the request.
Related ONTAP commands
fpolicy policy event modify
Learn more
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.
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 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: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse
-
Creates an FPolicy event configuration for a specified SVM. FPolicy event creation is allowed only on data SVMs. When a protocol is specified, you must specify a file operation or a file operation and filters. When FPolicy event is configured to monitor failed file operations, you must specify protocol and file operations. Filters are not supported when failed file operations are monitored.
Required properties
svm.uuid
- Existing SVM in which to create the FPolicy event.name
- Name of the FPolicy event.
Recommended optional properties
file-operations
- List of file operations to monitor.protocol
- Protocol for which the file operations should be monitored.filters
- List of filters for the specified file operations.monitor-fileop-failure
- Enabled monitoring of failed file operations.
Default property values
If not specified in POST, the following default property values are assigned: *
file_operations.*
- false *filters.*
- false *volume-monitoring
- false *monitor-fileop-failure
- falseRelated ONTAP commands
fpolicy policy event create
Learn more
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.
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 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
class FpolicyEventSchema (*, 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 FpolicyEvent object
Ancestors
- netapp_ontap.resource.ResourceSchema
- marshmallow.schema.Schema
- marshmallow.base.SchemaABC
Class variables
-
file_operations: FpolicyEventFileOperations GET POST PATCH
-
The file_operations field of the fpolicy_event.
-
filters: FpolicyEventFilters GET POST PATCH
-
The filters field of the fpolicy_event.
-
monitor_fileop_failure: bool GET POST PATCH
-
Specifies whether failed file operations monitoring is required.
-
name: str GET POST
-
Specifies the name of the FPolicy event.
Example: event_nfs_close
-
protocol: str GET POST PATCH
-
Protocol for which event is created. If you specify protocol, then you must also specify a valid value for the file operation parameters. The value of this parameter must be one of the following:
* cifs - for the CIFS protocol. * nfsv3 - for the NFSv3 protocol. * nfsv4 - for the NFSv4 protocol.
Valid choices:
- cifs
- nfsv3
- nfsv4
-
svm: FpolicyEngineSvm GET POST PATCH
-
The svm field of the fpolicy_event.
-
volume_monitoring: bool GET POST PATCH
-
Specifies whether volume operation monitoring is required.