# Module `netapp_ontap.resources.s3_bucket_svm`

Copyright © 2023 NetApp Inc. All rights reserved.

This file has been automatically generated based on the ONTAP REST API documentation.

## Overview

An S3 bucket is a container of objects. Each bucket defines an object namespace. S3 server requests specify objects using a bucket-name and object-name pair. An object consists of data, along with optional metadata and access controls, accessible via a name. An object resides within a bucket. There can be more than one bucket in an S3 server. Buckets which are created for the server are associated with an S3 user that is created on the S3 server. An access policy is an object that when associated with a resource, defines their permissions. Buckets and objects are defined as resources. By default, only the "root" user can access these resources. Access policies are used to manage access to these resources by enabling ONTAP admin to provide "grants" to allow other users to perform operations on the buckets.

## Examples

### Retrieving all fields for all S3 buckets of an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        print(
            list(
                S3BucketSvm.get_collection(
                    "12f3ba4c-7ae0-11e9-8c06-0050568ea123", fields="**"
                )
            )
        )

Try it out

    [
        S3BucketSvm(
            {
                "audit_event_selector": {"permission": "all", "access": "all"},
                "encryption": {"enabled": False},
                "logical_used_size": 157286400,
                "uuid": "527812ab-7c6d-11e9-97e8-0050568ea123",
                "qos_policy": {
                    "name": "vs0_auto_gen_policy_39a9522f_ff35_11e9_b0f9_005056a7ab52",
                    "uuid": "39ac471f-ff35-11e9-b0f9-005056a7ab52",
                },
                "size": 209715200,
                "comment": "S3 bucket.",
                "svm": {"uuid": "12f3ba4c-7ae0-11e9-8c06-0050568ea123", "name": "vs1"},
                "volume": {
                    "uuid": "51276f5f-7c6d-11e9-97e8-0050568ea123",
                    "name": "fg_oss_1558514455",
                },
                "name": "bucket-2",
            }
        ),
        S3BucketSvm(
            {
                "policy": {
                    "statements": [
                        {
                            "principals": ["Alice"],
                            "resources": ["*"],
                            "sid": "fullAccessForAliceToBucket",
                            "actions": ["*"],
                            "effect": "allow",
                        },
                        {
                            "principals": ["ann", "jack"],
                            "resources": ["bucket-1", "bucket-1/*"],
                            "sid": "AccessToListAndGetObjectForAnnAndJack",
                            "actions": ["ListBucket", "GetObject"],
                            "effect": "allow",
                            "conditions": [
                                {"source_ips": ["1.1.1.1/10"], "operator": "ip_address"},
                                {
                                    "delimiters": ["del1", "del2"],
                                    "prefixes": ["pref1", "pref2"],
                                    "usernames": ["user1", "user2"],
                                    "operator": "string_equals",
                                },
                                {"max_keys": [100], "operator": "numeric_equals"},
                            ],
                        },
                        {
                            "principals": ["mike", "group/group1", "nasgroup/group2"],
                            "resources": [
                                "bucket-1/policy-docs/*",
                                "bucket-1/confidential-*",
                            ],
                            "sid": "DenyAccessToGetPutDeleteObjectForMike",
                            "actions": ["*Object"],
                            "effect": "deny",
                        },
                        {
                            "principals": ["*"],
                            "resources": ["bucket-1/readme"],
                            "sid": "AccessToGetObjectForAnonymousUsers",
                            "actions": ["GetObject"],
                            "effect": "allow",
                        },
                        {
                            "principals": [],
                            "resources": ["bucket-1/policies/examples/*"],
                            "sid": "AccessToGetObjectForAllUsersOfSVM",
                            "actions": ["GetObject"],
                            "effect": "allow",
                        },
                    ]
                },
                "encryption": {"enabled": False},
                "logical_used_size": 0,
                "uuid": "a8234aec-7e06-11e9-97e8-0050568ea123",
                "qos_policy": {
                    "name": "vs0_auto_gen_policy_39a9522f_ff35_11e9_b0f9_005056a7ab52",
                    "uuid": "39ac471f-ff35-11e9-b0f9-005056a7ab52",
                },
                "size": 1677721600,
                "comment": "bucket1",
                "svm": {"uuid": "12f3ba4c-7ae0-11e9-8c06-0050568ea123", "name": "vs1"},
                "volume": {
                    "uuid": "a36a1ea7-7e06-11e9-97e8-0050568ea123",
                    "name": "fg_oss_1558690256",
                },
                "name": "bucket-1",
            }
        ),
    ]

