netapp_ontap.resources.quota_rule API documentation
Description: Copyright &copy; 2020 NetApp Inc. All rights reserved …

# Module `netapp_ontap.resources.quota_rule`

Copyright © 2020 NetApp Inc. All rights reserved.

## Overview

Quotas are defined in quota rules specific to FlexVol volumes or FlexGroup volumes. Each quota rule has a type. The type can be "user", "group", or "tree".

- User rules must have the user property and qtree property.
- Group rules must have the group property and qtree property.
- Tree rules must have the qtree property and not have the user or group property.

## Quota policy rule APIs

The following APIs can be used to perform create, retrieve, modify, and delete operations related to quota policy rules.

- POST /api/storage/quota/rules
- GET /api/storage/quota/rules
- GET /api/storage/quota/rules/{rule-uuid}
- PATCH /api/storage/quota/rules/{rule-uuid}
- DELETE /api/storage/quota/rules/{rule-uuid}

## Examples

### Retrieving all quota policy rules

This API is used to retrieve all quota policy rules.
The following example shows how to retrieve quota policy rules for FlexVol volumes and FlexGroup volumes.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(list(QuotaRule.get_collection()))

Try it out

    [
        QuotaRule(
            {
                "uuid": "66319cbe-b837-11e8-9c5a-005056a7e88c",
                "volume": {
                    "name": "vol1",
                    "uuid": "ab3df793-0f02-43c6-9514-4f142fc8cc92",
                    "_links": {
                        "self": {
                            "href": "/api/storage/volumes/ab3df793-0f02-43c6-9514-4f142fc8cc92"
                        }
                    },
                },
                "_links": {
                    "self": {
                        "href": "/api/storage/quota/rules/66319cbe-b837-11e8-9c5a-005056a7e88c"
                    }
                },
                "svm": {
                    "name": "svm1",
                    "uuid": "038545f8-9ff8-11e8-bce6-005056a73bed",
                    "_links": {
                        "self": {
                            "href": "/api/svm/svms/038545f8-9ff8-11e8-bce6-005056a73bed"
                        }
                    },
                },
            }
        ),
        QuotaRule(
            {
                "uuid": "dbd5b443-b7a4-11e8-bc58-005056a7e88c",
                "volume": {
                    "name": "vol1",
                    "uuid": "ab3df793-0f02-43c6-9514-4f142fc8cc92",
                    "_links": {
                        "self": {
                            "href": "/api/storage/volumes/ab3df793-0f02-43c6-9514-4f142fc8cc92"
                        }
                    },
                },
                "_links": {
                    "self": {
                        "href": "/api/storage/quota/rules/dbd5b443-b7a4-11e8-bc58-005056a7e88c"
                    }
                },
                "svm": {
                    "name": "svm1",
                    "uuid": "038545f8-9ff8-11e8-bce6-005056a73bed",
                    "_links": {
                        "self": {
                            "href": "/api/svm/svms/038545f8-9ff8-11e8-bce6-005056a73bed"
                        }
                    },
                },
            }
        ),
    ]

### Retrieving a specific quota policy rule

This API is used to retrieve a quota policy rule for a specific qtree.
The following example shows how to retrieve a quota policy user rule for a specific qtree.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule(uuid="264a9e0b-2e03-11e9-a610-005056a7b72d")
        resource.get()
        print(resource)

Try it out

    QuotaRule(
        {
            "uuid": "264a9e0b-2e03-11e9-a610-005056a7b72d",
            "users": [{"name": "fred"}],
            "volume": {
                "name": "vol1",
                "uuid": "c1b64eea-ca8b-45ec-9397-ab489830d268",
                "_links": {
                    "self": {
                        "href": "/api/storage/volumes/c1b64eea-ca8b-45ec-9397-ab489830d268"
                    }
                },
            },
            "_links": {
                "self": {
                    "href": "/api/storage/quota/rules/264a9e0b-2e03-11e9-a610-005056a7b72d"
                }
            },
            "svm": {
                "name": "svm1",
                "uuid": "fd5db15a-15b9-11e9-a6ad-005056a760e0",
                "_links": {
                    "self": {"href": "/api/svm/svms/fd5db15a-15b9-11e9-a6ad-005056a760e0"}
                },
            },
            "qtree": {
                "_links": {
                    "self": {
                        "href": "/api/storage/qtrees/c1b64eea-ca8b-45ec-9397-ab489830d268/1"
                    }
                },
                "id": 1,
                "name": "qt1",
            },
            "type": "user",
            "space": {"hard_limit": 1222800, "soft_limit": 51200},
            "user_mapping": True,
            "files": {"hard_limit": 100, "soft_limit": 80},
        }
    )

