Skip to content

Latest commit

 

History

History
95 lines (67 loc) · 4.36 KB

SettingsStatisticsApi.md

File metadata and controls

95 lines (67 loc) · 4.36 KB

docspace_api_sdk.StatisticsApi

All URIs are relative to https://your-docspace.onlyoffice.com

Method HTTP request Description
get_space_usage_statistics GET /api/2.0/settings/statistics/spaceusage/{id} Get the space usage statistics

get_space_usage_statistics

UsageSpaceStatItemArrayWrapper get_space_usage_statistics(id)

Returns the storage space used by one portal module, broken down per data category the module tracks (for example per room type), together with a human-readable size and whether the category is disabled. Requires Owner or DocSpaceAdmin (the EditPortalSettings permission). id identifies the module by the same GUID the portal's module catalog uses; a module that does not exist, or one that does not report space usage at all, returns an empty list rather than an error. This is a read-only, idempotent call, and the list is not paginated. Sizes are already formatted as display strings (for example 1.5 GB), not raw byte counts.

For more information, see api.onlyoffice.com.

Parameters

Name Type Description Notes
id UUID The identifier of the object the operation acts on, as the listing operation of that kind of object reports it. It has to match the shape the route declares - a GUID where the route is typed as one - since a value of another shape does not match the route at all and is answered as not found.

Return type

UsageSpaceStatItemArrayWrapper

Authorization

Basic, OAuth2, ApiKeyBearer, asc_auth_key, Bearer, OpenId

Example

import docspace_api_sdk
from docspace_api_sdk.models.usage_space_stat_item_array_wrapper import UsageSpaceStatItemArrayWrapper
from docspace_api_sdk.rest import ApiException
from pprint import pprint

configuration = docspace_api_sdk.Configuration(
    host = "https://your-docspace.onlyoffice.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = docspace_api_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with docspace_api_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = docspace_api_sdk.StatisticsApi(api_client)
    id = UUID('1') # UUID | The identifier of the object the operation acts on, as the listing operation of that kind of object reports  it. It has to match the shape the route declares - a GUID where the route is typed as one - since a value of  another shape does not match the route at all and is answered as not found.

    try:
        # Get the space usage statistics
        api_response = api_instance.get_space_usage_statistics(id)
        print("The response of StatisticsApi->get_space_usage_statistics:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling StatisticsApi->get_space_usage_statistics: %s\n" % e)

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Per-category space usage statistics for the requested module * X-RateLimit-Limit -
* X-RateLimit-Remaining -
* X-RateLimit-Reset -
403 The caller has no portal-settings right -
401 Unauthorized -
429 Too Many Requests. * Retry-After -
500 Internal Server Error. -
400 Bad Request. -
502 Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON. -
503 Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]