### Retrieving the specified bucket associated with an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = S3BucketSvm(
            "12f3ba4c-7ae0-11e9-8c06-0050568ea123",
            uuid="527812ab-7c6d-11e9-97e8-0050568ea123",
        )
        resource.get()
        print(resource)

Try it out

    S3BucketSvm(
        {
            "encryption": {"enabled": False},
            "logical_used_size": 157286400,
            "uuid": "527812ab-7c6d-11e9-97e8-0050568ea123",
            "qos_policy": {
                "name": "vs0_auto_gen_policy_39a9522f_ff35_11e9_b0f9_005056a7ab52",
                "uuid": "39ac471f-ff35-11e9-b0f9-005056a7ab52",
            },
            "size": 209715200,
            "comment": "S3 bucket.",
            "svm": {"uuid": "12f3ba4c-7ae0-11e9-8c06-0050568ea123", "name": "vs1"},
            "volume": {
                "uuid": "51276f5f-7c6d-11e9-97e8-0050568ea123",
                "name": "fg_oss_1558514455",
            },
            "name": "bucket-2",
        }
    )

### Creating an S3 bucket for an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="netapp1!", verify=False):
        resource = S3BucketSvm("12f3ba4c-7ae0-11e9-8c06-0050568ea123")
        resource.aggregates = [
            {"name": "aggr5", "uuid": "12f3ba4c-7ae0-11e9-8c06-0050568ea123"}
        ]
        resource.comment = "S3 bucket."
        resource.constituents_per_aggregate = 4
        resource.name = "bucket-3"
        resource.post(hydrate=True)
        print(resource)

Try it out

    S3BucketSvm({"comment": "S3 bucket.", "name": "bucket-3"})

### Creating an S3 bucket along with QoS policies and event selector for an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="netapp1!", verify=False):
        resource = S3BucketSvm("3e538980-f0af-11e9-ba68-0050568e9798")
        resource.comment = "S3 bucket."
        resource.name = "bucket-3"
        resource.qos_policy = {
            "min_throughput_iops": 0,
            "min_throughput_mbps": 0,
            "max_throughput_iops": 1000000,
            "max_throughput_mbps": 900000,
            "uuid": "02d07a93-6177-11ea-b241-000c293feac8",
            "name": "vs0_auto_gen_policy_02cfa02a_6177_11ea_b241_000c293feac8",
        }
        resource.audit_event_selector = {"access": "all", "permission": "all"}
        resource.post(hydrate=True)
        print(resource)

Try it out

    S3BucketSvm({"comment": "S3 bucket.", "name": "bucket-3"})

### Creating an S3 bucket along with policies for an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="netapp1!", verify=False):
        resource = S3BucketSvm("3e538980-f0af-11e9-ba68-0050568e9798")
        resource.aggregates = [
            {"name": "aggr5", "uuid": "12f3ba4c-7ae0-11e9-8c06-0050568ea123"}
        ]
        resource.comment = "S3 bucket."
        resource.constituents_per_aggregate = 4
        resource.name = "bucket-3"
        resource.policy = {
            "statements": [
                {
                    "actions": ["GetObject"],
                    "conditions": [
                        {
                            "operator": "ip_address",
                            "source_ips": ["1.1.1.1/23", "1.2.2.2/20"],
                        },
                        {"max_keys": [1000], "operator": "numeric_equals"},
                        {
                            "delimiters": ["/"],
                            "operator": "string_equals",
                            "prefixes": ["pref"],
                            "usernames": ["user1"],
                        },
                    ],
                    "effect": "allow",
                    "resources": ["bucket-3/policies/examples/*"],
                    "sid": "AccessToGetObjectForAllUsersofSVM",
                },
                {
                    "actions": ["*Object"],
                    "effect": "deny",
                    "principals": ["mike", "group/grp1"],
                    "resources": ["bucket-3/policy-docs/*", "bucket-3/confidential-*"],
                    "sid": "DenyAccessToObjectForMike",
                },
                {
                    "actions": ["GetObject"],
                    "effect": "allow",
                    "principals": ["*"],
                    "resources": ["bucket-3/readme"],
                    "sid": "AnonnymousAccessToGetObjectForUsers",
                },
            ]
        }
        resource.post(hydrate=True)
        print(resource)