### Retrieving a quota policy multi-user rule at the volume level

##

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule(uuid="0ab84fba-19aa-11e9-a04d-005056a72f42")
        resource.get()
        print(resource)

Try it out

    QuotaRule(
        {
            "uuid": "0ab84fba-19aa-11e9-a04d-005056a72f42",
            "users": [{"name": "sam"}, {"name": "smith"}, {"id": "300010"}],
            "volume": {
                "name": "vol1",
                "uuid": "c1b64eea-ca8b-45ec-9397-ab489830d268",
                "_links": {
                    "self": {
                        "href": "/api/storage/volumes/c1b64eea-ca8b-45ec-9397-ab489830d268"
                    }
                },
            },
            "_links": {
                "self": {
                    "href": "/api/storage/quota/rules/0ab84fba-19aa-11e9-a04d-005056a72f42"
                }
            },
            "svm": {
                "name": "svm1",
                "uuid": "fd5db15a-15b9-11e9-a6ad-005056a760e0",
                "_links": {
                    "self": {"href": "/api/svm/svms/fd5db15a-15b9-11e9-a6ad-005056a760e0"}
                },
            },
            "type": "user",
            "space": {"hard_limit": 1222800, "soft_limit": 51200},
            "files": {"hard_limit": 100, "soft_limit": 80},
        }
    )

### Retrieving a quota policy default tree rule

##

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule(uuid="4a276b8c-1753-11e9-8101-005056a760e0")
        resource.get()
        print(resource)

Try it out

    QuotaRule(
        {
            "uuid": "4a276b8c-1753-11e9-8101-005056a760e0",
            "volume": {
                "name": "vol1",
                "uuid": "c1b64eea-ca8b-45ec-9397-ab489830d268",
                "_links": {
                    "self": {
                        "href": "/api/storage/volumes/c1b64eea-ca8b-45ec-9397-ab489830d268"
                    }
                },
            },
            "_links": {
                "self": {
                    "href": "/api/storage/quota/rules/4a276b8c-1753-11e9-8101-005056a760e0"
                }
            },
            "svm": {
                "name": "svm1",
                "uuid": "fd5db15a-15b9-11e9-a6ad-005056a760e0",
                "_links": {
                    "self": {"href": "/api/svm/svms/fd5db15a-15b9-11e9-a6ad-005056a760e0"}
                },
            },
            "qtree": {"name": ""},
            "type": "tree",
            "space": {"hard_limit": 1034000, "soft_limit": 51200},
            "files": {"hard_limit": 20, "soft_limit": 10},
        }
    )

### Retrieving a quota policy tree rule for a specific qtree

##

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule(uuid="49b1134f-19ab-11e9-a04d-005056a72f42")
        resource.get()
        print(resource)

Try it out

    QuotaRule(
        {
            "uuid": "49b1134f-19ab-11e9-a04d-005056a72f42",
            "volume": {
                "name": "vol1",
                "uuid": "c1b64eea-ca8b-45ec-9397-ab489830d268",
                "_links": {
                    "self": {
                        "href": "/api/storage/volumes/c1b64eea-ca8b-45ec-9397-ab489830d268"
                    }
                },
            },
            "_links": {
                "self": {
                    "href": "/api/storage/quota/rules/49b1134f-19ab-11e9-a04d-005056a72f42"
                }
            },
            "svm": {
                "name": "svm1",
                "uuid": "fd5db15a-15b9-11e9-a6ad-005056a760e0",
                "_links": {
                    "self": {"href": "/api/svm/svms/fd5db15a-15b9-11e9-a6ad-005056a760e0"}
                },
            },
            "qtree": {
                "_links": {
                    "self": {
                        "href": "/api/storage/qtrees/c1b64eea-ca8b-45ec-9397-ab489830d268/1"
                    }
                },
                "id": 1,
                "name": "qt1",
            },
            "type": "tree",
            "space": {"hard_limit": 1048576, "soft_limit": 838861},
            "files": {"hard_limit": 100, "soft_limit": 40},
        }
    )

