# Module `netapp_ontap.resources.web_statistics`

Copyright © 2022 NetApp Inc. All rights reserved.

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

## Overview

You can use this API to retrieve the current configuration for a collection of nodes. The following operations are supported:

- Collection Get: GET /cluster/web/statistics

## Examples

### Retrieving the current configuration for a collection of nodes

The following example shows the list of web configuration for a collection of nodes. "br/":

    from netapp_ontap import HostConnection
    from netapp_ontap.resources import WebStatistics

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

Try it out

    [
        WebStatistics(
            {
                "total_http_ops": 4,
                "total_connections": 100,
                "connection_wait_period": {"mean": 2, "peak": 5, "total": 4},
                "status_code": 200,
                "node": {
                    "_links": {
                        "self": {
                            "href": "/api/cluster/nodes/13bb2092-458b-11e9-9c06-0050568ea64e"
                        }
                    },
                    "uuid": "13bb2092-458b-11e9-9c06-0050568ea64e",
                    "name": "node1",
                },
                "total_bytes": 2129,
                "state": "online",
                "total_csrf_token": 0,
                "total_delayed_connections": 2,
                "concurrency": {"peak_per_address": 1, "peak": 1},
                "total_hits": 4,
                "workers": {
                    "reading": 0,
                    "keep_alive": 0,
                    "writing": 1,
                    "logging": 0,
                    "available": 95,
                    "total": 96,
                    "busy": 1,
                    "ready": 95,
                    "closing": 0,
                },
                "total_rc": {
                    "range_3xx": 0,
                    "range_1xx": 0,
                    "range_4xx": 3,
                    "range_5xx": 0,
                    "range_2xx": 4,
                },
                "_links": {
                    "self": {
                        "href": "/api/cluster/web/statistics/13bb2092-458b-11e9-9c06-0050568ea64e"
                    }
                },
                "total_https_ops": 3,
                "total_pending_authentication": 0,
            }
        )
    ]

## Classes

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

  Allows interaction with WebStatistics 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`

    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 find(*args, connection: HostConnection = None, **kwargs) -> Resource`

    Retrieves the web services configuration for a collection of nodes.

    ### Learn more

    - `DOC /cluster/web/statistics`

    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 web services configuration for a collection of nodes.

    ### Learn more

    - `DOC /cluster/web/statistics`

    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.

  ### Inherited members

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

  ### Ancestors

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

  ### Class variables

  `concurrency: WebStatisticsConcurrency GET POST PATCH`

    The concurrency field of the web_statistics.

  `connection_wait_period: WebStatisticsConnectionWaitPeriod GET POST PATCH`

    The connection_wait_period field of the web_statistics.

  `links: SelfLink GET`

    The links field of the web_statistics.

  `node: Node GET POST PATCH`

    The node field of the web_statistics.

  `state: str GET`

    Describes the operational state of node-level web services. This parameter does not reflect whether protocols are externally visible, but whether the server processes are running correctly.

    Valid choices:

    - offline
    - partial
    - mixed
    - online
    - unclustered
  `status_code: Size GET`

    Indicates the HTTP protocol return code received from the web server when the state is retrieved.

    Example: 200

  `total_bytes: Size GET`

    Indicates the total number of bytes returned by the web server.

    Example: 2129

  `total_connections: Size GET`

    Indicates the number of connections that have been accepted by the web server. This is persistent across restarts.

    Example: 7

  `total_csrf_token: Size GET`

    Indicates how many CSRF tokens currently exist.

    Example: 0

  `total_delayed_connections: Size GET`

    Indicates the number of connections that have been held in the wait queue. This is persistent across restarts.

    Example: 0

  `total_hits: Size GET`

    Indicates the total number of requests serviced by the web server.

    Example: 4

  `total_http_ops: Size GET`

    Indicates the total number of requests that were serviced over a traditional HTTP protocol.

    Example: 4

  `total_https_ops: Size GET`

    Indicates the total number of requests that were serviced over an encrypted HTTP (HTTPS) protocol.

    Example: 3

  `total_pending_authentication: Size GET`

    Indicates the total number of requests that are currently waiting on authentication.

    Example: 0

  `total_rc: WebStatisticsTotalRc GET POST PATCH`

    The total_rc field of the web_statistics.

  `workers: WebStatisticsWorkers GET POST PATCH`

    The workers field of the web_statistics.