Try it out

    S3BucketSvm({"comment": "S3 bucket.", "name": "bucket-3"})

### Creating an S3 bucket along with lifecycle management rules

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="netapp1!", verify=False):
        resource = S3BucketSvm("3e538980-f0af-11e9-ba68-0050568e9798")
        resource.aggregates = [
            {"name": "aggr5", "uuid": "12f3ba4c-7ae0-11e9-8c06-0050568ea123"}
        ]
        resource.comment = "S3 bucket."
        resource.constituents_per_aggregate = 4
        resource.name = "bucket-4"
        resource.lifecycle_management = {
            "rules": [
                {
                    "name": "rule1",
                    "expiration": {"object_age_days": "1000"},
                    "abort_incomplete_multipart_upload": {"after_initiaion_days": 200},
                    "object_filter": {"prefix": "obj1*/", "size_greater_than": "1000"},
                },
                {
                    "name": "rule2",
                    "object_filter": {"size_greater_than": "50"},
                    "expiration": {"object_age_days": "5000"},
                },
            ]
        }
        resource.post(hydrate=True)
        print(resource)

Try it out

    S3BucketSvm({"comment": "S3 bucket.", "name": "bucket-4"})

### Creating an S3 bucket with object locking enabled for an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="netapp1!", verify=False):
        resource = S3BucketSvm("12f3ba4c-7ae0-11e9-8c06-0050568ea143")
        resource.aggregates = [
            {"name": "aggr5", "uuid": "12f3ba4c-7ae0-11e9-8c06-0050568ea143"}
        ]
        resource.comment = "S3 Compliance mode bucket."
        resource.constituents_per_aggregate = 4
        resource.name = "bucket-5"
        resource.retention = {"mode": "compliance", "default_period": "P1Y"}
        resource.post(hydrate=True)
        print(resource)

Try it out

    S3BucketSvm({"comment": "S3 Compliance mode bucket.", "name": "bucket-5"})

### Updating an S3 bucket for an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = S3BucketSvm(
            "12f3ba4c-7ae0-11e9-8c06-0050568ea123",
            uuid="754389d0-7e13-11e9-bfdc-0050568ea122",
        )
        resource.comment = "Bucket modified."
        resource.size = 111111111111
        resource.qos_policy = {
            "min_throughput_iops": 0,
            "min_throughput_mbps": 0,
            "max_throughput_iops": 1000000,
            "max_throughput_mbps": 900000,
            "uuid": "02d07a93-6177-11ea-b241-000c293feac8",
            "name": "vs0_auto_gen_policy_02cfa02a_6177_11ea_b241_000c293feac8",
        }
        resource.patch()

### Updating an S3 bucket policy and event selector for an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = S3BucketSvm(
            "3e538980-f0af-11e9-ba68-0050568e9798",
            uuid="754389d0-7e13-11e9-bfdc-0050568ea122",
        )
        resource.policy = {
            "statements": [
                {
                    "actions": ["*"],
                    "conditions": [
                        {
                            "operator": "ip_address",
                            "source_ips": ["1.1.1.1/23", "1.2.2.2/20"],
                        },
                        {"max_keys": [1000], "operator": "numeric_equals"},
                        {
                            "delimiters": ["/"],
                            "operator": "string_equals",
                            "prefixes": ["pref"],
                            "usernames": ["user1"],
                        },
                    ],
                    "effect": "allow",
                    "resources": ["*"],
                    "sid": "fullAccessForAllPrincipalsToBucket",
                }
            ]
        }
        resource.audit_event_selector = {"access": "read", "permission": "deny"}
        resource.patch()