### Retrieving a quota policy group rule for a specific qtree

##

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule(uuid="b9236852-19ab-11e9-a04d-005056a72f42")
        resource.get()
        print(resource)

Try it out

    QuotaRule(
        {
            "uuid": "b9236852-19ab-11e9-a04d-005056a72f42",
            "volume": {
                "name": "vol1",
                "uuid": "c1b64eea-ca8b-45ec-9397-ab489830d268",
                "_links": {
                    "self": {
                        "href": "/api/storage/volumes/c1b64eea-ca8b-45ec-9397-ab489830d268"
                    }
                },
            },
            "_links": {
                "self": {
                    "href": "/api/storage/quota/rules/b9236852-19ab-11e9-a04d-005056a72f42"
                }
            },
            "svm": {
                "name": "svm1",
                "uuid": "fd5db15a-15b9-11e9-a6ad-005056a760e0",
                "_links": {
                    "self": {"href": "/api/svm/svms/fd5db15a-15b9-11e9-a6ad-005056a760e0"}
                },
            },
            "qtree": {
                "_links": {
                    "self": {
                        "href": "/api/storage/qtrees/c1b64eea-ca8b-45ec-9397-ab489830d268/1"
                    }
                },
                "id": 1,
                "name": "qt1",
            },
            "type": "group",
            "space": {"hard_limit": 2097152, "soft_limit": 1572864},
            "files": {"hard_limit": 250, "soft_limit": 200},
            "group": {"name": "group1"},
        }
    )

### Creating a quota policy rule

This API is used to create a new quota policy rule. When an explicit rule or a qtree-scoped rule of a type is created on a volume, a default rule of the same type is automatically added if it does not already exist on the volume.
The following example shows how to create a quota policy user rule using POST.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule()
        resource.svm.name = "svm1"
        resource.volume.name = "vol1"
        resource.type = "user"
        resource.users = [{"name": "jsmith"}]
        resource.qtree.name = "qt1"
        resource.user_mapping = "on"
        resource.space.hard_limit = 8192
        resource.space.soft_limit = 1024
        resource.files.hard_limit = 20
        resource.files.soft_limit = 10
        resource.post(hydrate=True)
        print(resource)

Try it out

    QuotaRule(
        {
            "uuid": "3220eea6-5049-11e9-bfb7-005056a7f717",
            "users": [{"name": "jsmith"}],
            "volume": {"name": "fv"},
            "_links": {
                "self": {
                    "href": "/api/storage/quota/rules/3220eea6-5049-11e9-bfb7-005056a7f717"
                }
            },
            "svm": {"name": "svm1"},
            "qtree": {"name": "qt1"},
            "type": "user",
            "space": {"hard_limit": 8192, "soft_limit": 1024},
            "user_mapping": True,
            "files": {"hard_limit": 20, "soft_limit": 10},
        }
    )

### Creating a quota policy group rule using POST.

##

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule()
        resource.svm.name = "svm1"
        resource.volume.name = "vol1"
        resource.type = "group"
        resource.group.name = "test_group1"
        resource.qtree.name = "qt1"
        resource.space.hard_limit = 8192
        resource.space.soft_limit = 1024
        resource.files.hard_limit = 20
        resource.files.soft_limit = 10
        resource.post(hydrate=True)
        print(resource)

Try it out

    QuotaRule(
        {
            "uuid": "3b130f7d-504a-11e9-bfb7-005056a7f717",
            "volume": {"name": "fv"},
            "_links": {
                "self": {
                    "href": "/api/storage/quota/rules/3b130f7d-504a-11e9-bfb7-005056a7f717"
                }
            },
            "svm": {"name": "svm1"},
            "qtree": {"name": "qt1"},
            "type": "group",
            "space": {"hard_limit": 8192, "soft_limit": 1024},
            "files": {"hard_limit": 20, "soft_limit": 10},
            "group": {"name": "test_group1"},
        }
    )