### Updating the default-retention period on an S3 bucket for an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = S3BucketSvm(
            "3e538980-f0af-11e9-ba68-0050568e9798",
            uuid="754389d0-7e13-11e9-bfdc-0050568ea122",
        )
        resource.retention = {"default_period": "P10Y"}
        resource.patch()

### Deleting an S3 bucket policy for an SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="password", verify=False):
        resource = S3BucketSvm(
            "3e538980-f0af-11e9-ba68-0050568e9798",
            uuid="754389d0-7e13-11e9-bfdc-0050568ea122",
        )
        resource.policy = {"statements": []}
        resource.patch()

### Deleting an S3 bucket for a specified SVM

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import S3BucketSvm

    with HostConnection("<mgmt-ip>", username="admin", password="netapp1!", verify=False):
        resource = S3BucketSvm(
            "12f3ba4c-7ae0-11e9-8c06-0050568ea123",
            uuid="754389d0-7e13-11e9-bfdc-0050568ea123",
        )
        resource.delete()

## Classes

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

  A bucket is a container of objects. Each bucket defines an object namespace. S3 requests specify objects using a bucket-name and object-name pair. An object resides within a bucket.

  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`

    Returns a count of all S3BucketSvm 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('S3BucketSvm')] = 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 the S3 bucket configuration of an SVM. An access policy is also deleted on an S3 bucket "delete" command.

    ### Related ONTAP commands

    - `vserver object-store-server bucket delete`
    - `vserver object-store-server bucket policy statement delete`
    - `vserver object-store-server bucket policy-statement-condition delete`
    - `vserver object-store-server bucket lifecycle-management-rule delete`

    ### Learn more

    - `DOC /protocols/s3/services/{svm.uuid}/buckets`

    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 fast_get_collection (*args, connection: HostConnection = None, max_records: int = None, **kwargs) -> Iterable[RawResource]`

    Returns a list of RawResources that represent S3BucketSvm resources that match the provided query

    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
    `raw`
      return a list of `netapp_ontap.resource.RawResource` objects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server.
    `**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 find (*args, connection: HostConnection = None, **kwargs) -> Resource`

    Retrieves the S3 bucket's configuration of an SVM. Note that in order to retrieve S3 bucket policy conditions, the 'fields' option should be set to '**'.

    ### Related ONTAP commands

    - `vserver object-store-server bucket show`
    - `vserver object-store-server bucket policy statement show`
    - `vserver object-store-server bucket policy-statement-condition show`
    - `vserver object-store-server bucket lifecycle-management-rule show`

    ### Learn more

    - `DOC /protocols/s3/services/{svm.uuid}/buckets`

    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 S3 bucket's configuration of an SVM. Note that in order to retrieve S3 bucket policy conditions, the 'fields' option should be set to '**'.

    ### Related ONTAP commands

    - `vserver object-store-server bucket show`
    - `vserver object-store-server bucket policy statement show`
    - `vserver object-store-server bucket policy-statement-condition show`
    - `vserver object-store-server bucket lifecycle-management-rule show`

    ### Learn more

    - `DOC /protocols/s3/services/{svm.uuid}/buckets`

    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
    `raw`
      return a list of `netapp_ontap.resource.RawResource` objects that require to be promoted before any RESTful operations can be used on them. Setting this argument to True makes get_collection substantially quicker when many records are returned from the server.
    `**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('S3BucketSvm')] = None, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> NetAppResponse`

    Updates the S3 bucket configuration of an SVM.

    ### Important notes

    - The following fields can be modified for a bucket:
    - `comment` - Any information related to the bucket.
    - `size` - Bucket size.
    - `policy` - An access policy for resources (buckets and objects) that defines their permissions. New policies are created after existing policies are deleted. To retain any of the existing policy statements, you need to specify those statements again. Policy conditions can also be modified using this API.
    - `qos_policy` - A QoS policy for buckets.
    - `audit_event_selector` - Audit policy for buckets. None can be specified for both access and permission to remove audit event selector.
    - `versioning_state` - Versioning state for buckets.
    - `nas_path` - NAS path to which the NAS bucket corresponds to.
    - `retention.default_period` - Specifies the duration of default-retention applicable for objects on the object store bucket.

    ### Related ONTAP commands

    - `vserver object-store-server bucket modify`
    - `vserver object-store-server bucket policy statement modify`
    - `vserver object-store-server bucket policy-statement-condition modify`

    ### Learn more

    - `DOC /protocols/s3/services/{svm.uuid}/buckets`

    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('S3BucketSvm')], *args, hydrate: bool = False, poll: bool = True, poll_interval: Optional[int] = None, poll_timeout: Optional[int] = None, connection: HostConnection = None, **kwargs) -> Union[List[S3BucketSvm], NetAppResponse]`

    Creates the S3 bucket configuration of an SVM.

    ### Important notes

    - Each SVM can have one or more bucket configurations.
    - Aggregate lists should be specified explicitly. If not specified, then the bucket is auto-provisioned as a FlexGroup.
    - Constituents per aggregate specifies the number of components (or FlexVols) per aggregate. Is specified only when an aggregate list is explicitly defined.
    - An access policy can be created when a bucket is created.
    - "qos_policy" can be specified if a bucket needs to be attached to a QoS group policy during creation time.
    - "audit_event_selector" can be specified if a bucket needs to be specify access and permission type for auditing.

    ### Required properties

    - `svm.uuid` - Existing SVM in which to create the bucket configuration.
    - `name` - Bucket name that is to be created.

    ### Recommended optional properties

    - `aggregates` - List of aggregates for the FlexGroup on which the bucket is hosted on.
    - `constituents_per_aggregate` - Number of constituents per aggregate.
    - `size` - Specifying the bucket size is recommended.
    - `policy` - Specifying policy enables users to perform operations on buckets. Hence specifying the resource permissions is recommended.
    - `qos_policy` - A QoS policy for buckets.
    - `audit_event_selector` - Audit policy for buckets.
    - `versioning_state` - Versioning state for buckets.
    - `type` - Type of bucket.
    - `nas_path` - The NAS path to which the NAS bucket corresponds to.
    - `use_mirrored_aggregates` - Specifies whether mirrored aggregates are selected when provisioning a FlexGroup volume.
    - `lifecycle_management` - Object store server lifecycle management policy.
    - `retention.mode` - Object lock mode supported on the bucket.
    - `retention.default_period` - Specifies the duration of default-retention applicable for objects on the object store bucket.

    ### Default property values

    - `size` - 800MB
    - `comment` - ""
    - `aggregates` - No default value.
    - `constituents_per_aggregate` - 4 , if an aggregates list is specified. Otherwise, no default value.
    - `policy.statements.actions` - GetObject, PutObject, DeleteObject, ListBucket, ListBucketMultipartUploads, ListMultipartUploadParts, GetObjectTagging, PutObjectTagging, DeleteObjectTagging, GetBucketVersioning, PutBucketVersioning.
    - `policy.statements.principals` - all S3 users and groups in the SVM or the NAS groups.
    - `policy.statements.resources` - all objects in the bucket.
    - `policy.statements.conditions` - list of bucket policy conditions.
    - `qos-policy` - No default value.
    - `versioning_state` - disabled.
    - `use_mirrored_aggregates` - true for a MetroCluster configuration and false for a non-MetroCluster configuration.
    - `type` - S3.
    - `retention.mode` - no_lock

    ### Related ONTAP commands

    - `vserver object-store-server bucket create`
    - `vserver object-store-server bucket policy statement create`
    - `vserver object-store-server bucket policy-statement-condition create`
    - `vserver object-store-server bucket lifecycle-management-rule create`

    ### Learn more

    - `DOC /protocols/s3/services/{svm.uuid}/buckets`

    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: Optional[int] = None, poll_timeout: Optional[int] = None, **kwargs) -> NetAppResponse`

    Deletes the S3 bucket configuration of an SVM. An access policy is also deleted on an S3 bucket "delete" command.

    ### Related ONTAP commands

    - `vserver object-store-server bucket delete`
    - `vserver object-store-server bucket policy statement delete`
    - `vserver object-store-server bucket policy-statement-condition delete`
    - `vserver object-store-server bucket lifecycle-management-rule delete`

    ### Learn more

    - `DOC /protocols/s3/services/{svm.uuid}/buckets`

    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 the S3 bucket configuration of an SVM. Note that in order to retrieve S3 bucket policy conditions, the 'fields' option should be set to '**'.

    ### Related ONTAP commands

    - `vserver object-store-server bucket show`
    - `vserver object-store-server bucket policy statement show`
    - `vserver object-store-server bucket policy-statement-condition show`
    - `vserver object-store-server bucket lifecycle-management-rule show`

    ### Learn more

    - `DOC /protocols/s3/services/{svm.uuid}/buckets`

    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 the S3 bucket configuration of an SVM.

    ### Important notes

    - The following fields can be modified for a bucket:
    - `comment` - Any information related to the bucket.
    - `size` - Bucket size.
    - `policy` - An access policy for resources (buckets and objects) that defines their permissions. New policies are created after existing policies are deleted. To retain any of the existing policy statements, you need to specify those statements again. Policy conditions can also be modified using this API.
    - `qos_policy` - A QoS policy for buckets.
    - `audit_event_selector` - Audit policy for buckets. None can be specified for both access and permission to remove audit event selector.
    - `versioning_state` - Versioning state for buckets.
    - `nas_path` - NAS path to which the NAS bucket corresponds to.
    - `retention.default_period` - Specifies the duration of default-retention applicable for objects on the object store bucket.

    ### Related ONTAP commands

    - `vserver object-store-server bucket modify`
    - `vserver object-store-server bucket policy statement modify`
    - `vserver object-store-server bucket policy-statement-condition modify`

    ### Learn more

    - `DOC /protocols/s3/services/{svm.uuid}/buckets`

    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 the S3 bucket configuration of an SVM.

    ### Important notes

    - Each SVM can have one or more bucket configurations.
    - Aggregate lists should be specified explicitly. If not specified, then the bucket is auto-provisioned as a FlexGroup.
    - Constituents per aggregate specifies the number of components (or FlexVols) per aggregate. Is specified only when an aggregate list is explicitly defined.
    - An access policy can be created when a bucket is created.
    - "qos_policy" can be specified if a bucket needs to be attached to a QoS group policy during creation time.
    - "audit_event_selector" can be specified if a bucket needs to be specify access and permission type for auditing.

    ### Required properties

    - `svm.uuid` - Existing SVM in which to create the bucket configuration.
    - `name` - Bucket name that is to be created.

    ### Recommended optional properties

    - `aggregates` - List of aggregates for the FlexGroup on which the bucket is hosted on.
    - `constituents_per_aggregate` - Number of constituents per aggregate.
    - `size` - Specifying the bucket size is recommended.
    - `policy` - Specifying policy enables users to perform operations on buckets. Hence specifying the resource permissions is recommended.
    - `qos_policy` - A QoS policy for buckets.
    - `audit_event_selector` - Audit policy for buckets.
    - `versioning_state` - Versioning state for buckets.
    - `type` - Type of bucket.
    - `nas_path` - The NAS path to which the NAS bucket corresponds to.
    - `use_mirrored_aggregates` - Specifies whether mirrored aggregates are selected when provisioning a FlexGroup volume.
    - `lifecycle_management` - Object store server lifecycle management policy.
    - `retention.mode` - Object lock mode supported on the bucket.
    - `retention.default_period` - Specifies the duration of default-retention applicable for objects on the object store bucket.

    ### Default property values

    - `size` - 800MB
    - `comment` - ""
    - `aggregates` - No default value.
    - `constituents_per_aggregate` - 4 , if an aggregates list is specified. Otherwise, no default value.
    - `policy.statements.actions` - GetObject, PutObject, DeleteObject, ListBucket, ListBucketMultipartUploads, ListMultipartUploadParts, GetObjectTagging, PutObjectTagging, DeleteObjectTagging, GetBucketVersioning, PutBucketVersioning.
    - `policy.statements.principals` - all S3 users and groups in the SVM or the NAS groups.
    - `policy.statements.resources` - all objects in the bucket.
    - `policy.statements.conditions` - list of bucket policy conditions.
    - `qos-policy` - No default value.
    - `versioning_state` - disabled.
    - `use_mirrored_aggregates` - true for a MetroCluster configuration and false for a non-MetroCluster configuration.
    - `type` - S3.
    - `retention.mode` - no_lock

    ### Related ONTAP commands

    - `vserver object-store-server bucket create`
    - `vserver object-store-server bucket policy statement create`
    - `vserver object-store-server bucket policy-statement-condition create`
    - `vserver object-store-server bucket lifecycle-management-rule create`

    ### Learn more

    - `DOC /protocols/s3/services/{svm.uuid}/buckets`

    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

  - `Resource`:
    - `from_dict`
    - `get_collection_url`
    - `get_connection`
    - `instance_location`
    - `path_keys`
    - `poll`
    - `set_connection`
    - `to_dict`