### Creating a quota policy tree rule using POST

##

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule()
        resource.svm.name = "svm1"
        resource.volume.name = "vol1"
        resource.type = "tree"
        resource.qtree.name = "qt1"
        resource.space.hard_limit = 8192
        resource.space.soft_limit = 1024
        resource.files.hard_limit = 20
        resource.files.soft_limit = 10
        resource.post(hydrate=True)
        print(resource)

Try it out

    QuotaRule(
        {
            "uuid": "e5eb03be-504a-11e9-bfb7-005056a7f717",
            "volume": {"name": "fv"},
            "_links": {
                "self": {
                    "href": "/api/storage/quota/rules/e5eb03be-504a-11e9-bfb7-005056a7f717"
                }
            },
            "svm": {"name": "svm1"},
            "qtree": {"name": "qt1"},
            "type": "tree",
            "space": {"hard_limit": 8192, "soft_limit": 1024},
            "files": {"hard_limit": 20, "soft_limit": 10},
        }
    )

### Updating the quota policy rule

This API is used to update a quota policy rule.
The following example shows how to update a quota policy rule.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule(uuid="364d38eb-8e87-11e8-a806-005056a7e73a")
        resource.space.hard_limit = 16554
        resource.space.soft_limit = 8192
        resource.files.hard_limit = 40
        resource.files.soft_limit = 20
        resource.patch()

### Deleting the quota policy rule

This API is used to delete a quota policy rule.
The following example shows how to delete a quota policy rule.

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import QuotaRule

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = QuotaRule(uuid="364d38eb-8e87-11e8-a806-005056a7e73a")
        resource.delete()