`class S3BucketSvmSchema (*, 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 S3BucketSvm object

  ### Ancestors

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

  ### Class variables

  `aggregates: List[S3BucketAggregates] POST`

    A list of aggregates for FlexGroup volume constituents where the bucket is hosted. If this option is not specified, the bucket is auto-provisioned as a FlexGroup volume. The "uuid" field cannot be used with the field "storage_service_level".

  `audit_event_selector: S3AuditEventSelector GET POST PATCH`

    The audit_event_selector field of the s3_bucket_svm.

  `comment: str GET POST PATCH`

    Can contain any additional information about the bucket being created or modified.

    Example: S3 bucket.

  `constituents_per_aggregate: Size POST`

    Specifies the number of constituents or FlexVol volumes per aggregate. A FlexGroup volume consisting of all such constituents across all specified aggregates is created. This option is used along with the aggregates option and cannot be used independently. This field cannot be set using the PATCH method.

    Example: 4

  `encryption: S3BucketSvmEncryption GET`

    The encryption field of the s3_bucket_svm.

  `lifecycle_management: S3BucketSvmLifecycleManagement GET POST PATCH`

    The lifecycle_management field of the s3_bucket_svm.

  `logical_used_size: Size GET`

    Specifies the bucket logical used size up to this point. This field cannot be set using the PATCH method.

  `name: str GET POST`

    Specifies the name of the bucket. Bucket name is a string that can only contain the following combination of ASCII-range alphanumeric characters 0-9, a-z, ".", and "-".

    Example: bucket1

  `nas_path: str GET POST PATCH`

    Specifies the NAS path to which the nas bucket corresponds to.

    Example: /

  `policy: S3BucketPolicy GET POST PATCH`

    The policy field of the s3_bucket_svm.

  `protection_status: S3BucketSvmProtectionStatus GET POST PATCH`

    The protection_status field of the s3_bucket_svm.

  `qos_policy: QosPolicy GET POST PATCH`

    The qos_policy field of the s3_bucket_svm.

  `retention: S3BucketRetention GET POST PATCH`

    The retention field of the s3_bucket_svm.

  `role: str GET`

    Specifies the role of the bucket. This field cannot be set in a POST method.

    Valid choices:

    - standalone
    - active
    - passive
  `size: Size GET POST PATCH`

    Specifies the bucket size in bytes; ranges from 190MB to 62PB.

    Example: 819200000

  `storage_service_level: str POST`

    Specifies the storage service level of the FlexGroup volume on which the bucket should be created. Valid values are "value", "performance" or "extreme". This field cannot be used with the field "aggregates.uuid" or with the "constituents_per_aggregate" in a POST method. This field cannot be set using the PATCH method.

    Valid choices:

    - value
    - performance
    - extreme
  `svm: Svm GET`

    The svm field of the s3_bucket_svm.

  `type: str GET POST PATCH`

    Specifies the bucket type. Valid values are "s3"and "nas". This field cannot be set using the PATCH method.

    Valid choices:

    - s3
    - nas
  `uuid: str GET`

    Specifies the unique identifier of the bucket. This field cannot be specified in a POST or PATCH method.

  `versioning_state: str GET POST PATCH`

    Specifies the versioning state of the bucket. Valid values are "disabled", "enabled" or "suspended". Note that the versioning state cannot be modified to 'disabled' from any other state.

    Valid choices:

    - disabled
    - enabled
    - suspended
  `volume: Volume GET`

    The volume field of the s3_bucket_svm.