## Classes

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

  Allows interaction with QuotaRule objects on the host

  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`

    Retrieves quota policy rules configured for all FlexVol volumes and FlexGroup volumes.

    ### Related ONTAP commands

    - `quota policy rule show`

    ### Learn more

    - `DOC /storage/quota/rules`

    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, body: typing.Union = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Deletes a quota policy rule.

    ### Related ONTAP commands

    - `quota policy rule delete`

    ### Learn more

    - `DOC /storage/quota/rules`

    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.
    `body`
      The body of the delete request. This could be a Resource instance or a dictionary object.
    `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 find(*args, connection: HostConnection = None, **kwargs) -> Resource`

    Retrieves quota policy rules configured for all FlexVol volumes and FlexGroup volumes.

    ### Related ONTAP commands

    - `quota policy rule show`

    ### Learn more

    - `DOC /storage/quota/rules`

    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) -> typing.Iterable`

    Retrieves quota policy rules configured for all FlexVol volumes and FlexGroup volumes.

    ### Related ONTAP commands

    - `quota policy rule show`

    ### Learn more

    - `DOC /storage/quota/rules`

    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, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Updates properties of a specific quota policy rule.
    Important notes: * The quota resize functionality is supported with the PATCH operation. * Quota resize allows you to modify the quota limits, directly in the filesystem. * The quota must be enabled on a FlexVol or a FlexGroup volume for `quota resize` to take effect. * If the quota is disabled on the volume, the quota policy rule PATCH API modifies the rule, but this does not affect the limits in the filesystem.

    ### Related ONTAP commands

    - `quota policy rule modify`
    - `quota resize`

    ### Learn more

    - `DOC /storage/quota/rules`

    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.
    `*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.
    `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

  ### Methods

  `def delete(self, body: typing.Union = None, poll: bool = True, poll_interval: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse`

    Deletes a quota policy rule.

    ### Related ONTAP commands

    - `quota policy rule delete`

    ### Learn more

    - `DOC /storage/quota/rules`

    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 properties for a specific quota policy rule.

    ### Related ONTAP commands

    - `quota policy rule show`

    ### Learn more

    - `DOC /storage/quota/rules`

    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: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse`

    Updates properties of a specific quota policy rule.
    Important notes: * The quota resize functionality is supported with the PATCH operation. * Quota resize allows you to modify the quota limits, directly in the filesystem. * The quota must be enabled on a FlexVol or a FlexGroup volume for `quota resize` to take effect. * If the quota is disabled on the volume, the quota policy rule PATCH API modifies the rule, but this does not affect the limits in the filesystem.

    ### Related ONTAP commands

    - `quota policy rule modify`
    - `quota resize`

    ### Learn more

    - `DOC /storage/quota/rules`

    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: typing.Union = None, poll_timeout: typing.Union = None, **kwargs) -> NetAppResponse`

    Creates a quota policy rule for a FlexVol or a FlexGroup volume.
    Important notes: * Unlike CLI/ONTAPI, the `quota policy` input is not needed for POST.

    ### Required properties

    - `svm.uuid` or `svm.name` - Existing SVM in which to create the qtree.
    - `volume.uuid` or `volume.name` - Existing volume in which to create the qtree.
    - `type` - Quota type for the rule. This type can be `user`, `group`, or `tree`.
    - `users.name` or `user.id` - If the quota type is user, this property takes the user name or user ID. For default user quota rules, the user name must be specified as "".
    - `group.name` or `group.id` - If the quota type is group, this property takes the group name or group ID. For default group quota rules, the group name must be specified as "".
    - `qtree.name` - Qtree for which to create the rule. For default tree rules, the qtree name must be specified as "".

    ### Recommended optional properties

    - `space.hard_limit` - Specifies the space hard limit, in bytes. If less than 1024 bytes, the value is rounded up to 1024 bytes.
    - `space.soft_limit` - Specifies the space soft limit, in bytes. If less than 1024 bytes, the value is rounded up to 1024 bytes.
    - `files.hard_limit` - Specifies the hard limit for files.
    - `files.hard_limit` - Specifies the soft limit for files.
    - `user_mapping` - Specifies the user_mapping. This property is valid only for quota policy rules of type `user`.

    ### Related ONTAP commands

    - `quota policy rule create`

    ### Learn more

    - `DOC /storage/quota/rules`

    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 QuotaRuleSchema (*, only: typing.Union = None, exclude: typing.Union = (), many: bool = False, context: typing.Dict = None, load_only: typing.Union = (), dump_only: typing.Union = (), partial: typing.Union = False, unknown: str = None)`

  The fields of the QuotaRule object

  ### Ancestors

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

  ### Class variables

  `files GET POST PATCH`

    The files field of the quota_rule.

  `group GET POST`

    The group field of the quota_rule.

  `links GET`

    The links field of the quota_rule.

  `qtree GET POST`

    The qtree field of the quota_rule.

  `space GET POST PATCH`

    The space field of the quota_rule.

  `svm GET POST`

    The svm field of the quota_rule.

  `type GET POST`

    This parameter specifies the quota policy rule type. This is required in POST only and can take either one of the "user", "group" or "tree" values.

    Valid choices:

    - tree
    - user
    - group
  `user_mapping GET POST PATCH`

    This parameter enables user mapping for user quota policy rules. This is valid in POST or PATCH for user quota policy rules only.

  `users GET POST`

    This parameter specifies the target user to which the user quota policy rule applies. This parameter takes single or multiple user names or identifiers. This parameter is valid only for the POST operation of a user quota policy rule. If this parameter is used as an input to create a group or a tree quota policy rule, the POST operation will fail with an appropriate error. For POST, this input parameter takes either a user name or a user identifier, not both. For default quota rules, the user name must be chosen and specified as "". For explicit user quota rules, this parameter can indicate either a user name or user identifier. The user name can be a UNIX user name or a Windows user name. If a name contains a space, enclose the entire value in quotes. A UNIX user name cannot include a backslash () or an @ sign; user names with these characters are treated as Windows names. The user identifer can be a UNIX user identifier or a Windows security identifier. For multi-user quota, this parameter can contain multiple user targets separated by a comma.

  `uuid GET`

    Unique identifier for the quota policy rule. This field is generated when the quota policy rule is created.

    Example: 5f1d13a7-f401-11e8-ac1a-005056a7c3b9

  `volume GET POST`

    The volume field of the quota_rule.